Exemple #1
0
        void IFileWaitingForObject.ToStartDownload(Guid stream_id, FileReqPackage file, Guid waiting)
        {
            StreamRequest.TryRemove(waiting, out _);

            RunningDatas.FileService.CreateDownload(stream_id, file.Path, file.FileName, file.Size);

            UpdateUI();
        }
Exemple #2
0
        async void IFileWaitingForObject.ToStartUpload(Guid stream_id, FileReqPackage file, Guid waiting)
        {
            StreamRequest.TryRemove(waiting, out _);

            RunningDatas.FileService.CreateUpload(stream_id, await file.Path.GetFileAsync(file.FileName));

            UpdateUI();
        }
Exemple #3
0
        public void Add(string cloud_path, string cloud_name, FileReqPackage file)
        {
            Guid id = Guid.NewGuid();

            StreamRequest.TryAdd(id, new WaitingObject(id, cloud_path, cloud_name, file, this));

            UpdateUI();
        }
Exemple #4
0
            public WaitingObject(Guid id, string cloud_path, string cloud_name, FileReqPackage file, IFileWaitingForObject root)
            {
                ID        = id;
                CloudPath = cloud_path;
                CloudName = cloud_name;
                File      = file;
                Root      = root;

                IsActive = false;

                WaitTimer = new Timer
                {
                    Interval  = 30000,
                    AutoReset = false
                };
                WaitTimer.Elapsed += Timer_Trigger;
            }