Пример #1
0
        private static int GetTreeNodeIndex(Soway.Data.DS.Tree.TreeNode <MatrixHeader> node,
                                            Soway.Data.DS.Tree.Tree <MatrixHeader> tree)
        {
            List <TreeNode <MatrixHeader> > items = null;

            if (node.Parent == null)
            {
                items = tree.Nodes;
            }
            else
            {
                items = node.Parent.Children;
            }
            int nodeIndex = items.IndexOf(node);

            int i     = 0;
            int index = 0;

            while (i < nodeIndex)
            {
                index += items[i].Width;

                i++;
            }

            if (node.Parent != null)
            {
                return(index + GetTreeNodeIndex(node.Parent, tree));
            }
            else
            {
                return(index);
            }
        }
Пример #2
0
        private static object[] GetObjsToParent(Soway.Data.DS.Tree.TreeNode <MatrixHeader> node)
        {
            List <object> result = new List <object>();

            while (node != null)
            {
                result.Insert(0, node.Data.Value);
                node = node.Parent;
            }
            return(result.ToArray());
        }