Ejemplo n.º 1
0
 /// <summary>
 /// This method takes care of letting the user accept invitations by calling the
 /// server.
 /// </summary>
 /// <param name="accepts"></param>
 internal void AcceptInvitations(string[] accepts)
 {
     using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
     {
         proxy.AcceptInvitations(password, username, accepts);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// This method takes care of sharing a folder by calling the server.
 /// </summary>
 /// <param name="users"></param>
 /// <param name="folder"></param>
 /// <param name="permission"></param>
 internal void ShareFolder(string[] users, string folder, string permission)
 {
     using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
     {
         proxy.ShareFolder(password, username, users, folder, permission);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// This method takes care of letting the user accept invitations by calling the
        /// server.
        /// </summary>
        /// <param name="accepts"></param>
        internal void AcceptInvitations(string[] accepts)
        {
            using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
            {
                proxy.AcceptInvitations(password, username, accepts);

            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// This method takes care of retriving the current invitations to the user.
 /// </summary>
 /// <returns></returns>
 internal string[] GetInvitations()
 {
     string[] result;
     using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
     {
         result = proxy.GetInvitations(password, username);
     }
     return(result);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// This method takes care of synchronizing the users local files with
 /// the files on the server. First it reads the files from the disk, then
 /// it sends them to the server and at last it saves the retrieved files from
 /// the server to the local disk.
 /// </summary>
 internal void Synchronize()
 {
     string[][] files = GetAllFilesFromDisk().ToArray();
     using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
     {
         files = proxy.Synchronize(username, password, files);
     }
     SaveAllFilesToDisk(files);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// This method takes care of sharing documents
        /// </summary>
        /// <param name="users"></param>
        /// <param name="documents"></param>
        /// <param name="permission"></param>
        internal void ShareDocuments(string[] users, string[] documents, string permission)
        {
            Synchronize();

            using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
            {
                foreach (string doc in documents)
                {
                    proxy.ShareDocuments(username, password, users, doc, permission);
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// This method takes care of retriving the current invitations to the user.
        /// </summary>
        /// <returns></returns>
        internal string[] GetInvitations()
        {
            string[] result;
            using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
            {
                result = proxy.GetInvitations(password, username);

            }
            return result;
        }
Ejemplo n.º 8
0
 /// <summary>
 /// This method takes care of synchronizing the users local files with 
 /// the files on the server. First it reads the files from the disk, then
 /// it sends them to the server and at last it saves the retrieved files from
 /// the server to the local disk.
 /// </summary>
 internal void Synchronize()
 {
     string[][] files = GetAllFilesFromDisk().ToArray();
     using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
     {
         files = proxy.Synchronize(username, password, files);
     }
     SaveAllFilesToDisk(files);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// This method takes care of sharing a folder by calling the server.
        /// </summary>
        /// <param name="users"></param>
        /// <param name="folder"></param>
        /// <param name="permission"></param>
        internal void ShareFolder(string[] users, string folder, string permission)
        {
            using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
            {
                proxy.ShareFolder(password, username, users, folder, permission);

            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// This method takes care of sharing documents
        /// </summary>
        /// <param name="users"></param>
        /// <param name="documents"></param>
        /// <param name="permission"></param>
        internal void ShareDocuments(string[] users, string[] documents, string permission)
        {
            Synchronize();

            using (ClientSystemFacade2Client proxy = new ClientSystemFacade2Client())
            {
                foreach (string doc in documents)
                {
                    proxy.ShareDocuments(username, password, users, doc, permission);
                }

            }
        }