public VaultUploadOperation(IAdditionalContent content, long position) { this.WS = new Service(); this.mSessionID = Guid.NewGuid(); this.mChunkSize = ConfigSettings.GetInt("VaultUpChunkSize", 0x7d000); this.Progress = 0; this.SubmittingChunk = false; this.UploadFile = null; this.ProgressChanged = null; this.Finished = null; this.StatusChanged = null; this.mIsDisposed = false; this.mLastStatus = "<LOC>Idle"; this.mIsProgressFinished = false; this.mIsOperationFinished = false; this.OperationFinished = null; this.mContent = content; this.mPosition = position; ActiveOperations.Insert(0, this); }
public void Resume() { WaitCallback callBack = null; WaitCallback callback2 = null; if (!this.IsProgressFinished) { if (callBack == null) { callBack = delegate (object s) { this.WS = new Service(); ActiveOperations.Add(this); this.Start(); }; } ThreadPool.QueueUserWorkItem(callBack); } else if (!this.IsOperationFinished) { if (callback2 == null) { callback2 = delegate (object s) { string path = this.Content.GetDownloadPath(); string str2 = path + @"\content.partial"; foreach (string str3 in Directory.GetFiles(path, "*.*", SearchOption.TopDirectoryOnly)) { if (!(str3 == str2)) { File.Delete(str3); } } foreach (string str4 in Directory.GetDirectories(path)) { Directory.Delete(str4, true); } this.WS = new Service(); ActiveOperations.Add(this); this.OnDownloadComplete(); }; } ThreadPool.QueueUserWorkItem(callback2); } }