Beispiel #1
0
 public void AddFileWithRanges(string remoteName, string localName, Collection <FileRange> fileRanges)
 {
     try
     {
         if (job3 != null && fileRanges != null) // only supported from IBackgroundCopyJob3 and above
         {
             BG_FILE_RANGE[] ranges = new BG_FILE_RANGE[fileRanges.Count];
             for (int i = 0; i < fileRanges.Count; i++)
             {
                 ranges[i] = fileRanges[i]._BG_FILE_RANGE;
             }
             this.job3.AddFileWithRanges(remoteName, localName, (uint)fileRanges.Count, ranges);
         }
         else
         {
             throw new NotSupportedException("IBackgroundCopyJob3");
         }
     }
     catch (COMException exception)
     {
         manager.PublishException(this, exception);
     }
 }
Beispiel #2
0
 internal BackgroundCopyFileRange(BG_FILE_RANGE range)
 {
     Offset = Convert.ToInt64(range.InitialOffset);
     Length = range.Length == Interop.Constants.BG_LENGTH_TO_EOF ? Constants.LengthToEndOfFile : Convert.ToInt64(range.Length);
 }
Beispiel #3
0
 public FileRange(ulong initialOffset, ulong length)
 {
     this.fileRange = new BG_FILE_RANGE();
     this.fileRange.InitialOffset = initialOffset;
     this.fileRange.Length        = length;
 }
Beispiel #4
0
 internal FileRange(BG_FILE_RANGE fileRange)
 {
     this.fileRange = fileRange;
 }