void item_Click(object sender, EventArgs e) { MenuItem item = (MenuItem)sender; Type editorType = (Type)item.Tag; Label label = null; //(Label)item.Parent.Tag; DesignerPropertyEditor editor = (DesignerPropertyEditor)label.Tag; Debug.Check(_selectedObject == editor.SelectedObject); Nodes.Node node = _selectedObject as Nodes.Node; if (node != null) { node.OnPropertyValueChanged(true); } Attachments.Attachment attach = _selectedObject as Attachments.Attachment; if (attach != null) { attach.OnPropertyValueChanged(true); } SelectedObject = _selectedObject; }
/// <summary> /// Creates a new subitm which can render an attachment on the node. /// </summary> /// <param name="backgroundNormal">The background brush used when the subitem is not selected.</param> /// <param name="backgroundSelected">The background brush used when the subitem is selected. If it cannot be selected, use null.</param> /// <param name="labelFont">The font used to draw the label.</param> /// <param name="labelBrush">The brush used to draw the label.</param> protected SubItemAttachment(Attachments.Attachment attach, Brush backgroundNormal, Brush backgroundSelected, Font labelFont, Brush labelBrush) : base(backgroundNormal, backgroundSelected, labelFont, labelBrush, Alignment.Center, false) { _attachment = attach; }