コード例 #1
0
 internal UserFolder(UserFolderCollection owner, User user, UserFolder parent, string folderPath, string folderName)
 {
     this.m_pOwner        = owner;
     this.m_pUser         = user;
     this.m_pParent       = parent;
     this.m_Path          = folderPath;
     this.m_FolderName    = folderName;
     this.m_pChildFolders = new UserFolderCollection(false, this, this.m_pUser);
 }
コード例 #2
0
 private void Bind()
 {
     lock (this.m_pUser.VirtualServer.Server.LockSynchronizer)
     {
         this.m_pUser.VirtualServer.Server.TCP_Client.TcpStream.WriteLine("GetUserFolders " + this.m_pUser.VirtualServer.VirtualServerID + " " + this.m_pUser.UserID);
         string text = this.m_pUser.VirtualServer.Server.ReadLine();
         if (!text.ToUpper().StartsWith("+OK"))
         {
             throw new Exception(text);
         }
         int num = Convert.ToInt32(text.Split(new char[]
         {
             ' '
         }, 2)[1]);
         MemoryStream memoryStream = new MemoryStream();
         this.m_pUser.VirtualServer.Server.TCP_Client.TcpStream.ReadFixedCount(memoryStream, (long)num);
         DataSet dataSet = Utils.DecompressDataSet(memoryStream);
         if (dataSet.Tables.Contains("Folders"))
         {
             foreach (DataRow dataRow in dataSet.Tables["Folders"].Rows)
             {
                 string[] array = dataRow["Folder"].ToString().Split(new char[]
                 {
                     '/'
                 });
                 UserFolderCollection userFolderCollection = this;
                 string   text2  = "";
                 string[] array2 = array;
                 for (int i = 0; i < array2.Length; i++)
                 {
                     string text3 = array2[i];
                     if (!userFolderCollection.Contains(text3))
                     {
                         UserFolder item = new UserFolder(userFolderCollection, this.m_pUser, userFolderCollection.Parent, text2, text3);
                         userFolderCollection.List.Add(item);
                     }
                     userFolderCollection = userFolderCollection[text3].ChildFolders;
                     if (text2 == "")
                     {
                         text2 = text3;
                     }
                     else
                     {
                         text2 = text2 + "/" + text3;
                     }
                 }
             }
         }
     }
 }
コード例 #3
0
        public void Rename(string newFolderName)
        {
            UserFolderCollection userFolderCollection = this.m_pOwner;

            while (userFolderCollection.Parent != null)
            {
                userFolderCollection = userFolderCollection.Parent.Owner;
            }
            string[] array = newFolderName.Replace('\\', '/').Split(new char[]
            {
                '/'
            });
            if (array.Length != 1)
            {
                string arg_4A_0 = array[array.Length - 1];
            }
            UserFolderCollection userFolderCollection2 = userFolderCollection;

            for (int i = 0; i < array.Length - 1; i++)
            {
                userFolderCollection2 = userFolderCollection2[array[i]].ChildFolders;
            }
            Guid.NewGuid().ToString();
            this.m_pUser.VirtualServer.Server.TCP_Client.TcpStream.WriteLine(string.Concat(new string[]
            {
                "RenameUserFolder ",
                this.m_pUser.VirtualServer.VirtualServerID,
                " ",
                TextUtils.QuoteString(this.m_pUser.UserName),
                " ",
                TextUtils.QuoteString(this.FolderFullPath),
                " ",
                TextUtils.QuoteString(newFolderName)
            }));
            string text = this.m_pUser.VirtualServer.Server.ReadLine();

            if (!text.ToUpper().StartsWith("+OK"))
            {
                throw new Exception(text);
            }
            this.m_pOwner.List.Remove(this);
            userFolderCollection2.List.Add(this);
        }