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


C# IRequestOptions类代码示例

本文整理汇总了C#中IRequestOptions的典型用法代码示例。如果您正苦于以下问题:C# IRequestOptions类的具体用法?C# IRequestOptions怎么用?C# IRequestOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SetRequestOptions

        internal static void SetRequestOptions(ref SerializableRequestOptions serializer, IRequestOptions requestOptions)
        {
            if (null == serializer && null == requestOptions)
            {
                return;
            }

            if (null == serializer)
            {
                serializer = CreateSerializableRequestOptions(requestOptions);
            }
            else
            {
                if ((requestOptions is FileRequestOptions)
                    && (serializer is SerializableBlobRequestOptions))
                {
                    serializer = new SerializableFileRequestOptions();
                }
                else if ((requestOptions is BlobRequestOptions)
                    && (serializer is SerializableFileRequestOptions))
                {
                    serializer = new SerializableBlobRequestOptions();
                }

                serializer.RequestOptions = requestOptions;
            }
        }
开发者ID:ggais,项目名称:azure-storage-net-data-movement,代码行数:27,代码来源:SerializableRequestOptions.cs

示例2: BaseSpaceClient

        public BaseSpaceClient(IClientSettings settings, IRequestOptions defaultOptions = null)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            Settings = settings;
            WebClient = new JsonWebClient(settings, defaultOptions);
        }
开发者ID:ryanwentzel,项目名称:basespace-csharp-sdk,代码行数:10,代码来源:BaseSpaceClient.cs

示例3: BaseSpaceClient

 public BaseSpaceClient(IClientSettings settings, IWebClient client, IRequestOptions defaultOptions = null)
 {
     if (settings == null || client == null)
     {
         throw new ArgumentNullException("settings");
     }
     ClientSettings = settings;
     WebClient = client;
     SetDefaultRequestOptions(defaultOptions);
 }
开发者ID:patrickbird,项目名称:basespace-csharp-sdk,代码行数:10,代码来源:BaseSpaceClient.cs

示例4: ListVariantsAsync

 public Task<ListVariantsResponse> ListVariantsAsync(ListVariantsRequest request, IRequestOptions options = null)
 {
     return WebClient.SendAsync<ListVariantsResponse>(HttpMethods.GET, request.BuildUrl(ClientSettings.Version), null, options);
 }
开发者ID:patrickbird,项目名称:basespace-csharp-sdk,代码行数:4,代码来源:BaseSpaceClient.cs

示例5: ListSamples

 public ListSamplesResponse ListSamples(ListSamplesRequest request, IRequestOptions options)
 {
     return WebClient.Send<ListSamplesResponse>(HttpMethods.GET, request.BuildUrl(ClientSettings.Version), null, options);
 }
开发者ID:patrickbird,项目名称:basespace-csharp-sdk,代码行数:4,代码来源:BaseSpaceClient.cs

示例6: UpdateAppSession

 public UpdateAppSessionResponse UpdateAppSession(UpdateAppSessionRequest request, IRequestOptions options = null)
 {
     return WebClient.Send(request, options);
 }
开发者ID:ryanwentzel,项目名称:basespace-csharp-sdk,代码行数:4,代码来源:BaseSpaceClient.cs

示例7: FinishOAuthDeviceAuth

 public OAuthDeviceAccessTokenResponse FinishOAuthDeviceAuth(OAuthDeviceAccessTokenRequest request, IRequestOptions options = null)
 {
     try
     {
         return WebClient.Send<OAuthDeviceAccessTokenResponse> (HttpMethods.POST, request.BuildUrl (ClientSettings.Version), request, options);
     }
     catch (BaseSpaceException bex)
     {
         if(bex.InnerException != null && bex.InnerException.GetType() == typeof(WebServiceException))
         {
             var wsex = (WebServiceException)bex.InnerException;
             return wsex.ResponseBody.FromJson<OAuthDeviceAccessTokenResponse>();
         }
     }
     return null;
 }
开发者ID:patrickbird,项目名称:basespace-csharp-sdk,代码行数:16,代码来源:BaseSpaceClient.cs

示例8: CreateAppResult

 public PostAppResultResponse CreateAppResult(PostAppResultRequest request, IRequestOptions options = null)
 {
     return WebClient.Send<PostAppResultResponse>(HttpMethods.POST, request.BuildUrl(ClientSettings.Version), request, options);
 }
开发者ID:patrickbird,项目名称:basespace-csharp-sdk,代码行数:4,代码来源:BaseSpaceClient.cs

示例9: GetStorageServiceProperties

 /// <summary>
 /// Get the service properties
 /// </summary>
 /// <param name="account">Cloud storage account</param>
 /// <param name="type">Service type</param>
 /// <param name="options">Request options</param>
 /// <param name="operationContext">Operation context</param>
 /// <returns>The service properties of the specified service type</returns>
 public ServiceProperties GetStorageServiceProperties(StorageServiceType type, IRequestOptions options, OperationContext operationContext)
 {
     CloudStorageAccount account = StorageContext.StorageAccount;
     switch (type)
     {
         case StorageServiceType.Blob:
             return account.CreateCloudBlobClient().GetServiceProperties((BlobRequestOptions) options, operationContext);
         case StorageServiceType.Queue:
             return account.CreateCloudQueueClient().GetServiceProperties((QueueRequestOptions) options, operationContext);
         case StorageServiceType.Table:
             return account.CreateCloudTableClient().GetServiceProperties((TableRequestOptions) options, operationContext);
         case StorageServiceType.File:
             FileServiceProperties fileServiceProperties = account.CreateCloudFileClient().GetServiceProperties((FileRequestOptions)options, operationContext);
             ServiceProperties sp = new ServiceProperties();
             sp.Clean();
             sp.Cors = fileServiceProperties.Cors;
             return sp;
         default:
             throw new ArgumentException(Resources.InvalidStorageServiceType, "type");
     }
 }
开发者ID:nityasharma,项目名称:azure-powershell,代码行数:29,代码来源:StorageBlobManagement.cs

示例10: SetStorageServiceProperties

        /// <summary>
        /// Set service properties
        /// </summary>
        /// <param name="account">Cloud storage account</param>
        /// <param name="type">Service type</param>
        /// <param name="properties">Service properties</param>
        /// <param name="options">Request options</param>
        /// <param name="operationContext">Operation context</param>
        public void SetStorageServiceProperties(StorageServiceType type, ServiceProperties properties, IRequestOptions options, OperationContext operationContext)
        {
            CloudStorageAccount account = StorageContext.StorageAccount;
            switch (type)
            {
                case StorageServiceType.Blob:
                    account.CreateCloudBlobClient().SetServiceProperties(properties, (BlobRequestOptions)options, operationContext);
                    break;
                case StorageServiceType.Queue:
                    account.CreateCloudQueueClient().SetServiceProperties(properties, (QueueRequestOptions)options, operationContext);
                    break;
                case StorageServiceType.Table:
                    account.CreateCloudTableClient().SetServiceProperties(properties, (TableRequestOptions)options, operationContext);
                    break;
                case StorageServiceType.File:
                    if (null != properties.Logging)
                    {
                        throw new InvalidOperationException(Resources.FileNotSupportLogging);
                    }

                    if (null != properties.HourMetrics || null != properties.MinuteMetrics)
                    {
                        throw new InvalidOperationException(Resources.FileNotSupportMetrics);
                    }

                    FileServiceProperties fileServiceProperties = new FileServiceProperties();
                    fileServiceProperties.Cors = properties.Cors;
                    account.CreateCloudFileClient().SetServiceProperties(fileServiceProperties, (FileRequestOptions)options, operationContext);
                    break;
                default:
                    throw new ArgumentException(Resources.InvalidStorageServiceType, "type");
            }
        }
开发者ID:nityasharma,项目名称:azure-powershell,代码行数:41,代码来源:StorageBlobManagement.cs

示例11: CreateProject

 public CreateProjectResponse CreateProject(CreateProjectRequest request, IRequestOptions options = null)
 {
     return WebClient.Send(request, options);
 }
开发者ID:ryanwentzel,项目名称:basespace-csharp-sdk,代码行数:4,代码来源:BaseSpaceClient.cs

示例12: AssignToRequestOptions

        private static void AssignToRequestOptions(IRequestOptions targetRequestOptions, IRequestOptions customRequestOptions)
        {
            if (null != customRequestOptions.MaximumExecutionTime)
            {
                targetRequestOptions.MaximumExecutionTime = customRequestOptions.MaximumExecutionTime;
            }

            if (null != customRequestOptions.RetryPolicy)
            {
                targetRequestOptions.RetryPolicy = customRequestOptions.RetryPolicy;
            }

            if (null != customRequestOptions.ServerTimeout)
            {
                targetRequestOptions.ServerTimeout = customRequestOptions.ServerTimeout;
            }

            targetRequestOptions.LocationMode = customRequestOptions.LocationMode;
        }
开发者ID:BeauGesteMark,项目名称:azure-storage-net-data-movement,代码行数:19,代码来源:Utils.cs

示例13: CreateAppSessionLogs

 public CreateAppSessionLogsResponse CreateAppSessionLogs(CreateAppSessionLogsRequest request, IRequestOptions options = null)
 {
     return WebClient.Send(request, options);
 }
开发者ID:ryanwentzel,项目名称:basespace-csharp-sdk,代码行数:4,代码来源:BaseSpaceClient.cs

示例14: BeginOAuthDeviceAuth

 public OAuthDeviceAuthResponse BeginOAuthDeviceAuth(OAuthDeviceAuthRequest request, IRequestOptions options = null)
 {
     return WebClient.Send(request, options);
 }
开发者ID:ryanwentzel,项目名称:basespace-csharp-sdk,代码行数:4,代码来源:BaseSpaceClient.cs

示例15: UploadFileToFileSet

 public UploadFileToFileSetResponse UploadFileToFileSet(UploadFileToFileSetRequest request, IRequestOptions options = null)
 {
     var fileUploadClient = new FileUpload(WebClient, Settings, options ?? WebClient.DefaultRequestOptions);
     return fileUploadClient.UploadFile(request);
 }
开发者ID:ryanwentzel,项目名称:basespace-csharp-sdk,代码行数:5,代码来源:BaseSpaceClient.cs


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