Esempio n. 1
0
        public SharedRootFolder Add(bool enabled, string name, string description, SharedFolderRootType type, string boundedUser, string boundedFolder)
        {
            string text = Guid.NewGuid().ToString();

            this.m_pVirtualServer.Server.TCP_Client.TcpStream.WriteLine(string.Concat(new object[]
            {
                "AddSharedRootFolder ",
                this.m_pVirtualServer.VirtualServerID,
                " ",
                TextUtils.QuoteString(text),
                " ",
                TextUtils.QuoteString(name),
                " ",
                TextUtils.QuoteString(description),
                " ",
                (int)type,
                " ",
                TextUtils.QuoteString(boundedUser),
                " ",
                TextUtils.QuoteString(boundedFolder),
                " ",
                enabled
            }));
            string text2 = this.m_pVirtualServer.Server.ReadLine();

            if (!text2.ToUpper().StartsWith("+OK"))
            {
                throw new Exception(text2);
            }
            SharedRootFolder sharedRootFolder = new SharedRootFolder(this.m_pVirtualServer, this, text, enabled, name, description, type, boundedUser, boundedFolder);

            this.m_pRootFolders.Add(sharedRootFolder);
            return(sharedRootFolder);
        }
Esempio n. 2
0
        public void Remove(SharedRootFolder sharedFolder)
        {
            Guid.NewGuid().ToString();
            this.m_pVirtualServer.Server.TCP_Client.TcpStream.WriteLine("DeleteSharedRootFolder " + this.m_pVirtualServer.VirtualServerID + " " + TextUtils.QuoteString(sharedFolder.ID));
            string text = this.m_pVirtualServer.Server.ReadLine();

            if (!text.ToUpper().StartsWith("+OK"))
            {
                throw new Exception(text);
            }
            this.m_pRootFolders.Remove(sharedFolder);
        }