private StorageTaskTaskSnapshotWrapper(
            StorageTaskSnapshot snapshot = null,
            Exception error = null)
        {
            if (snapshot?.Progress != null)
            {
                TransferredUnitCount = snapshot.Progress.CompletedUnitCount;
                TotalUnitCount       = snapshot.Progress.TotalUnitCount;
                TransferredFraction  = snapshot.Progress.FractionCompleted;
            }

            Metadata = snapshot?.Metadata?.ToAbstract();
            Error    = error;
        }
Example #2
0
 public static IStorageTaskSnapshot ToAbstract(this StorageTaskSnapshot @this)
 {
     return(StorageTaskTaskSnapshotWrapper.FromSnapshot(@this));
 }
 public static IStorageTaskSnapshot FromSnapshot(StorageTaskSnapshot snapshot)
 {
     return(new StorageTaskTaskSnapshotWrapper(snapshot: snapshot));
 }
 public StorageTaskSnapshotWrapper(StorageTaskSnapshot storageTaskSnapshot)
 {
     _storageTaskSnapshot = storageTaskSnapshot;
 }
 public StorageTaskSnapshotWrapper(StorageTaskSnapshot storageTaskSnapshot)
 {
     _storageTaskSnapshot = storageTaskSnapshot ?? throw new ArgumentNullException(nameof(storageTaskSnapshot));
 }