Пример #1
0
        /// <summary>Releases unmanaged and - optionally - managed resources.</summary>
        /// <param name="disposing"><c>True</c> to release both managed and unmanaged resources; otherwise, <c>False</c> to release only unmanaged resources.</param>
        void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    if (this.NotificationTarget != null)
                    {
                        this.NotificationInterface = this.NotificationTarget;
                    }

                    if (this.Files != null)
                    {
                        this.Files.Dispose();
                    }

                    this.Job = null;
                    if (this.manager != null)
                    {
                        this.manager.Dispose();
                    }
                }
            }

            this.disposed = true;
        }
Пример #2
0
 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;
 }
Пример #3
0
        internal BitsJob(BitsManager manager, IBackgroundCopyJob job)
        {
            this.manager = manager;
            this.job     = job;
            this.job2    = this.job as IBackgroundCopyJob2;
            this.job3    = this.job as IBackgroundCopyJob3;
            this.job4    = this.job as IBackgroundCopyJob4;

            ///store existing notification handler and route message to this as well
            ///otherwise it may break system download jobs
            if (this.NotificationInterface != null)
            {
                this.notificationTarget = this.NotificationInterface;   //pointer to the existing one;
            }
            this.NotificationInterface = manager.NotificationHandler;   //notification interface will be disabled when NotifyCmd is set
        }
Пример #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             if (this.notificationTarget != null)
                 this.NotificationInterface = this.notificationTarget;
             if (this.files != null)
                 this.files.Dispose();
             this.job = null;
         }
     }
     disposed = true;
 }
Пример #5
0
        /// <summary>Releases unmanaged and - optionally - managed resources.</summary>
        /// <param name="disposing"><c>True</c> to release both managed and unmanaged resources; otherwise, <c>False</c> to release only unmanaged resources.</param>
        void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    if (this.NotificationTarget != null)
                    {
                        this.NotificationInterface = this.NotificationTarget;
                    }

                    if (this.Files != null)
                    {
                        this.Files.Dispose();
                    }

                    this.Job = null;
                    if (this.manager != null)
                    {
                        this.manager.Dispose();
                    }
                }
            }

            this.disposed = true;
        }