Skip to content

Commit

Permalink
Fix some issues from the testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Therena committed May 2, 2018
1 parent be7143e commit 875f52a
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 11 deletions.
3 changes: 2 additions & 1 deletion ConEmuIntegration/ConEmuIntegration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="SolutionExplorer\ExecuteInConEmu.cs" />
<Compile Include="SolutionExplorer\OpenConEmuHere.cs" />
<Compile Include="SolutionExplorer\OpenConEmuHereItemNode.cs" />
<Compile Include="SolutionExplorer\OpenConEmuHereProjectItem.cs" />
<Compile Include="SolutionExplorer\OpenConEmuHereSolution.cs" />
<Compile Include="SolutionExplorer\OpenInConEmu.cs" />
<Compile Include="SolutionExplorer\OpenInConEmuHereFolderView.cs" />
Expand Down
3 changes: 2 additions & 1 deletion ConEmuIntegration/ConEmuWindowPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ protected override void Initialize()
{
ConEmuWindowCommand.Initialize(this);
base.Initialize();
SolutionExplorer.OpenConEmuHere.Initialize(this);
SolutionExplorer.OpenConEmuHereProjectItem.Initialize(this);
SolutionExplorer.OpenConEmuHereSolution.Initialize(this);
SolutionExplorer.ExecuteInConEmu.Initialize(this);
SolutionExplorer.OpenOutpathInConEmu.Initialize(this);
SolutionExplorer.OpenInConEmuHereFolderView.Initialize(this);
SolutionExplorer.OpenConEmuHereItemNode.Initialize(this);
}
#endregion
}
Expand Down
15 changes: 13 additions & 2 deletions ConEmuIntegration/ConEmuWindowPackage.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
<ButtonText>Open folder in ConEmu</ButtonText>
</Strings>
</Button>
<Button guid="guidConEmuWindowPackageCmdSetItemNode" id="cmdidOpenConEmuHere" priority="0x0101" type="Button">
<Parent guid="guidConEmuWindowPackageCmdSetItemNode" id="ConEmuGroupSubMenuItemNode" />
<Icon guid="guidImages" id="bmpConsole" />
<Strings>
<ButtonText>Open folder in ConEmu</ButtonText>
</Strings>
</Button>
<Button guid="guidConEmuWindowPackageCmdSetSolution" id="cmdidOpenConEmuHereSolution" priority="0x0101" type="Button">
<Parent guid="guidConEmuWindowPackageCmdSetSolution" id="ConEmuGroupSubMenuSolution" />
<Icon guid="guidImages" id="bmpConsole" />
Expand Down Expand Up @@ -73,7 +80,7 @@
<Group guid="guidConEmuWindowPackageCmdSetSolution" id="ConEmuGroupSubMenuSolution" priority="0x0300">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_SOLNNODE" />
</Group>
<Group guid="guidConEmuWindowPackageCmdSetItem" id="ConEmuGroupSubMenuItem" priority="0x0300">
<Group guid="guidConEmuWindowPackageCmdSetItemNode" id="ConEmuGroupSubMenuItemNode" priority="0x0300">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/>
</Group>
</Groups>
Expand Down Expand Up @@ -104,10 +111,14 @@
</GuidSymbol>

<GuidSymbol value="{c75f2974-4759-448c-bf2a-c400d83fe990}" name="guidConEmuWindowPackageCmdSetItem">
<IDSymbol value="1061" name="ConEmuGroupSubMenuItem" />
<IDSymbol value="1061" name="ConEmuGroupSubMenuProject" />
<IDSymbol value="256" name="cmdidOpenConEmuHere" />
</GuidSymbol>

<GuidSymbol value="{A2F5D7B7-4705-403C-AC31-C863AFCAA3BB}" name="guidConEmuWindowPackageCmdSetItemNode">
<IDSymbol value="1061" name="ConEmuGroupSubMenuItemNode" />
<IDSymbol value="256" name="cmdidOpenConEmuHere" />
</GuidSymbol>

<GuidSymbol value="{074e29bb-eb5c-4400-9ef0-f8abfbbe337b}" name="guidConEmuWindowPackageCmdSetExecute">
<IDSymbol value="1061" name="ConEmuGroupSubMenuProject" />
Expand Down
71 changes: 71 additions & 0 deletions ConEmuIntegration/SolutionExplorer/OpenConEmuHereItemNode.cs
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();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace ConEmuIntegration.SolutionExplorer
{
internal sealed class OpenConEmuHere
internal sealed class OpenConEmuHereProjectItem
{
public const int CommandId = 256;

Expand All @@ -29,7 +29,7 @@ internal sealed class OpenConEmuHere

private OpenInConEmu m_OpenInConEmu;

private OpenConEmuHere(Package package)
private OpenConEmuHereProjectItem(Package package)
{
this.package = package ?? throw new ArgumentNullException("package");
m_OpenInConEmu = new OpenInConEmu();
Expand All @@ -43,7 +43,7 @@ private OpenConEmuHere(Package package)
}
}

public static OpenConEmuHere Instance
public static OpenConEmuHereProjectItem Instance
{
get;
private set;
Expand All @@ -59,7 +59,7 @@ private IServiceProvider ServiceProvider

public static void Initialize(Package package)
{
Instance = new OpenConEmuHere(package);
Instance = new OpenConEmuHereProjectItem(package);
}

private void MenuItemCallback(object sender, EventArgs e)
Expand Down
6 changes: 3 additions & 3 deletions ConEmuIntegration/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<Tags>console, ConEmu, command-line, PowerShell, node, command prompt, cmd, Solution Explorer, Git, ConEmu, irb </Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0.26730.0,16.0)" />
<InstallationTarget Version="[15.0.26730.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[15.0.26730.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,16.0)" />
<InstallationTarget Version="[14.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[14.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.6,)" />
Expand Down

0 comments on commit 875f52a

Please sign in to comment.