private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { if ((e.NewDesigner == this.serviceProvider.GetService(typeof(IDesignerHost))) && this.typeSystemTypesChanged) { this.RefreshTypes(); } else { this.RefreshTasks(); } }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { if (this._activeDesignSurfaceChanged != null) { DesignSurface newSurface = null; DesignSurface oldSurface = null; if (e.OldDesigner != null) { oldSurface = e.OldDesigner.GetService(typeof(DesignSurface)) as DesignSurface; } if (e.NewDesigner != null) { newSurface = e.NewDesigner.GetService(typeof(DesignSurface)) as DesignSurface; } this._activeDesignSurfaceChanged(this, new ActiveDesignSurfaceChangedEventArgs(oldSurface, newSurface)); } }
/// <summary> /// Handles the IDesignerEventService event and relays it to /// DesignSurfaceManager's similar event. /// </summary> private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { Debug.Assert(_activeDesignSurfaceChanged != null, "Should have detached this event handler."); if (_activeDesignSurfaceChanged != null) { DesignSurface newSurface = null; DesignSurface oldSurface = null; if (e.OldDesigner != null) { oldSurface = e.OldDesigner.GetService(typeof(DesignSurface)) as DesignSurface; } if (e.NewDesigner != null) { newSurface = e.NewDesigner.GetService(typeof(DesignSurface)) as DesignSurface; } _activeDesignSurfaceChanged(this, new ActiveDesignSurfaceChangedEventArgs(oldSurface, newSurface)); } }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// activedesignereventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this ActiveDesignerEventHandler activedesignereventhandler, Object sender, ActiveDesignerEventArgs e, AsyncCallback callback) { if(activedesignereventhandler == null) throw new ArgumentNullException("activedesignereventhandler"); return activedesignereventhandler.BeginInvoke(sender, e, callback, null); }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs adevent){ currentHost = adevent.NewDesigner; }
// when the active document is changed, check all the components so see if they // are offering up any new tabs private void OnActiveDesignerChanged(Object sender, ActiveDesignerEventArgs e) { if (e.OldDesigner != null && e.OldDesigner == designerHost) { this.ActiveDesigner = null; } if (e.NewDesigner != null && e.NewDesigner != designerHost) { this.ActiveDesigner = e.NewDesigner; } }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { object eventDeactivated = null; if (e.OldDesigner == this) { eventDeactivated = EventDeactivated; } else if (e.NewDesigner == this) { eventDeactivated = EventActivated; } if (eventDeactivated != null) { if ((e.OldDesigner == this) && (this._surface != null)) { this._surface.Flush(); } EventHandler handler = this._events[eventDeactivated] as EventHandler; if (handler != null) { handler(this, EventArgs.Empty); } } }
/// <summary> /// Support for popup menu closing. /// </summary> /// <param name="e"></param> protected virtual void ActiveDesignerChanged(ActiveDesignerEventArgs e) { ClosePopups(); }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { ComponentEventHandler handler = new ComponentEventHandler(this.OnComponentCollectionChanged); if (this._activeDesigner != null) { IComponentChangeService service = (IComponentChangeService) this._activeDesigner.GetService(typeof(IComponentChangeService)); if (service != null) { service.ComponentAdded -= handler; service.ComponentRemoved -= handler; } } this._activeDesigner = e.NewDesigner; if (this._activeDesigner != null) { IComponentChangeService service2 = (IComponentChangeService) this._activeDesigner.GetService(typeof(IComponentChangeService)); if (service2 != null) { service2.ComponentAdded += handler; service2.ComponentRemoved += handler; } IPropertyBrowserClient client = e.NewDesigner.GetService(typeof(DocumentWindow)) as IPropertyBrowserClient; if (client != null) { base.Enabled = client.SupportsPropertyBrowser; if (!client.SupportsPropertyBrowser) { this._propGrid.SelectedObject = null; } } } this.UpdateSelection(); }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { this.ActiveDesignerChanged(e); }
/// <summary> /// Support for popup menu closing. /// </summary> /// <param name="e"></param> protected virtual void ActiveDesignerChanged(ActiveDesignerEventArgs e) { if((this.GetItemContainerControl() as IOwner)!=null) { ((IOwner)this.GetItemContainerControl()).OnApplicationDeactivate(); // Closes all popups } }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { bool flag = false; IToolboxClient client = this._activeClient; this._activeDesigner = e.NewDesigner; this._activeClient = null; if (this._activeDesigner != null) { this._activeClient = (IToolboxClient) e.NewDesigner.GetService(typeof(DocumentWindow)); } if (client != this._activeClient) { if (((client != null) && (this._activeClient == null)) || ((client == null) && (this._activeClient != null))) { flag = true; } else if (client.GetType() != this._activeClient.GetType()) { flag = true; } } if (!flag && (this._activeClient is IMultiViewDocumentWindow)) { flag = true; } if (flag) { this.UpdateToolboxClient(); } }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { if (this._activeDesignSurfaceChanged != null) { DesignSurface newSurface = null; DesignSurface oldSurface = null; if (e.OldDesigner != null) { oldSurface = e.OldDesigner.GetService(typeof(DesignSurface)) as DesignSurface; } if (e.NewDesigner != null) { newSurface = e.NewDesigner.GetService(typeof(DesignSurface)) as DesignSurface; } this._activeDesignSurfaceChanged(this, new ActiveDesignSurfaceChangedEventArgs(oldSurface, newSurface)); } }
private void OnActiveDesignerChanged(object sender, ActiveDesignerEventArgs e) { if ((e.OldDesigner != null) && (e.OldDesigner == this.designerHost)) { this.ActiveDesigner = null; } if ((e.NewDesigner != null) && (e.NewDesigner != this.designerHost)) { this.ActiveDesigner = e.NewDesigner; } }
private void OnActiveDesignerChanged(ActiveDesignerEventArgs e) { if (this._activeDesignerChangedHandler != null) { this._activeDesignerChangedHandler(this, e); } }