public void Ctor_Object_DesignerActionUIStateChangeType(object relatedObject, DesignerActionUIStateChangeType changeType) { var e = new DesignerActionUIStateChangeEventArgs(relatedObject, changeType); Assert.Same(relatedObject, e.RelatedObject); Assert.Equal(changeType, e.ChangeType); }
private void OnDesignerActionUIStateChange(object sender, DesignerActionUIStateChangeEventArgs e) { IComponent relatedObject = e.RelatedObject as IComponent; if (relatedObject != null) { DesignerActionGlyph designerActionGlyph = this.GetDesignerActionGlyph(relatedObject); if (designerActionGlyph != null) { if (e.ChangeType != DesignerActionUIStateChangeType.Show) { if (e.ChangeType != DesignerActionUIStateChangeType.Hide) { if (e.ChangeType == DesignerActionUIStateChangeType.Refresh) { designerActionGlyph.Invalidate(); this.RecreatePanel((IComponent)e.RelatedObject); } } else { DesignerActionBehavior behavior2 = designerActionGlyph.Behavior as DesignerActionBehavior; if (behavior2 != null) { behavior2.HideUI(); } } } else { DesignerActionBehavior behavior = designerActionGlyph.Behavior as DesignerActionBehavior; if (behavior != null) { behavior.ShowUI(designerActionGlyph); } } } } else if (e.ChangeType == DesignerActionUIStateChangeType.Hide) { this.HideDesignerActionPanel(); } }
/// <summary> /// This fires our DesignerActionsChanged event. /// </summary> private void OnDesignerActionUIStateChange(DesignerActionUIStateChangeEventArgs e) { _designerActionUIStateChangedEventHandler?.Invoke(this, e); }