コード例 #1
0
 internal BitsJob(BitsManager manager, IBackgroundCopyJob job)
 {
     this.manager = manager;
     this.job     = job;
     this.job2    = this.job as IBackgroundCopyJob2;
     this.NotificationInterface = manager.NotificationHandler;
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 private void ReqJob2()
 {
     try
     {
         m_ijob2 = (IBackgroundCopyJob2)m_ijob;
     }
     catch
     {
         throw new NotSupportedException();
     }
 }
コード例 #4
0
ファイル: BitsJob.cs プロジェクト: killbug2004/WSProf
 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;
 }
コード例 #5
0
        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");
        }
コード例 #6
0
 internal BackgroundCopyJobCredentials(IBackgroundCopyJob2 job)
 {
     ijob2 = job;
 }
コード例 #7
0
 /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
 void IDisposable.Dispose()
 {
     ijob2 = null;
 }