/// <summary> /// Edits the provided value in a modal dialog. /// </summary> public override object EditValue( ITypeDescriptorContext context, IServiceProvider provider, object value ) { if( value == null || !(value is DropShadowOptions) ) return value; else { // Edit a clone. DropShadowOptionsEditorUi ui = new DropShadowOptionsEditorUi( (DropShadowOptions)((ICloneable)value).Clone() ); if( ui.ShowDialog() == System.Windows.Forms.DialogResult.OK ) return ui.Options; else return value; } }
/// <summary> /// Allows the user to edit the drop shadow settings. /// </summary> private void ChangeDropShadowSettings( object sender, System.EventArgs e ) { DropShadowOptionsEditorUi d = new DropShadowOptionsEditorUi( (DropShadowOptions)m_edit.DropShadow.Clone() ); if( d.ShowDialog( this ) == DialogResult.OK ) { m_edit.DropShadow = d.Options; m_pbPreview.Refresh(); } }