コード例 #1
0
 void DisposePropertyPadProvider()
 {
     if (lastPadProvider != null)
     {
         if (propertyPad != null && propertyPad.PropertyGrid != null)
         {
             propertyPad.PropertyGrid.Changed -= OnPropertyGridChanged;
         }
         lastPadProvider.OnEndEditing(lastComponent);
         lastPadProvider = null;
         lastComponent   = null;
     }
 }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 public void SetPadContent(IPropertyPadProvider provider)
 {
     SetPadContent(provider, null);
 }
コード例 #5
0
		void DisposePropertyPadProvider ()
		{
			if (lastPadProvider != null) {
				if (propertyPad != null && propertyPad.PropertyGrid != null)
					propertyPad.PropertyGrid.Changed -= OnPropertyGridChanged;
				lastPadProvider.OnEndEditing (lastComponent);
				lastPadProvider = null;
				lastComponent = null;
			}
		}
コード例 #6
0
		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 ();
			}
		}
コード例 #7
0
		public void SetPadContent (IPropertyPadProvider provider)
		{
			SetPadContent (provider, null);
		}