/// <summary> /// Called when the value needs to be edited. /// </summary> /// <param name="context">Context of editing.</param> /// <param name="provider">Provider of editing.</param> /// <param name="value">Original value to edit.</param> /// <returns>Edited version of original value.</returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { ImageSelectorWindow imageSelectorWindow = new ImageSelectorWindow(); imageSelectorWindow.Image = value as Graphics.Image; if (imageSelectorWindow.ShowDialog() == DialogResult.OK) return imageSelectorWindow.Image; return base.EditValue(context, provider, value); }
/// <summary> /// Called when the value needs to be edited. /// </summary> /// <param name="context">Context of editing.</param> /// <param name="provider">Provider of editing.</param> /// <param name="value">Original value to edit.</param> /// <returns>Edited version of original value.</returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { ImageSelectorWindow imageSelectorWindow = new ImageSelectorWindow(); imageSelectorWindow.Image = value as Graphics.Image; if (imageSelectorWindow.ShowDialog() == DialogResult.OK) { return(imageSelectorWindow.Image); } return(base.EditValue(context, provider, value)); }