예제 #1
0
        /// <summary>
        /// Delete the specified AzureCloudFile from the Azure container.
        /// </summary>
        /// <param name="o">The object to be deleted.</param>
        public void Delete(AzureCloudFile o)
        {
            string path = UriPathToString(o.Uri);

            if (path.StartsWith("/"))
            {
                path = path.Remove(0, 1);
            }

            CloudBlobContainer c = GetContainerReference(ContainerName);
            CloudBlob          b = c.GetBlobReference(path);

            if (b != null)
            {
                b.BeginDelete(new AsyncCallback(DeleteOperationCompleteCallback), o.Uri);
            }
            else
            {
                throw new ArgumentException("The container reference could not be retrieved from storage provider.", "o");
            }
        }