当前位置: 首页>>代码示例>>C#>>正文


C# ServiceProperties.WriteServiceProperties方法代码示例

本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.WriteServiceProperties方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceProperties.WriteServiceProperties方法的具体用法?C# ServiceProperties.WriteServiceProperties怎么用?C# ServiceProperties.WriteServiceProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties的用法示例。


在下文中一共展示了ServiceProperties.WriteServiceProperties方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetServicePropertiesImpl

        private RESTCommand<NullType> SetServicePropertiesImpl(ServiceProperties properties, TableRequestOptions requestOptions)
        {
            MultiBufferMemoryStream memoryStream = new MultiBufferMemoryStream(null /* bufferManager */, (int)(1 * Constants.KB));
            try
            {
                properties.WriteServiceProperties(memoryStream);
            }
            catch (InvalidOperationException invalidOpException)
            {
                throw new ArgumentException(invalidOpException.Message, "properties");
            }

            RESTCommand<NullType> retCmd = new RESTCommand<NullType>(this.Credentials, this.StorageUri);
            requestOptions.ApplyToStorageCommand(retCmd);
            retCmd.BuildRequest = (cmd, uri, builder, cnt, serverTimeout, ctx) => TableHttpRequestMessageFactory.SetServiceProperties(uri, serverTimeout, cnt, ctx);
            retCmd.BuildContent = (cmd, ctx) => HttpContentFactory.BuildContentFromStream(memoryStream, 0, memoryStream.Length, null /* md5 */, cmd, ctx);
            retCmd.Handler = this.AuthenticationHandler;
            retCmd.BuildClient = HttpClientFactory.BuildHttpClient;
            retCmd.PreProcessResponse =
                (cmd, resp, ex, ctx) =>
                HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.Accepted, resp, null /* retVal */, cmd, ex);

            requestOptions.ApplyToStorageCommand(retCmd);
            return retCmd;
        }
开发者ID:DaC24,项目名称:azure-storage-net,代码行数:25,代码来源:CloudTableClient.cs

示例2: SetServicePropertiesImpl

        private RESTCommand<NullType> SetServicePropertiesImpl(ServiceProperties properties, BlobRequestOptions requestOptions)
        {
            MemoryStream str = new MemoryStream();
            try
            {
                properties.WriteServiceProperties(str);
            }
            catch (InvalidOperationException invalidOpException)
            {
                throw new ArgumentException(invalidOpException.Message, "properties");
            }

            str.Seek(0, SeekOrigin.Begin);

            RESTCommand<NullType> retCmd = new RESTCommand<NullType>(this.Credentials, this.BaseUri);
            retCmd.SendStream = str;
            retCmd.BuildRequestDelegate = BlobHttpWebRequestFactory.SetServiceProperties;
            retCmd.RecoveryAction = RecoveryActions.RewindStream;
            retCmd.SignRequest = this.AuthenticationHandler.SignRequest;
            retCmd.PreProcessResponse =
                (cmd, resp, ex, ctx) =>
                HttpResponseParsers.ProcessExpectedStatusCodeNoException(System.Net.HttpStatusCode.Accepted, resp, NullType.Value, cmd, ex, ctx);
            retCmd.ApplyRequestOptions(requestOptions);
            return retCmd;
        }
开发者ID:jdkillian,项目名称:azure-sdk-for-net,代码行数:25,代码来源:CloudBlobClient.cs

示例3: SetServicePropertiesImpl

        private RESTCommand<NullType> SetServicePropertiesImpl(ServiceProperties properties, BlobRequestOptions requestOptions)
        {
            MemoryStream memoryStream = new MemoryStream();
            try
            {
                properties.WriteServiceProperties(memoryStream);
            }
            catch (InvalidOperationException invalidOpException)
            {
                throw new ArgumentException(invalidOpException.Message, "properties");
            }

            RESTCommand<NullType> retCmd = new RESTCommand<NullType>(this.Credentials, this.BaseUri);
            retCmd.ApplyRequestOptions(requestOptions);
            retCmd.BuildRequest = (cmd, cnt, ctx) => BlobHttpRequestMessageFactory.SetServiceProperties(cmd.Uri, cmd.ServerTimeoutInSeconds, cnt, ctx);
            retCmd.BuildContent = (cmd, ctx) => HttpContentFactory.BuildContentFromStream(memoryStream, 0, memoryStream.Length, null /* md5 */, cmd, ctx);
            retCmd.RetrieveResponseStream = true;
            retCmd.Handler = this.AuthenticationHandler;
            retCmd.BuildClient = HttpClientFactory.BuildHttpClient;
            retCmd.PreProcessResponse =
                (cmd, resp, ex, ctx) =>
                HttpResponseParsers.ProcessExpectedStatusCodeNoException(System.Net.HttpStatusCode.Accepted, resp, null /* retVal */, cmd, ex, ctx);
            retCmd.ApplyRequestOptions(requestOptions);
            return retCmd;
        }
开发者ID:jdkillian,项目名称:azure-sdk-for-net,代码行数:25,代码来源:CloudBlobClient.cs

示例4: WriteServiceProperties

        /// <summary>
        /// Writes Queue service properties to a stream, formatted in XML.
        /// </summary>
        /// <param name="properties">A <see cref="ServiceProperties"/> object.</param>
        /// <param name="outputStream">The <see cref="System.IO.Stream"/> object to which the formatted properties are to be written.</param>
        public static void WriteServiceProperties(ServiceProperties properties, Stream outputStream)
        {
            CommonUtility.AssertNotNull("properties", properties);

            properties.WriteServiceProperties(outputStream);
        }
开发者ID:jianghaolu,项目名称:azure-storage-net,代码行数:11,代码来源:QueueHttpWebRequestFactory.cs

示例5: SetServicePropertiesImpl

        private RESTCommand<NullType> SetServicePropertiesImpl(ServiceProperties properties, QueueRequestOptions requestOptions)
        {
            MultiBufferMemoryStream str = new MultiBufferMemoryStream(null /* bufferManager */, (int)(1 * Constants.KB));
            try
            {
                properties.WriteServiceProperties(str);
            }
            catch (InvalidOperationException invalidOpException)
            {
                str.Dispose();
                throw new ArgumentException(invalidOpException.Message, "properties");
            }

            str.Seek(0, SeekOrigin.Begin);

            RESTCommand<NullType> retCmd = new RESTCommand<NullType>(this.Credentials, this.StorageUri);
            retCmd.SendStream = str;
            retCmd.StreamToDispose = str;
            retCmd.BuildRequestDelegate = QueueHttpWebRequestFactory.SetServiceProperties;
            retCmd.RecoveryAction = RecoveryActions.RewindStream;
            retCmd.SignRequest = this.AuthenticationHandler.SignRequest;
            retCmd.PreProcessResponse =
                (cmd, resp, ex, ctx) =>
                HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.Accepted, resp, NullType.Value, cmd, ex);
            requestOptions.ApplyToStorageCommand(retCmd);
            return retCmd;
        }
开发者ID:pemari-msft,项目名称:azure-storage-net,代码行数:27,代码来源:CloudQueueClient.cs

示例6: WriteServiceProperties

 /// <summary>
 /// Writes service properties to a stream, formatted in XML.
 /// </summary>
 /// <param name="properties">The service properties to format and write to the stream.</param>
 /// <param name="outputStream">The stream to which the formatted properties are to be written.</param>
 public static void WriteServiceProperties(ServiceProperties properties, Stream outputStream)
 {
     properties.WriteServiceProperties(outputStream);
 }
开发者ID:Juliako,项目名称:azure-sdk-for-net,代码行数:9,代码来源:TableHttpWebRequestFactory.cs


注:本文中的Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.WriteServiceProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。