-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for editing solution file
- Loading branch information
heku
committed
Feb 23, 2019
1 parent
39642c3
commit 6f3710f
Showing
7 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.IO; | ||
|
||
namespace Kool.EditProject.Commands | ||
{ | ||
internal sealed class EditSolutionCommand : BaseCommand | ||
{ | ||
public static EditSolutionCommand Instance { get; private set; } | ||
|
||
public static void Initialize(EditProjectPackage package) | ||
{ | ||
Instance = new EditSolutionCommand(package); | ||
package.CommandService.AddCommand(Instance); | ||
} | ||
|
||
private string _solutionFile; | ||
|
||
private EditSolutionCommand(EditProjectPackage package) | ||
: base(package, Ids.CMD_SET, Ids.EDIT_SOLUTION_MENU_COMMAND_ID) | ||
{ | ||
} | ||
|
||
protected override void OnBeforeQueryStatus() | ||
{ | ||
_solutionFile = Package.DTE.Solution.FullName; | ||
Text = string.Format(VSPackage.EditMenuPattern, Path.GetFileName(_solutionFile)); | ||
} | ||
|
||
protected override void OnExecute() | ||
{ | ||
if (IsEditing(_solutionFile)) | ||
{ | ||
ActiveDocument(_solutionFile); | ||
} | ||
else | ||
{ | ||
OpenDocument(_solutionFile); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters