コード例 #1
0
ファイル: BitsFile.cs プロジェクト: killbug2004/WSProf
 internal BitsFile(BitsJob job, IBackgroundCopyFile file)
 {
     if (null == file)
         throw new ArgumentNullException("IBackgroundCopyFile");
     this.file = file;
     this.job = job;
 }
コード例 #2
0
        //  --------------
        //  Release method
        //  --------------

        private void Release()
        {
            if (interop != null)
            {
                _ = Marshal.ReleaseComObject(interop); interop = null;
            }
        }
コード例 #3
0
ファイル: BitsFile.cs プロジェクト: schraubchen/BITSDL
 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;
 }
コード例 #4
0
 /// <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); }
 }
コード例 #5
0
 internal BitsFile(BitsJob job, IBackgroundCopyFile file)
 {
     if (null == file)
     {
         throw new ArgumentNullException("IBackgroundCopyFile");
     }
     this.file = file;
     this.job  = job;
 }
コード例 #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;
 }
コード例 #7
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             //TODO: release COM resource
             this.file = null;
         }
     }
     disposed = true;
 }
コード例 #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();
        }
コード例 #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;
        }
コード例 #10
0
 /// <summary>Resets the enumerator index to the beginning of the <see cref="BackgroundCopyFileCollection"/> collection.</summary>
 public void Reset()
 {
     icurrentfile = null;
     ienum.Reset();
 }
コード例 #11
0
 /// <summary>Disposes of the Enumerator object.</summary>
 public void Dispose()
 {
     ienum        = null;
     icurrentfile = null;
 }
コード例 #12
0
ファイル: BitsFile.cs プロジェクト: schraubchen/BITSDL
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             //TODO: release COM resource
             this.file = null;
         }
     }
     disposed = true;
 }
コード例 #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;
 }
コード例 #14
0
 internal BackgroundCopyFileInfo(IBackgroundCopyFile ibgfile)
 {
     iFile = ibgfile;
 }
コード例 #15
0
        //  ------------
        //  construction
        //  ------------

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