Exemplo n.º 1
0
 public static void MoveElement(string hashSource, string hashDestinationFolder)
 {
     CLog.Log("MoveElement()");
     if (CloudClientChannel == null)
     {
         CreateCloudClientChannel();
     }
     CloudClientChannel.MoveElement(hashSource, hashDestinationFolder);
 }
Exemplo n.º 2
0
        public static File DownloadFile(string fileHash)
        {
            if (CloudClientChannel == null)
            {
                CreateCloudClientChannel();
            }

            var file = CloudClientChannel.GetFile(fileHash);

            return(file);
        }
Exemplo n.º 3
0
        public static Folder getFolderByHash(string hash, string userLogin)
        {
            var c = CloudClientChannel.GetFolder(hash, userLogin);

            foreach (var el in fList)
            {
                c.Content.Item2.Add(el);
            }
            //c.Content.Item2.Add(new File { Name="1.mp4" });
            return(c);
        }
Exemplo n.º 4
0
        public static WcfClassesLib.Folder getRootFolder(string userLogin)
        {
            CLog.Log("getRootFolder()");

            if (CloudClientChannel == null)
            {
                CreateCloudClientChannel();
            }

            return(CloudClientChannel.GetFolder("root", userLogin));
        }
Exemplo n.º 5
0
        public static async void DeleteElement(string hash, Lobby lobby)
        {
            CLog.Log("DeleteElement()");
            if (CloudClientChannel == null)
            {
                CreateCloudClientChannel();
            }
            CloudClientChannel.DeleteElement(hash);


            lobby._currentFolder = await CloudClientChannel.GetFolderAsync(lobby._currentFolder.Hash, lobby.user.Login);
        }
Exemplo n.º 6
0
        public static List <Folder> getFoldersByName(string folderName, string userLogin)
        {
            CLog.Log("getFoldersByName()");


            if (CloudClientChannel == null)
            {
                CreateCloudClientChannel();
            }

            return(CloudClientChannel.GetFolderHashesByName(folderName, userLogin).ToList());
        }
Exemplo n.º 7
0
        public static async void UploadFile(string userLogin, string fileName, string folderHash, byte[] file, Lobby lobby)
        {
            try
            {
                if (CloudClientChannel == null)
                {
                    CreateCloudClientChannel();
                }

                fList.Add(new File {
                    Name = fileName, ParentHash = folderHash, Hash = folderHash, ElementType = 0
                });

                CloudClientChannel.UploadFile(userLogin, fileName, folderHash, file);
                lobby._currentFolder = await CloudClientChannel.GetFolderAsync(lobby._currentFolder.Hash, lobby.user.Login);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemplo n.º 8
0
        public static async void CreateFolder(string name, string hash, string userLogin, Lobby lobby)
        {
            await CloudClientChannel.CreateFolderAsync(name, hash, userLogin);

            lobby._currentFolder = await CloudClientChannel.GetFolderAsync(lobby._currentFolder.Hash, lobby.user.Login);
        }