-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
11 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
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
71 changes: 71 additions & 0 deletions
71
ConEmuIntegration/SolutionExplorer/OpenConEmuHereItemNode.cs
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,71 @@ | ||
// | ||
// Copyright 2018 David Roller | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
using System; | ||
using System.ComponentModel.Design; | ||
using Microsoft.VisualStudio.Shell; | ||
|
||
namespace ConEmuIntegration.SolutionExplorer | ||
{ | ||
internal sealed class OpenConEmuHereItemNode | ||
{ | ||
public const int CommandId = 256; | ||
|
||
public static readonly Guid CommandSet = new Guid("A2F5D7B7-4705-403C-AC31-C863AFCAA3BB"); | ||
|
||
private readonly Package package; | ||
|
||
private OpenInConEmu m_OpenInConEmu; | ||
|
||
private OpenConEmuHereItemNode(Package package) | ||
{ | ||
this.package = package ?? throw new ArgumentNullException("package"); | ||
m_OpenInConEmu = new OpenInConEmu(); | ||
|
||
OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; | ||
if (commandService != null) | ||
{ | ||
var menuCommandID = new CommandID(CommandSet, CommandId); | ||
var menuItem = new MenuCommand(this.MenuItemCallback, menuCommandID); | ||
commandService.AddCommand(menuItem); | ||
} | ||
} | ||
|
||
public static OpenConEmuHereItemNode Instance | ||
{ | ||
get; | ||
private set; | ||
} | ||
|
||
private IServiceProvider ServiceProvider | ||
{ | ||
get | ||
{ | ||
return this.package; | ||
} | ||
} | ||
|
||
public static void Initialize(Package package) | ||
{ | ||
Instance = new OpenConEmuHereItemNode(package); | ||
} | ||
|
||
private void MenuItemCallback(object sender, EventArgs e) | ||
{ | ||
ExecuteInConEmu.Instance.DisplayConEmu(); | ||
m_OpenInConEmu.Open(); | ||
} | ||
} | ||
} |
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