Exemplo n.º 1
0
 public FolderName(string name, FolderName parentName)
 {
     m_name          = name;
     m_parentName    = parentName;
     m_folders       = new List <Folder>();
     ChildFolderName = null;
 }
Exemplo n.º 2
0
        // Produce ordered list of folder names.  Folder names can
        // contain file separator chars if escaped with '\'.
        // Ignore leading and trailing separators.  Return the top-level.
        public static FolderName GetFolderNameLinks(string path)
        {
            FolderName    currentFolder = null;
            StringBuilder sb            = new StringBuilder();
            int           iPath         = 0;

            while (iPath < path.Length)
            {
                char c = path[iPath];
                iPath++;
                if (c == EscapeChar &&
                    iPath < path.Length &&
                    FolderSeparators.Contains(path[iPath]))
                {
                    sb.Append(path[iPath]);
                    iPath++;
                }
                else if (!FolderSeparators.Contains(c))
                {
                    sb.Append(c);
                }
                else
                {
                    if (sb.Length > 0)
                    {
                        FolderName fn = new FolderName(sb.ToString(),
                                                       currentFolder);
                        if (currentFolder != null)
                        {
                            currentFolder.ChildFolderName = fn;
                        }
                        currentFolder = fn;
                    }
                    sb.Clear();
                }
            }
            if (sb.Length > 0)
            {
                FolderName fn = new FolderName(sb.ToString(),
                                               currentFolder);
                if (currentFolder != null)
                {
                    currentFolder.ChildFolderName = fn;
                }
                currentFolder = fn;
            }
            while (currentFolder != null &&
                   currentFolder.ParentFolderName != null)
            {
                currentFolder = currentFolder.ParentFolderName;
            }
            return(currentFolder);
        }
Exemplo n.º 3
0
 public Folder(FolderName name, Folder parent, GDriveFile entry)
 {
     m_entry  = entry;
     m_name   = name;
     m_parent = parent;
 }