コード例 #1
0
        protected override void EncodeInitialElements(Uri requestUrl, ListFilesOperationContext operationContext, IListFilesResultCollection result, XmlWriter xmlWriter)
        {
            string serviceEndpointFromUri = this.GetServiceEndpointFromUri(requestUrl, this.uriComponents.IsUriPathStyle);

            xmlWriter.WriteStartElement("EnumerationResults");
            xmlWriter.WriteAttributeString("ServiceEndpoint", serviceEndpointFromUri);
            xmlWriter.WriteAttributeString("ShareName", this.uriComponents.ContainerName);
            if (this.shareSnapshot != DateTime.MaxValue)
            {
                xmlWriter.WriteAttributeString("ShareSnapshot", HttpUtilities.ConvertSnapshotDateTimeToHttpString(this.shareSnapshot));
            }
            xmlWriter.WriteAttributeString("DirectoryPath", this.uriComponents.RemainingPart);
            XmlListEncoderHelpers.WriteListOperationInfoToXml(xmlWriter, operationContext);
            xmlWriter.WriteStartElement("Entries");
        }
コード例 #2
0
 protected override void EncodeInitialElements(Uri requestUrl, ListContainersOperationContext loc, IListContainersResultCollection result, XmlWriter xmlWriter)
 {
     xmlWriter.WriteStartElement("EnumerationResults");
     if (!VersioningHelper.IsPreAugust13OrInvalidVersion(loc.RequestVersion))
     {
         string str = string.Concat(HttpRequestAccessorCommon.TrimEndSlash(requestUrl.GetLeftPart(UriPartial.Path)), "/");
         xmlWriter.WriteAttributeString("ServiceEndpoint", str);
     }
     else
     {
         xmlWriter.WriteAttributeString("AccountName", requestUrl.GetLeftPart(UriPartial.Path));
     }
     XmlListEncoderHelpers.WriteListOperationInfoToXml(xmlWriter, loc);
     xmlWriter.WriteStartElement(this.XmlContainersElementName);
 }
コード例 #3
0
 protected override void EncodeInitialElements(Uri requestUrl, ListBlobsOperationContext lboc, IListBlobsResultCollection result, XmlWriter xmlWriter)
 {
     xmlWriter.WriteStartElement("EnumerationResults");
     if (!VersioningHelper.IsPreAugust13OrInvalidVersion(lboc.RequestVersion))
     {
         string str = HttpRequestAccessorCommon.TrimEndSlash(requestUrl.GetLeftPart(UriPartial.Path));
         int    num = str.LastIndexOf("/");
         xmlWriter.WriteAttributeString("ServiceEndpoint", str.Remove(num + 1));
         xmlWriter.WriteAttributeString("ContainerName", str.Substring(num + 1));
     }
     else
     {
         xmlWriter.WriteAttributeString("ContainerName", requestUrl.GetLeftPart(UriPartial.Path));
     }
     XmlListEncoderHelpers.WriteListOperationInfoToXml(xmlWriter, lboc);
     xmlWriter.WriteStartElement("Blobs");
 }