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;
}