Esempio n. 1
0
 internal BitsFile(BitsJob job, IBackgroundCopyFile file)
 {
     if (null == file)
         throw new ArgumentNullException("IBackgroundCopyFile");
     this.file = file;
     this.job = job;
 }
        //  --------------
        //  Release method
        //  --------------

        private void Release()
        {
            if (interop != null)
            {
                _ = Marshal.ReleaseComObject(interop); interop = null;
            }
        }
Esempio n. 3
0
 internal BitsFile(BitsJob job, IBackgroundCopyFile file)
 {
     if (null == file)
         throw new ArgumentNullException("file", "Parameter IBackgroundCopyFile cannot be a null reference");
     this.file = file;
     this.file2 = file as IBackgroundCopyFile2;
     this.job = job;
 }
 /// <summary>Moves the enumerator index to the next object in the collection.</summary>
 /// <returns></returns>
 public bool MoveNext()
 {
     try
     {
         icurrentfile = ienum.Next(1)?.FirstOrDefault();
         return(icurrentfile != null);
     }
     catch { return(false); }
 }
Esempio n. 5
0
 internal BitsFile(BitsJob job, IBackgroundCopyFile file)
 {
     if (null == file)
     {
         throw new ArgumentNullException("IBackgroundCopyFile");
     }
     this.file = file;
     this.job  = job;
 }
Esempio n. 6
0
 internal BitsFile(BitsJob job, IBackgroundCopyFile file)
 {
     if (null == file)
     {
         throw new ArgumentNullException("file", "Parameter IBackgroundCopyFile cannot be a null reference");
     }
     this.file  = file;
     this.file2 = file as IBackgroundCopyFile2;
     this.job   = job;
 }
Esempio n. 7
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             //TODO: release COM resource
             this.file = null;
         }
     }
     disposed = true;
 }
Esempio n. 8
0
        internal BackgroundCopyException(IBackgroundCopyError err)
        {
            const uint lang = 0x1;             // LANG_NEUTRAL, SUBLANG_DEFAULT

            err.GetError(out ctx, out code);
            try { ctxDesc = err.GetErrorContextDescription(lang); }
            catch { ctxDesc = SafeCoTaskMemString.Null; }
            try { errDesc = err.GetErrorDescription(lang); }
            catch { errDesc = SafeCoTaskMemString.Null; }
            try { protocol = err.GetProtocol(); }
            catch { protocol = SafeCoTaskMemString.Null; }
            iVal = err.GetFile();
        }
Esempio n. 9
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)
                {
                    // TODO: release COM resource
                    this.file = null;
                    if (this.job != null)
                    {
                        this.job.Dispose();
                    }
                }
            }

            this.disposed = true;
        }
 /// <summary>Resets the enumerator index to the beginning of the <see cref="BackgroundCopyFileCollection"/> collection.</summary>
 public void Reset()
 {
     icurrentfile = null;
     ienum.Reset();
 }
 /// <summary>Disposes of the Enumerator object.</summary>
 public void Dispose()
 {
     ienum        = null;
     icurrentfile = null;
 }
Esempio n. 12
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             //TODO: release COM resource
             this.file = null;
         }
     }
     disposed = true;
 }
Esempio n. 13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="jobFile">
 /// The IBackgroundCopyFile interface contains information about a file
 /// that is part of a job.
 /// </param>
 internal BitsFileAdapter( IBackgroundCopyFile jobFile )
 {
     File = jobFile;
 }
Esempio n. 14
0
 internal BackgroundCopyFileInfo(IBackgroundCopyFile ibgfile)
 {
     iFile = ibgfile;
 }
        //  ------------
        //  construction
        //  ------------

        internal BackgroundCopyFile(BackgroundCopyManager manager, IBackgroundCopyFile i)
        {
            Manager = manager;
            interop = i ?? throw new ArgumentNullException(nameof(i));
        }