Пример #1
0
        void item_Click(object sender, EventArgs e)
        {
            MenuItem item = (MenuItem)sender;

            Type  editorType = (Type)item.Tag;
            Label label      = (Label)item.Parent.Tag;
            DesignerPropertyEditor editor = (DesignerPropertyEditor)label.Tag;

            Debug.Check(_selectedObject == editor.SelectedObject);

            FlexibleProperty flexProp = (FlexibleProperty)editor.Property.Property.GetValue(_selectedObject, null);

            flexProp.ChangeEditor(editorType);

            Nodes.Node node = _selectedObject as Nodes.Node;
            if (node != null)
            {
                node.OnPropertyValueChanged(true);
            }

            Events.Event evnt = _selectedObject as Events.Event;
            if (evnt != null)
            {
                evnt.OnPropertyValueChanged(true);
            }

            SelectedObject = _selectedObject;
        }
Пример #2
0
        /// <summary>
        /// Duplicates this node. Parent and children are not copied.
        /// </summary>
        /// <returns>New node without parent and children.</returns>
        public object Clone()
        {
            Node newnode = Create(GetType());

            CloneProperties(newnode);

            newnode.OnPropertyValueChanged(false);

            return(newnode);
        }
        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;
        }