Browse Source

- Designer commands now work in OutlineViewPad

- Shortcut for Delete command

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3519 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Ivan Shumilin 17 years ago
parent
commit
a2c2607b20
  1. 1
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/OutlineViewPad.cs
  3. 18
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/SharpDevelopElementHost.cs
  4. 4
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs

1
AddIns/ICSharpCode.SharpDevelop.addin

@ -1280,6 +1280,7 @@ @@ -1280,6 +1280,7 @@
label = "${res:XML.MainMenu.EditMenu.Delete}"
icon = "Icons.16x16.DeleteIcon"
type = "Item"
shortcut = "Delete"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Delete"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/OutlineViewPad.cs

@ -31,6 +31,7 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -31,6 +31,7 @@ namespace ICSharpCode.WpfDesign.AddIn
void WorkbenchActiveViewContentChanged(object sender, EventArgs e)
{
WpfViewContent wpfView = WorkbenchSingleton.Workbench.ActiveViewContent as WpfViewContent;
host.ViewContent = wpfView;
if (wpfView != null) {
host.Child = wpfView.Outline;
} else {

18
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/SharpDevelopElementHost.cs

@ -29,15 +29,9 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -29,15 +29,9 @@ namespace ICSharpCode.WpfDesign.AddIn
Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException;
}
}
public SharpDevelopElementHost(WpfViewContent viewContent, UIElement child)
: this()
{
this.viewContent = viewContent;
this.Child = child;
}
WpfViewContent viewContent;
//needed for command routing (SharpDevelopElementHost -> DesignSurface)
internal WpfViewContent ViewContent;
static void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
@ -49,8 +43,8 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -49,8 +43,8 @@ namespace ICSharpCode.WpfDesign.AddIn
{
if (command.CanExecute(null, null))
return true;
else if (viewContent != null)
return command.CanExecute(null, viewContent.DesignSurface);
else if (ViewContent != null)
return command.CanExecute(null, ViewContent.DesignSurface);
else
return false;
}
@ -59,8 +53,8 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -59,8 +53,8 @@ namespace ICSharpCode.WpfDesign.AddIn
{
if (command.CanExecute(null, null)) {
command.Execute(null, null);
} else if (viewContent != null) {
command.Execute(null, viewContent.DesignSurface);
} else if (ViewContent != null) {
command.Execute(null, ViewContent.DesignSurface);
}
}

4
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs

@ -63,7 +63,7 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -63,7 +63,7 @@ namespace ICSharpCode.WpfDesign.AddIn
// initialize designer on first load
DragDropExceptionHandler.HandleException = ICSharpCode.Core.MessageService.ShowError;
designer = new DesignSurface();
wpfHost = new SharpDevelopElementHost(this, designer);
wpfHost = new SharpDevelopElementHost() { ViewContent = this, Child = designer };
this.UserControl = wpfHost;
InitPropertyEditor();
}
@ -147,7 +147,7 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -147,7 +147,7 @@ namespace ICSharpCode.WpfDesign.AddIn
void InitPropertyEditor()
{
propertyGridView = new PropertyGridView();
propertyEditorHost = new SharpDevelopElementHost(this, propertyGridView);
propertyEditorHost = new SharpDevelopElementHost() { ViewContent = this, Child = propertyGridView};
propertyContainer.PropertyGridReplacementControl = propertyEditorHost;
}

Loading…
Cancel
Save