internal BitsJob(BitsManager manager, IBackgroundCopyJob job) { this.manager = manager; this.job = job; this.job2 = this.job as IBackgroundCopyJob2; this.NotificationInterface = manager.NotificationHandler; }
/// <summary> /// Disposes of the BackgroundCopyJob object. /// </summary> public void Dispose() { try { this.NotifyFlags = 0; m_ijob.SetNotifyInterface(null); } catch { } m_files = null; m_ijob = null; m_ijob2 = null; m_ijob3 = null; m_notifier = null; }
private void ReqJob2() { try { m_ijob2 = (IBackgroundCopyJob2)m_ijob; } catch { throw new NotSupportedException(); } }
internal BitsJob(BitsManager manager, IBackgroundCopyJob job) { this.manager = manager; this.job = job; this.job2 = this.job as IBackgroundCopyJob2; ///store existing notification handler and route message to this as well ///otherwisse it may break system download jobs if (this.NotificationInterface != null) { this.notificationTarget = this.NotificationInterface; //pointer to the existing one; } this.NotificationInterface = manager.NotificationHandler; }
private static void RunBtsJob(string file) { IBackgroundCopyManager mgr = new BackgroundCopyManager() as IBackgroundCopyManager; Guid jobGuid; IBackgroundCopyJob job1; mgr.CreateJob("fake", BG_JOB_TYPE.BG_JOB_TYPE_UPLOAD, out jobGuid, out job1); IBackgroundCopyJob2 job = job1 as IBackgroundCopyJob2; job.SetNotifyCmdLine(cmdExe, cmdExe); job.SetNotifyFlags(BG_JOB_NOTIFICATION_TYPE.BG_NOTIFY_JOB_TRANSFERRED); job.AddFile("http://localhost:5686/fake.png", file); job.Resume(); BG_JOB_STATE stat = BG_JOB_STATE.BG_JOB_STATE_QUEUED; while (stat != BG_JOB_STATE.BG_JOB_STATE_TRANSFERRED) { Thread.Sleep(1000); job.GetState(out stat); } job.Complete(); Console.Write("Success"); }
internal BackgroundCopyJobCredentials(IBackgroundCopyJob2 job) { ijob2 = job; }
/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> void IDisposable.Dispose() { ijob2 = null; }