예제 #1
0
        private IEnumerator <IAsyncResult> ListQueueContainersImpl(string containerNamePrefix, ContainerPropertyNames propertyNames, string separator, string containerNameStart, IContainerCondition condition, int maxQueueNames, AsyncIteratorContext <IQueueContainerCollection> context)
        {
            IStringDataEventStream verboseDebug = Logger <INormalAndDebugLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { containerNamePrefix, propertyNames, separator, containerNameStart, condition, maxQueueNames, this.Timeout };
            verboseDebug.Log("ListQueueContainersImpl({0},{1},{2},{3},{4},{5},{6})", objArray);
            IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute <DbQueueContainerCollection>((TimeSpan param0) => {
                DbQueueContainerCollection dbQueueContainerCollections;
                StorageStampHelpers.ValidateMaxContainers(maxQueueNames);
                using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext())
                {
                    IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer> queueContainers = this.MakeListQueueContainersQuery(containerNamePrefix, separator, containerNameStart, condition, maxQueueNames, dbContext);
                    dbQueueContainerCollections = this.ReadListQueueContainersResult(containerNamePrefix, separator, maxQueueNames, queueContainers);
                }
                return(dbQueueContainerCollections);
            }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("StorageStamp.ListQueueContainersImpl"));

            yield return(asyncResult);

            context.ResultData = this.StorageManager.AsyncProcessor.EndExecute <DbQueueContainerCollection>(asyncResult);
        }
예제 #2
0
        private IEnumerator <IAsyncResult> ListBlobContainersImpl(string containerNamePrefix, ContainerPropertyNames propertyNames, string separator, string containerKeyStart, IContainerCondition condition, int maxContainerNames, AsyncIteratorContext <IBlobContainerCollection> context)
        {
            IStringDataEventStream verboseDebug = Logger <INormalAndDebugLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { containerNamePrefix, propertyNames, separator, containerKeyStart, condition, maxContainerNames, this.Timeout };
            verboseDebug.Log("ListBlobContainersImpl({0},{1},{2},{3},{4},{5},{6})", objArray);
            string str = null;

            if (containerKeyStart != null)
            {
                string[] strArrays = containerKeyStart.Split(new char[] { '/' });
                if ((int)strArrays.Length != 3)
                {
                    throw new ArgumentOutOfRangeException("containerKeyStart", "The marker is not well formed.");
                }
                string str1 = strArrays[1];
                str = strArrays[2];
                if (str1 != this.Name)
                {
                    throw new ArgumentException(string.Format("Account name '{0}' specified in the container key start does not match the account being listed '{1}'", str1, this.Name), "containerKeyStart");
                }
            }
            IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute <DbBlobContainerCollection>((TimeSpan param0) => {
                DbBlobContainerCollection dbBlobContainerCollections;
                StorageStampHelpers.ValidateMaxContainers(maxContainerNames);
                using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext())
                {
                    IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer> blobContainers = this.MakeListBlobContainersQuery(containerNamePrefix, separator, str, condition, maxContainerNames, dbContext);
                    dbBlobContainerCollections = this.ReadListBlobContainersResult(containerNamePrefix, separator, maxContainerNames, blobContainers);
                }
                return(dbBlobContainerCollections);
            }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("StorageStamp.ListBlobContainersImpl"));

            yield return(asyncResult);

            context.ResultData = this.StorageManager.AsyncProcessor.EndExecute <DbBlobContainerCollection>(asyncResult);
        }