/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnShapes"/>. /// Shows a <see cref="ShapeDialog"/> to define a shape /// element that is added to all imported slides. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnShapes_Click(object sender, EventArgs e) { ShapeDialog dlg = new ShapeDialog(); if (dlg.ShowDialog() == DialogResult.OK) { VGElement shape = dlg.NewShape; this.cbbDesignedItem.Items.Add(shape); this.cbbDesignedItem.SelectedItem = shape; } }
/// <summary> /// Creates and displays a <c>FillerEditorDialog</c> dialog if <c>value</c> is a <c>Filler</c>. /// </summary> /// <param name="context">An ITypeDescriptorContext that can be used to gain additional context information.</param> /// <param name="provider">An IServiceProvider through which editing services may be obtained.</param> /// <param name="value">An instance of <c>Filler</c> being edited.</param> /// <returns>The new value of the <c>Filler</c> being edited.</returns> public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { if (value is ShapePopulate) { ShapeDialog dialog = new ShapeDialog((ShapePopulate)value); //dialog.Show(); if (dialog.ShowDialog() == DialogResult.OK) { return(dialog.ShapePopulate); } } return(value); }