예제 #1
0
        private DbQueueContainerCollection ReadListQueueContainersResult(string containerNamePrefix, string separator, int maxQueueNames, IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer> queues)
        {
            int    num       = 0;
            string queueName = null;
            List <IQueueContainer> queueContainers = new List <IQueueContainer>();

            foreach (Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer queue in queues)
            {
                if (!string.IsNullOrEmpty(separator))
                {
                    queue.QueueName = DbBlobContainer.GetSummaryName(queue.QueueName, containerNamePrefix, separator);
                }
                if (maxQueueNames != 0)
                {
                    num++;
                    if (num > maxQueueNames)
                    {
                        queueName = queue.QueueName;
                        break;
                    }
                }
                queueContainers.Add(new DbQueueContainer(this, queue));
            }
            return(new DbQueueContainerCollection(queueContainers, queueName));
        }
예제 #2
0
        private DbBlobContainerCollection ReadListBlobContainersResult(string containerNamePrefix, string separator, int maxContainerNames, IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer> containers)
        {
            int    num = 0;
            string str = null;
            List <IBlobContainer> blobContainers = new List <IBlobContainer>();

            foreach (Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer container in containers)
            {
                if (!string.IsNullOrEmpty(separator))
                {
                    container.ContainerName = DbBlobContainer.GetSummaryName(container.ContainerName, containerNamePrefix, separator);
                }
                if (maxContainerNames != 0)
                {
                    num++;
                    if (num > maxContainerNames)
                    {
                        str = string.Concat("/", this.Name, "/", container.ContainerName);
                        break;
                    }
                }
                blobContainers.Add(new DbBlobContainer(this, container, true));
            }
            return(new DbBlobContainerCollection(blobContainers, str));
        }
예제 #3
0
        private DbBlobObjectCollection ReadListBlobsResult(string blobNamePrefix, string separator, int maxBlobNames, IQueryable <Blob> blobs)
        {
            DbBlobObject       dbListBlobObject;
            int                num         = 0;
            string             blobName    = null;
            DateTime?          nullable    = null;
            List <IBlobObject> blobObjects = new List <IBlobObject>();

            foreach (Blob blob in blobs)
            {
                bool flag = false;
                if (!string.IsNullOrEmpty(separator))
                {
                    blob.BlobName = DbBlobContainer.GetSummaryName(blob.BlobName, blobNamePrefix, separator, out flag);
                }
                if (maxBlobNames != 0)
                {
                    num++;
                    if (num > maxBlobNames)
                    {
                        blobName = blob.BlobName;
                        nullable = new DateTime?(blob.VersionTimestamp);
                        break;
                    }
                }
                if (blob.BlobType == BlobType.ListBlob)
                {
                    dbListBlobObject = new DbListBlobObject(this.StorageManager, blob, BlobServiceVersion.Sept09);
                }
                else
                {
                    dbListBlobObject = new DbPageBlobObject(this.StorageManager, blob, BlobServiceVersion.Sept09);
                }
                DbBlobObject dbBlobObject = dbListBlobObject;
                blobObjects.Add(dbBlobObject);
                if (!flag)
                {
                    continue;
                }
                dbBlobObject.SetBlobNoneType();
            }
            return(new DbBlobObjectCollection(blobObjects, null, blobName, nullable));
        }
예제 #4
0
        internal static string GetSummaryName(string name, string prefix, string separator)
        {
            bool flag = false;

            return(DbBlobContainer.GetSummaryName(name, prefix, separator, out flag));
        }