private void editor_ValueWasChanged(object sender, DesignerPropertyInfo property)
        {
            if (!_initialized)
            {
                return;
            }

            if (_node != null)
            {
                _node.OnPropertyValueChanged(true);

                UndoManager.Save(_node.Behavior);
            }

            //comment it as it disposed control and System.ObjectDisposedException might be raised
            //buildPropertyGrid();

            if (property.Attribute is DesignerNodeProperty ||
                uiPolicy != null && uiPolicy.ShouldUpdatePropertyGrids(property))
            {
                buildPropertyGrid();
            }

            _isModified = true;
        }
        protected void OnValueChanged(DesignerPropertyInfo property)
        {
            if (!_valueWasAssigned)
            {
                return;
            }

            Nodes.Node node = _object as Nodes.Node;

            if (node != null)
            {
                node.OnPropertyValueChanged(true);
                node.OnPropertyValueChanged(property);
            }
            else
            {
                Attachments.Attachment attach = _object as Attachments.Attachment;

                if (attach != null)
                {
                    attach.OnPropertyValueChanged(true);
                }
            }

            if (ValueWasChanged != null)
            {
                ValueWasChanged(this, property);
            }
        }
        private void editor_ValueWasChanged(object sender, DesignerPropertyInfo property)
        {
            if (_node != null)
            {
                _node.OnPropertyValueChanged(true);

                UndoManager.Save(_node.Behavior);
            }

            //comment it as it disposed control and System.ObjectDisposedException might be raised
            //buildPropertyGrid();
        }
Esempio n. 4
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);

            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;
        }
        protected void OnValueChanged()
        {
            if (!_valueWasAssigned)
            {
                return;
            }

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

                if (ValueWasChanged != null)
                {
                    ValueWasChanged();
                }

                return;
            }

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

                if (ValueWasChanged != null)
                {
                    ValueWasChanged();
                }

                return;
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Is called when one of the event's proterties were modified.
        /// </summary>
        /// <param name="wasModified">Holds if the event was modified.</param>
        public void OnPropertyValueChanged(bool wasModified)
        {
            if (_node != null)
            {
                _node.OnPropertyValueChanged(wasModified);
            }

            setLabel(GenerateNewLabel(), wasModified);
        }
Esempio n. 7
0
        private void addButton_Click(object sender, EventArgs e)
        {
            ParInfo par = new ParInfo(_rootNode);

            using (ParSettingsDialog parSettingsDialog = new ParSettingsDialog())
            {
                parSettingsDialog.SetPar(par, _rootNode, true);

                if (DialogResult.OK == parSettingsDialog.ShowDialog())
                {
                    par.ParameterSet -= parameter_ParameterSet;
                    par.ParameterSet += parameter_ParameterSet;

                    par.Copy(parSettingsDialog.GetPar());
                    _rootNode.Pars.Add(par);

                    _isParReady = false;
                    {
                        this.Hide();
                        addRowControl(par);
                        this.Show();
                    }
                    _isParReady = true;

                    PropertiesDock.UpdatePropertyGrids();
                    _rootNode.OnPropertyValueChanged(true);

                    UndoManager.Save((Nodes.Behavior)_rootNode);
                }
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Is called when one of the event's proterties were modified.
        /// </summary>
        /// <param name="wasModified">Holds if the event was modified.</param>
        public virtual void OnPropertyValueChanged(bool wasModified)
        {
            _node.OnPropertyValueChanged(wasModified);

            Label = GenerateNewLabel();
        }