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; } }
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); } }
internal BitsFile(BitsJob job, IBackgroundCopyFile file) { if (null == file) { throw new ArgumentNullException("IBackgroundCopyFile"); } this.file = file; this.job = job; }
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; }
protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { //TODO: release COM resource this.file = null; } } disposed = true; }
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(); }
/// <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; }
/// <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; }
internal BackgroundCopyFileInfo(IBackgroundCopyFile ibgfile) { iFile = ibgfile; }
// ------------ // construction // ------------ internal BackgroundCopyFile(BackgroundCopyManager manager, IBackgroundCopyFile i) { Manager = manager; interop = i ?? throw new ArgumentNullException(nameof(i)); }