Example #1
0
        public override void SerializeInRDIs(UserMarkerRDI[] urdis)
        {
            if (urdis == null)
            {
                return;
            }

            foreach (UserMarkerRDI urdi in RDITree.GetEnumerator(ERDIEnumeration.Full))
            {
                urdi.Displayed = false;
            }

            foreach (UserMarkerRDI urdi in urdis)
            {
                bool          bIsLeaf  = (urdi.DisplayName != urdi.Name);
                UserMarkerRDI treeURDI = RDITree[bIsLeaf ? urdi.BasePath : urdi.Path];

                if (treeURDI == null)
                {
                    continue;
                }

                if (!bIsLeaf)
                {
                    // internal nodes
                    CopySerializedMembers(treeURDI, urdi);
                }
                else
                {
                    // leaf nodes (actual markers)
                    foreach (UserMarkerRDI childURDI in treeURDI.Children)
                    {
                        if (childURDI.DisplayName == urdi.DisplayName)
                        {
                            CopySerializedMembers(childURDI, urdi);
                        }
                    }
                }
            }

            foreach (TreeNode node in TreeNodeHierarchy)
            {
                UserMarkerRDI urdi = (UserMarkerRDI)node.Tag;
                node.Checked = urdi.Displayed;
            }
        }
Example #2
0
        public override void SerializeInRDIs(T[] rdis)
        {
            if (rdis == null)
            {
                return;
            }

            foreach (T rdi in RDITree.GetEnumerator(ERDIEnumeration.Full))
            {
                rdi.Displayed = false;
            }

            foreach (T rdi in rdis)
            {
                T treeRDI = RDITree[rdi.Path];

                if ((treeRDI != null) && (treeRDI.CanHaveChildren != rdi.CanHaveChildren))
                {
                    TreeNode treeNode = RDITreeNodeHierarchy[treeRDI];
                    RenameNode(treeNode, treeRDI.GetNewName());
                    treeRDI = null;
                }

                if (treeRDI == null)
                {
                    AddRDIToTree(rdi);
                }
                else
                {
                    CopySerializedMembers(treeRDI, rdi);
                }
            }

            foreach (TreeNode node in TreeNodeHierarchy)
            {
                T rdi = (T)node.Tag;
                node.Checked = rdi.Displayed;
            }
        }
Example #3
0
        protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            base.OnAfterLabelEdit(e);

            if (e.CancelEdit)
            {
                return;
            }

            e.CancelEdit = true;

            if ((e.Label != null) && (e.Label.Length > 0) && !e.Label.Contains("/"))
            {
                T      rdi     = (T)e.Node.Tag;
                string newPath = rdi.BasePath + "/" + e.Label;

                if (!RDITree.ContainsPath(newPath))
                {
                    e.CancelEdit = false;
                    RenameNode(e.Node, e.Label);
                }
            }
        }
Example #4
0
        protected override void OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
        {
            base.OnNodeMouseDoubleClick(e);

            string path = "/" + e.Node.FullPath;
            float  x    = float.MinValue;

            foreach (UserMarkerRDI umrdi in RDITree.GetEnumerator(ERDIEnumeration.OnlyLeafNodes))
            {
                if (umrdi.Path == path)
                {
                    // only set x to a valid value if it's the only path that matches
                    if (x == float.MinValue)
                    {
                        x = umrdi.m_uml.m_fr.GetDisplayXValue(umrdi.m_logView.m_logData, LogControl.m_OGLGraphingControl.m_againstFrameTime);
                    }
                    else
                    {
                        x = float.MaxValue;
                    }

                    umrdi.Highlight();
                }
                else
                {
                    umrdi.Unhighlight();
                }
            }

            if (x != float.MinValue && x != float.MaxValue)
            {
                LogControl.m_OGLGraphingControl.ZoomViewToXValue(x);
            }

            LogControl.m_OGLGraphingControl.Invalidate();
        }