Browse Source

Fixed SD2-484 - Designer verbs now displayed in forms designer.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@721 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 20 years ago
parent
commit
d7a76e3da1
  1. 3
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs
  2. 8
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/MenuCommandService.cs

3
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs

@ -119,7 +119,6 @@ namespace ICSharpCode.FormDesigner @@ -119,7 +119,6 @@ namespace ICSharpCode.FormDesigner
serviceContainer.AddService(typeof(System.Windows.Forms.Design.IUIService), new UIService());
serviceContainer.AddService(typeof(System.Drawing.Design.IToolboxService), ToolboxProvider.ToolboxService);
serviceContainer.AddService(typeof(System.ComponentModel.Design.IMenuCommandService), new ICSharpCode.FormDesigner.Services.MenuCommandService(p, serviceContainer));
serviceContainer.AddService(typeof(IHelpService), new HelpService());
serviceContainer.AddService(typeof(System.Drawing.Design.IPropertyValueUIService), new PropertyValueUIService());
designerResourceService = new DesignerResourceService(this.resources);
@ -130,11 +129,11 @@ namespace ICSharpCode.FormDesigner @@ -130,11 +129,11 @@ namespace ICSharpCode.FormDesigner
serviceContainer.AddService(typeof(System.ComponentModel.Design.IDesignerEventService), new DesignerEventService());
serviceContainer.AddService(typeof(System.ComponentModel.Design.DesignerOptionService), new ICSharpCode.FormDesigner.Services.DesignerOptionService());
serviceContainer.AddService(typeof(ITypeDiscoveryService), new TypeDiscoveryService());
serviceContainer.AddService(typeof(MemberRelationshipService), new DefaultMemberRelationshipService());
designSurface = new DesignSurface(serviceContainer);
serviceContainer.AddService(typeof(System.ComponentModel.Design.IMenuCommandService), new ICSharpCode.FormDesigner.Services.MenuCommandService(p, designSurface, serviceContainer));
ICSharpCode.FormDesigner.Services.EventBindingService eventBindingService = new ICSharpCode.FormDesigner.Services.EventBindingService(designSurface);
serviceContainer.AddService(typeof(System.ComponentModel.Design.IEventBindingService), eventBindingService);

8
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/MenuCommandService.cs

@ -29,6 +29,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -29,6 +29,7 @@ namespace ICSharpCode.FormDesigner.Services
ArrayList verbs = new ArrayList();
Control panel;
DesignSurface designSurface;
public DesignerVerbCollection Verbs {
get {
@ -38,10 +39,11 @@ namespace ICSharpCode.FormDesigner.Services @@ -38,10 +39,11 @@ namespace ICSharpCode.FormDesigner.Services
}
}
public MenuCommandService(Control panel, IServiceContainer serviceContainer)
public MenuCommandService(Control panel, DesignSurface designSurface, IServiceContainer serviceContainer)
{
this.panel = panel;
this.serviceContainer = serviceContainer;
this.designSurface = designSurface;
this.serviceContainer = serviceContainer;
}
public void AddCommand(System.ComponentModel.Design.MenuCommand command)
@ -130,7 +132,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -130,7 +132,7 @@ namespace ICSharpCode.FormDesigner.Services
{
DesignerVerbCollection designerVerbCollection = new DesignerVerbCollection();
ISelectionService selectionService = (ISelectionService)serviceContainer.GetService(typeof(ISelectionService));
ISelectionService selectionService = (ISelectionService)designSurface.GetService(typeof(ISelectionService));
IDesignerHost host = (IDesignerHost)serviceContainer.GetService(typeof(IDesignerHost));
if (host != null && selectionService != null && selectionService.SelectionCount == 1) {
IComponent selectedComponent = selectionService.PrimarySelection as Component;

Loading…
Cancel
Save