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 @@
label = "${res:XML.MainMenu.EditMenu.Delete}" label = "${res:XML.MainMenu.EditMenu.Delete}"
icon = "Icons.16x16.DeleteIcon" icon = "Icons.16x16.DeleteIcon"
type = "Item" type = "Item"
shortcut = "Delete"
loadclasslazy = "false" loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Delete"/> class = "ICSharpCode.SharpDevelop.Commands.Delete"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable"> <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
void WorkbenchActiveViewContentChanged(object sender, EventArgs e) void WorkbenchActiveViewContentChanged(object sender, EventArgs e)
{ {
WpfViewContent wpfView = WorkbenchSingleton.Workbench.ActiveViewContent as WpfViewContent; WpfViewContent wpfView = WorkbenchSingleton.Workbench.ActiveViewContent as WpfViewContent;
host.ViewContent = wpfView;
if (wpfView != null) { if (wpfView != null) {
host.Child = wpfView.Outline; host.Child = wpfView.Outline;
} else { } else {

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

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

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

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

Loading…
Cancel
Save