public override object EditValue( 
			ITypeDescriptorContext context, 
			IServiceProvider provider,
			object value )
		{
			if ( provider != null )
			{
				var edSvc = 
					(IWindowsFormsEditorService)provider.GetService(
					typeof( IWindowsFormsEditorService ) );

				if ( edSvc == null )
				{
					return value;
				}
				if ( _colorUI == null )
				{
					_colorUI = new ColorUI( this );
				}
				_colorUI.Start( edSvc, value );
				edSvc.DropDownControl( _colorUI );

				// --

				if ( (_colorUI.Value != null) && (((Color)_colorUI.Value) != Color.Empty) )
				{
					value = _colorUI.Value;
				}

				_colorUI.End();
			}
			return value;
		}
Beispiel #2
0
        public override object EditValue(
            ITypeDescriptorContext context,
            IServiceProvider provider,
            object value)
        {
            if (provider != null)
            {
                var edSvc =
                    (IWindowsFormsEditorService)provider.GetService(
                        typeof(IWindowsFormsEditorService));

                if (edSvc == null)
                {
                    return(value);
                }
                if (_colorUI == null)
                {
                    _colorUI = new ColorUI(this);
                }
                _colorUI.Start(edSvc, value);
                edSvc.DropDownControl(_colorUI);

                // --

                if ((_colorUI.Value != null) && (((Color)_colorUI.Value) != Color.Empty))
                {
                    value = _colorUI.Value;
                }

                _colorUI.End();
            }
            return(value);
        }