public override void Initialize(IComponent component) { base.Initialize(component); // FIXME: Remove this code because it will end up in FormDocumentDesigner if (component is Form) { ((Form)component).TopLevel = false; // XXX: File a MWF bug: setting toplevel to false also sets visible to false ((Form)component).Visible = true; } _designerViewFrame = new DesignerViewFrame(this.Control, new ComponentTray(this, component.Site)); _designerViewFrame.DesignedControl.Location = new Point(15, 15); SetValue(this.Component, "Location", new Point(0, 0)); IComponentChangeService componentChangeSvc = GetService(typeof(IComponentChangeService)) as IComponentChangeService; if (componentChangeSvc != null) { componentChangeSvc.ComponentAdded += new ComponentEventHandler(OnComponentAdded); componentChangeSvc.ComponentRemoved += new ComponentEventHandler(OnComponentRemoved); } ISelectionService selectionSvc = GetService(typeof(ISelectionService)) as ISelectionService; if (selectionSvc != null) // set itself to primary selection { selectionSvc.SetSelectedComponents(new IComponent[] { this.Component }); } }
public override void Initialize(IComponent component) { base.Initialize(component); _designerViewFrame = new DesignerViewFrame(this.Control, new ComponentTray(this, component.Site)); _designerViewFrame.DesignedControl.Location = new Point(15, 15); SetValue(this.Component, "Location", new Point(0, 0)); IComponentChangeService componentChangeSvc = GetService(typeof(IComponentChangeService)) as IComponentChangeService; if (componentChangeSvc != null) { componentChangeSvc.ComponentAdded += new ComponentEventHandler(OnComponentAdded); componentChangeSvc.ComponentRemoved += new ComponentEventHandler(OnComponentRemoved); } IMenuCommandService menuCommands = GetService(typeof(IMenuCommandService)) as IMenuCommandService; IServiceContainer serviceContainer = this.GetService(typeof(IServiceContainer)) as IServiceContainer; if (menuCommands != null && serviceContainer != null) { new DefaultMenuCommands(serviceContainer).AddTo(menuCommands); } InitializeSelectionService(); }
protected override void Dispose(bool disposing) { if (disposing) { if (_designerViewFrame != null) { _designerViewFrame.Dispose(); _designerViewFrame = null; } IComponentChangeService componentChangeSvc = GetService(typeof(IComponentChangeService)) as IComponentChangeService; if (componentChangeSvc != null) { componentChangeSvc.ComponentAdded -= new ComponentEventHandler(OnComponentAdded); componentChangeSvc.ComponentRemoved -= new ComponentEventHandler(OnComponentRemoved); } } base.Dispose(disposing); }
protected override void Dispose (bool disposing) { if (disposing) { if (_designerViewFrame != null) { _designerViewFrame.Dispose (); _designerViewFrame = null; } IComponentChangeService componentChangeSvc = GetService (typeof (IComponentChangeService)) as IComponentChangeService; if (componentChangeSvc != null) { componentChangeSvc.ComponentAdded -= new ComponentEventHandler (OnComponentAdded); componentChangeSvc.ComponentRemoved -= new ComponentEventHandler (OnComponentRemoved); } } base.Dispose (disposing); }
public override void Initialize (IComponent component) { base.Initialize (component); _designerViewFrame = new DesignerViewFrame (this.Control, new ComponentTray (this, component.Site)); _designerViewFrame.DesignedControl.Location = new Point (15, 15); SetValue (this.Component, "Location", new Point (0, 0)); IComponentChangeService componentChangeSvc = GetService (typeof (IComponentChangeService)) as IComponentChangeService; if (componentChangeSvc != null) { componentChangeSvc.ComponentAdded += new ComponentEventHandler (OnComponentAdded); componentChangeSvc.ComponentRemoved += new ComponentEventHandler (OnComponentRemoved); } IMenuCommandService menuCommands = GetService (typeof (IMenuCommandService)) as IMenuCommandService; IServiceContainer serviceContainer = this.GetService (typeof (IServiceContainer)) as IServiceContainer; if (menuCommands != null && serviceContainer != null) new DefaultMenuCommands (serviceContainer).AddTo (menuCommands); InitializeSelectionService (); }
public override void Initialize (IComponent component) { base.Initialize (component); // FIXME: Remove this code because it will end up in FormDocumentDesigner if (component is Form) { ((Form)component).TopLevel = false; // XXX: File a MWF bug: setting toplevel to false also sets visible to false ((Form)component).Visible = true; } _designerViewFrame = new DesignerViewFrame (this.Control, new ComponentTray (this, component.Site)); _designerViewFrame.DesignedControl.Location = new Point (15, 15); SetValue (this.Component, "Location", new Point (0, 0)); IComponentChangeService componentChangeSvc = GetService (typeof (IComponentChangeService)) as IComponentChangeService; if (componentChangeSvc != null) { componentChangeSvc.ComponentAdded += new ComponentEventHandler (OnComponentAdded); componentChangeSvc.ComponentRemoved += new ComponentEventHandler (OnComponentRemoved); } ISelectionService selectionSvc = GetService (typeof (ISelectionService)) as ISelectionService; if (selectionSvc != null) { // set itself to primary selection selectionSvc.SetSelectedComponents (new IComponent[] { this.Component }); } }