Example #1
0
        private IEnumerator <IAsyncResult> SetExpiryTimeImpl(DateTime expiryTime, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginSetExpiryTime(StorageStampHelpers.AdjustDateTimeRange(expiryTime), Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.SetExpiryTimeImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndSetExpiryTime(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Example #2
0
 public static DateTime?AdjustNullableDatetimeRange(DateTime?datetime)
 {
     if (!datetime.HasValue)
     {
         return(null);
     }
     return(new DateTime?(StorageStampHelpers.AdjustDateTimeRange(datetime.Value)));
 }
Example #3
0
        public static DateTime[] AdjustDateTimeRange(DateTime[] dateTime)
        {
            List <DateTime> dateTimes = new List <DateTime>();

            if (dateTime != null)
            {
                dateTimes.AddRange(
                    from d in (IEnumerable <DateTime>)dateTime
                    where true
                    select StorageStampHelpers.AdjustDateTimeRange(d));
            }
            if (dateTimes.Count <= 0)
            {
                return(null);
            }
            return(dateTimes.ToArray());
        }
Example #4
0
 public static BlobObjectCondition Convert(IBlobObjectCondition condition)
 {
     if (condition == null)
     {
         return(null);
     }
     return(new BlobObjectCondition(condition.IncludeDisabledContainers, condition.IncludeExpiredBlobs, StorageStampHelpers.AdjustNullableDatetimeRange(condition.IfModifiedSinceTime), StorageStampHelpers.AdjustNullableDatetimeRange(condition.IfNotModifiedSinceTime), StorageStampHelpers.AdjustDateTimeRange(condition.IfLastModificationTimeMatch), StorageStampHelpers.AdjustDateTimeRange(condition.IfLastModificationTimeMismatch), condition.UpdateOptions, condition.LeaseId, condition.IsFetchingMetadata, condition.IsIncludingSnapshots, condition.IsIncludingPageBlobs, condition.IsIncludingAppendBlobs, condition.IsIncludingUncommittedBlobs, condition.IsDeletingOnlySnapshots, condition.IsRequiringNoSnapshots, condition.IsSkippingLastModificationTimeUpdate, condition.SequenceNumberOperator, condition.SequenceNumber, condition.RequiredBlobType, condition.IsMultipleConditionalHeaderEnabled, condition.IsCopyOperationOnAppendBlobsAllowed, condition.IsRequiringLeaseIfNotModifiedSince, condition.IsDiskMountStateConditionRequired, condition.ExcludeSoftDeletedBlobs, condition.EnsureBlobIsAlreadySoftDeleted, condition.IsOperationAllowedOnArchivedBlobs, condition.SkipLeaseCheck, condition.InternalArchiveBlobLMT, condition.InternalArchiveBlobGenerationId, condition.InternalArchiveRequestId, condition.IncludeSoftDeletedBlobsOnly));
 }
Example #5
0
 public void JustDecompileGenerated_set_IfLastModificationTimeMismatch(DateTime[] value)
 {
     this.ifLastModificationTimeMismatch = StorageStampHelpers.AdjustDateTimeRange(value);
 }