internal bool GetPageRegions(string containerName, string blobName, out PageRange[] ranges)
 {
     try
     {
         var container = _client.GetContainerReference(containerName);
         var blobPage = container.GetPageBlobReference(blobName);
         ranges = blobPage.GetPageRanges().ToArray();
         return true;
     }
     catch (StorageClientException)
     {
         ranges = null;
         return false;
     }
 }
Exemplo n.º 2
0
        // Retrieve the list of regions in use for a page blob.
        // Return true on success, false if not found, throw exception on error.
        public bool GetPageRegions(string containerName, string blobName, out PageRange[] regions)
        {
            regions = null;

            try
            {
                CloudBlobContainer container = BlobClient.GetContainerReference(containerName);
                CloudPageBlob blob = container.GetPageBlobReference(blobName);

                IEnumerable<PageRange> regionList = blob.GetPageRanges();
                regions = new PageRange[regionList.Count()];
                int i = 0;
                foreach (PageRange region in regionList)
                {
                    regions[i++] = region;
                }
                return true;
            }
            catch (StorageClientException ex)
            {
                if ((int)ex.StatusCode == 404)
                {
                    return false;
                }

                throw;
            }
        }
 public bool GetPageRegions(string samplecontainer1, string pageblob1Txt, out PageRange[] ranges)
 {
     throw new NotImplementedException();
 }