Example #1
0
        public ExplorerNode MakeNodeTo(ExplorerNode RootFrom, ExplorerNode RootTo)
        {
            List <ExplorerNode> FullPathRootFrom = RootFrom.GetFullPath();
            List <ExplorerNode> NodeFullPath     = this.GetFullPath();
            CloudType           type_rootto      = RootTo.GetRoot.NodeType.Type;

            for (int i = NodeFullPath.IndexOf(RootFrom) + 1; i < NodeFullPath.Count; i++)
            {
                ExplorerNode node = new ExplorerNode();
                node.Info.Size = NodeFullPath[i].Info.Size;
                node.Info.Name = (type_rootto == CloudType.LocalDisk || type_rootto == CloudType.Dropbox) ? RemoveSpecialChar(NodeFullPath[i].Info.Name) : NodeFullPath[i].Info.Name;
                RootTo.AddChild(node);
                RootTo = node;
            }
            return(RootTo);
        }
Example #2
0
        public ExplorerNode FindSameParent(ExplorerNode othernode)
        {
            List <ExplorerNode> list_other = othernode.GetFullPath();
            List <ExplorerNode> list_this  = GetFullPath();
            ExplorerNode        node       = null;
            int max = list_other.Count <= list_this.Count ? list_other.Count : list_this.Count;

            for (int i = 0; i < max; i++)
            {
                if (list_other[i] == list_this[i])
                {
                    node = list_this[i];
                }
                else
                {
                    break;
                }
            }
            return(node);
        }