private void buttonLinkElements_Click(object sender, EventArgs e) { List <PreviewBaseShape> shapes = Shape.Strings; PreviewSetElements elementsDialog = new PreviewSetElements(shapes); elementsDialog.ShowDialog(); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService svc = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (svc != null) { List <PreviewBaseShape> shapes = value as List <PreviewBaseShape>; if (shapes.Count < 1) { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("Elements must have at least one shape. Remove the selected element.", "Error", false, false); messageBox.ShowDialog(); if (value != null) { return(value); } } PreviewSetElements elementsDialog = new PreviewSetElements(shapes); svc.ShowDialog(elementsDialog); // update etc if (shapes[0].Parent != null) { shapes[0].Parent.Layout(); } } return(value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService svc = (IWindowsFormsEditorService) provider.GetService(typeof (IWindowsFormsEditorService)); if (svc != null) { List<PreviewBaseShape> shapes = value as List<PreviewBaseShape>; PreviewSetElements elementsDialog = new PreviewSetElements(shapes); svc.ShowDialog(elementsDialog); // update etc } return value; }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService svc = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (svc != null) { List <PreviewBaseShape> shapes = value as List <PreviewBaseShape>; PreviewSetElements elementsDialog = new PreviewSetElements(shapes); svc.ShowDialog(elementsDialog); // update etc } return(value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService svc = (IWindowsFormsEditorService) provider.GetService(typeof (IWindowsFormsEditorService)); if (svc != null) { List<PreviewBaseShape> shapes = value as List<PreviewBaseShape>; if (shapes.Count < 1) { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("Elements must have at least one shape. Remove the selected element.", "Error", false, false); messageBox.ShowDialog(); if (value != null) return value; } PreviewSetElements elementsDialog = new PreviewSetElements(shapes); svc.ShowDialog(elementsDialog); // update etc if (shapes[0].Parent != null) { shapes[0].Parent.Layout(); } } return value; }
private void buttonLinkElements_Click(object sender, EventArgs e) { List<PreviewBaseShape> shapes = Shape.Strings; PreviewSetElements elementsDialog = new PreviewSetElements(shapes); elementsDialog.ShowDialog(); }