コード例 #1
0
        private void buttonLinkElements_Click(object sender, EventArgs e)
        {
            List <PreviewBaseShape> shapes         = Shape.Strings;
            PreviewSetElements      elementsDialog = new PreviewSetElements(shapes);

            elementsDialog.ShowDialog();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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;
 }
コード例 #4
0
        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);
        }
コード例 #5
0
		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;
		}
コード例 #6
0
		private void buttonLinkElements_Click(object sender, EventArgs e)
		{
			List<PreviewBaseShape> shapes = Shape.Strings;
			PreviewSetElements elementsDialog = new PreviewSetElements(shapes);
			elementsDialog.ShowDialog();
		}