ComponentFactory.Krypton.Toolkit.PaletteDrawBordersEditor.EditValue C# (CSharp) Method

EditValue() public method

Edits the specified object's value using the editor style indicated by the GetEditStyle method.
public EditValue ( ITypeDescriptorContext context, IServiceProvider provider, object value ) : object
context ITypeDescriptorContext An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider An IServiceProvider that this editor can use to obtain services.
value object The object to edit.
return object
        public override object EditValue(ITypeDescriptorContext context, 
                                         IServiceProvider provider, 
                                         object value)
        {
            if ((context != null) && (provider != null) && (value != null))
            {
                // Grab the service needed to show the drop down
                IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

                if (service != null)
                {
                    // Create the custom control used to edit value
                    PaletteDrawBordersSelector selector = new PaletteDrawBordersSelector();

                    // Populate selector with starting value
                    selector.Value = (PaletteDrawBorders)value;

                    // Show as a drop down control
                    service.DropDownControl(selector);

                    // Return the updated value
                    return selector.Value;
                }
            }

            return base.EditValue(context, provider, value);
        }
PaletteDrawBordersEditor