Browse Source

Merge 6aad1ae617 into 336b10583e

pull/729/merge
mykolav 10 years ago
parent
commit
432f7b26c9
  1. 1
      src/Main/Base/Project/ICSharpCode.SharpDevelop.addin
  2. 11
      src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs
  3. 24
      src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs
  4. 2
      src/Main/SharpDevelop/Workbench/AvalonWorkbenchWindow.cs

1
src/Main/Base/Project/ICSharpCode.SharpDevelop.addin

@ -1278,6 +1278,7 @@ @@ -1278,6 +1278,7 @@
class = "ICSharpCode.SharpDevelop.Commands.TabStrip.CopyPathName"/>
<MenuItem id = "NavigateToFileInProjectBrowser"
label = "${res:ICSharpCode.SharpDevelop.Commands.TabStrip.NavigateToFileInProjectBrowser}"
shortcut = "Alt|Shift|L"
class = "ICSharpCode.SharpDevelop.Commands.TabStrip.NavigateToFileInProjectBrowser"/>
<MenuItem id = "OpenFolderContainingFileFromTab"
label = "${res:OpenFileTabEventHandler.FileContainingFolderInExplorer}"

11
src/Main/Base/Project/Src/Commands/FileTabStripCommands.cs

@ -105,9 +105,16 @@ namespace ICSharpCode.SharpDevelop.Commands.TabStrip @@ -105,9 +105,16 @@ namespace ICSharpCode.SharpDevelop.Commands.TabStrip
string GetActiveFileName()
{
if ((this.Owner is IWorkbenchWindow) && (((IWorkbenchWindow)this.Owner).ActiveViewContent != null)) {
return (Owner as IWorkbenchWindow).ActiveViewContent.PrimaryFileName;
var workbenchWindow = Owner as IWorkbenchWindow;
if (workbenchWindow == null)
workbenchWindow = SD.Workbench.ActiveWorkbenchWindow;
if (workbenchWindow != null &&
workbenchWindow.ActiveViewContent != null)
{
return workbenchWindow.ActiveViewContent.PrimaryFileName;
}
return null;
}

24
src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs

@ -114,12 +114,32 @@ namespace ICSharpCode.Core.Presentation @@ -114,12 +114,32 @@ namespace ICSharpCode.Core.Presentation
public static ContextMenu CreateContextMenu(object owner, string addInTreePath)
{
IList items = CreateUnexpandedMenuItems(
return CreateContextMenu(
new MenuCreateContext { ActivationMethod = "ContextMenu" },
owner,
addInTreePath);
}
public static ContextMenu CreateContextMenu(UIElement inputBindingOwner, object owner, string addInTreePath)
{
return CreateContextMenu(
new MenuCreateContext
{
InputBindingOwner = inputBindingOwner,
ActivationMethod = "ContextMenu"
},
owner,
addInTreePath);
}
private static ContextMenu CreateContextMenu(MenuCreateContext context, object owner, string addInTreePath)
{
IList items = CreateUnexpandedMenuItems(
context,
AddInTree.BuildItems<MenuItemDescriptor>(addInTreePath, owner, false));
return CreateContextMenu(items);
}
public static ContextMenu ShowContextMenu(UIElement parent, object owner, string addInTreePath)
{
ContextMenu menu = new ContextMenu();

2
src/Main/SharpDevelop/Workbench/AvalonWorkbenchWindow.cs

@ -293,7 +293,7 @@ namespace ICSharpCode.SharpDevelop.Workbench @@ -293,7 +293,7 @@ namespace ICSharpCode.SharpDevelop.Workbench
base.OnApplyTemplate();
if (this.DragEnabledArea != null) {
this.DragEnabledArea.ContextMenu = MenuService.CreateContextMenu(this, contextMenuPath);
this.DragEnabledArea.ContextMenu = MenuService.CreateContextMenu(this, this, contextMenuPath);
UpdateInfoTip(); // set tooltip
}
}

Loading…
Cancel
Save