/// <summary> /// </summary> /// <param name="designer"></param> /// <param name="objectToChange"></param> /// <param name="propName"></param> /// <returns></returns> public static object EditValue(ComponentDesigner designer, object objectToChange, string propName) { PropertyDescriptor descriptor = TypeDescriptor.GetProperties(objectToChange)[propName]; NuGenCollectionEditorServiceContext context = new NuGenCollectionEditorServiceContext(designer, descriptor); UITypeEditor editor = descriptor.GetEditor(typeof(UITypeEditor)) as UITypeEditor; object oldValue = descriptor.GetValue(objectToChange); object newValue = editor.EditValue(context, context, oldValue); if (newValue != oldValue) { try { descriptor.SetValue(objectToChange, newValue); } catch (CheckoutException) { } } return newValue; }