Ejemplo n.º 1
0
        private void OnAfterSelect(object sender, TreeViewEventArgs e)
        {
            MementoStack.EndCompoundMemento();

            var type = mNodeTreeView.SelectedDataNode.GetType();

            if (mNodeTreeView.SelectedDataNode is ReferenceNode referenceNode)
            {
                mPropertyGrid.SelectedObject = referenceNode.Node;
            }

#if !DEBUG
            else if (type.IsGenericType && typeof(ListNode <>).IsAssignableFrom(type.GetGenericTypeDefinition()))
            {
                mPropertyGrid.SelectedObjects = mNodeTreeView.SelectedDataNode.Nodes.ToArray();

                MementoStack.BeginCompoundMemento();
            }
#endif
            else
            {
                mPropertyGrid.SelectedObject = mNodeTreeView.SelectedDataNode;
            }

            // Set the control on the left to the node's control
            SetSplitContainerControl(mNodeTreeView.ControlOfSelectedDataNode);
        }
Ejemplo n.º 2
0
        public void Reset()
        {
            if (mNodeTreeView.TopNode != null)
            {
                SetSubscription(mNodeTreeView.TopDataNode, true);

                mNodeTreeView.TopNode.Dispose();
                mNodeTreeView.TopDataNode.Exported -= OnNodeExported;
                mNodeTreeView.TopDataNode.DisposeData();
                mNodeTreeView.TopDataNode.Dispose();
            }

            mNodeTreeView.Nodes.Clear();

            mPropertyGrid.SelectedObject = null;
            mMainSplitContainer.Panel1.Controls.Clear();
            mSaveToolStripMenuItem.Enabled   = false;
            mSaveAsToolStripMenuItem.Enabled = false;
            mCloseToolStripMenuItem.Enabled  = false;
            mCurrentlyOpenFilePath           = null;

            MementoStack.Clear();
            ModelViewControl.ResetInstance();
            TextureViewControl.ResetInstance();

            SetTitle();

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
        protected void PushMemento(IMemento memento)
        {
            if (mIgnoreMementos > 0)
            {
                return;
            }

            MementoStack.Push(memento);
        }
Ejemplo n.º 4
0
 private void OnPropertyValueChanged(object s, PropertyValueChangedEventArgs e)
 {
     MementoStack.EndCompoundMemento();
     MementoStack.BeginCompoundMemento();
 }
Ejemplo n.º 5
0
 private void OnRedo(object sender, EventArgs e)
 {
     MementoStack.Redo();
 }