void DisposePropertyPadProvider() { if (lastPadProvider != null) { if (propertyPad != null && propertyPad.PropertyGrid != null) { propertyPad.PropertyGrid.Changed -= OnPropertyGridChanged; } lastPadProvider.OnEndEditing(lastComponent); lastPadProvider = null; lastComponent = null; } }
public void SetPadContent(IPropertyPadProvider provider, object commandRouteOrigin) { if (provider != null) { // If there was a custom provider, reset it now DisposeCustomPropertyPadProvider(); object comp = provider.GetActiveComponent(); if (lastPadProvider != null && comp == lastComponent) { return; } DisposePropertyPadProvider(); lastPadProvider = provider; lastComponent = comp; if (propertyPad == null) { return; } object[] provs = GetProvidersForObject(comp, provider.GetProvider()); if (provs.Length > 0) { propertyPad.SetCurrentObject(comp, provs); if (propertyPad is PropertyPad propPad) { propPad.CommandRouteOrigin = commandRouteOrigin; } } else { propertyPad.BlankPad(); } if (provider is IPropertyPadCustomizer customizer && propertyPad is PropertyPad ppad) { customizer.Customize(ppad.PadWindow, ppad.PropertyGrid); } propertyPad.PropertyGridChanged += OnPropertyGridChanged; } else { ReSetPad(); } }
public void SetPadContent(IPropertyPadProvider provider) { if (provider != null) { // If there was a custom provider, reset it now DisposeCustomPropertyPadProvider(); object comp = provider.GetActiveComponent(); if (lastPadProvider != null && comp == lastComponent) { return; } DisposePropertyPadProvider(); lastPadProvider = provider; lastComponent = comp; if (propertyPad == null) { return; } object[] provs = GetProvidersForObject(comp, provider.GetProvider()); if (provs.Length > 0) { propertyPad.PropertyGrid.SetCurrentObject(comp, provs); } else { propertyPad.BlankPad(); } propertyPad.PropertyGrid.Changed += OnPropertyGridChanged; } else { ReSetPad(); } }
public void SetPadContent(IPropertyPadProvider provider) { SetPadContent(provider, null); }
void DisposePropertyPadProvider () { if (lastPadProvider != null) { if (propertyPad != null && propertyPad.PropertyGrid != null) propertyPad.PropertyGrid.Changed -= OnPropertyGridChanged; lastPadProvider.OnEndEditing (lastComponent); lastPadProvider = null; lastComponent = null; } }
public void SetPadContent (IPropertyPadProvider provider) { if (provider != null) { // If there was a custom provider, reset it now DisposeCustomPropertyPadProvider (); object comp = provider.GetActiveComponent (); if (lastPadProvider != null && comp == lastComponent) return; DisposePropertyPadProvider (); lastPadProvider = provider; lastComponent = comp; if (propertyPad == null) return; object[] provs = GetProvidersForObject (comp, provider.GetProvider ()); if (provs.Length > 0) propertyPad.PropertyGrid.SetCurrentObject (comp, provs); else propertyPad.BlankPad (); propertyPad.PropertyGrid.Changed += OnPropertyGridChanged; } else { ReSetPad (); } }
public void SetPadContent (IPropertyPadProvider provider) { SetPadContent (provider, null); }