Accord.Controls.NumericCollectionEditor.EditValue C# (CSharp) Method

EditValue() public method

Edits the specified object's value using the editor style indicated by the M:System.Drawing.Design.UITypeEditor.GetEditStyle method.
public EditValue ( ITypeDescriptorContext context, IServiceProvider provider, object value ) : object
context ITypeDescriptorContext An that can be used to gain additional context information.
provider IServiceProvider An 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 && context.Instance != null && provider != null)
            {
                this.editorService = (IWindowsFormsEditorService)provider
                    .GetService(typeof(IWindowsFormsEditorService));

                this.CollectionType = context.PropertyDescriptor.ComponentType;
                this.CollectionItemType = detectCollectionType();

                if (editorService != null)
                {
                    NumericCollectionEditorForm form = new NumericCollectionEditorForm(this, value);

                    context.OnComponentChanging();

                    if (editorService.ShowDialog(form) == DialogResult.OK)
                    {
                        context.OnComponentChanged();
                    }
                }
            }

            return value;
        }