本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient.GetServicePropertiesAsync方法的典型用法代码示例。如果您正苦于以下问题:C# CloudQueueClient.GetServicePropertiesAsync方法的具体用法?C# CloudQueueClient.GetServicePropertiesAsync怎么用?C# CloudQueueClient.GetServicePropertiesAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient
的用法示例。
在下文中一共展示了CloudQueueClient.GetServicePropertiesAsync方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyClassInitialize
public static void MyClassInitialize(TestContext testContext)
{
client = GenerateCloudQueueClient();
startProperties = client.GetServicePropertiesAsync().AsTask().Result;
}
示例2: TestCorsRulesAsync
private async Task TestCorsRulesAsync(CloudQueueClient client, OperationContext context, IList<CorsRule> corsProps)
{
props.Cors.CorsRules.Clear();
foreach (CorsRule rule in corsProps)
{
props.Cors.CorsRules.Add(rule);
}
await client.SetServicePropertiesAsync(props, null, context);
TestHelper.AssertServicePropertiesAreEqual(props, await client.GetServicePropertiesAsync());
}
示例3: CorsSample
/// <summary>
/// Query the Cross-Origin Resource Sharing (CORS) rules for the Queue service
/// </summary>
/// <param name="queueClient"></param>
private static async Task CorsSample(CloudQueueClient queueClient)
{
Console.WriteLine();
// Get service properties
Console.WriteLine("Get service properties");
ServiceProperties originalProperties = await queueClient.GetServicePropertiesAsync();
try
{
// Add CORS rule
Console.WriteLine("Add CORS rule");
CorsRule corsRule = new CorsRule
{
AllowedHeaders = new List<string> {"*"},
AllowedMethods = CorsHttpMethods.Get,
AllowedOrigins = new List<string> {"*"},
ExposedHeaders = new List<string> {"*"},
MaxAgeInSeconds = 3600
};
ServiceProperties serviceProperties = await queueClient.GetServicePropertiesAsync();
serviceProperties.Cors.CorsRules.Add(corsRule);
await queueClient.SetServicePropertiesAsync(serviceProperties);
}
finally
{
// Revert back to original service properties
Console.WriteLine("Revert back to original service properties");
await queueClient.SetServicePropertiesAsync(originalProperties);
}
Console.WriteLine();
}
示例4: MyClassInitialize
public static async Task MyClassInitialize(TestContext testContext)
{
client = GenerateCloudQueueClient();
startProperties = await client.GetServicePropertiesAsync();
}
示例5: ServicePropertiesSample
/// <summary>
/// Manage the properties of the Queue service.
/// </summary>
/// <param name="queueClient"></param>
private static async Task ServicePropertiesSample(CloudQueueClient queueClient)
{
Console.WriteLine();
// Get service properties
Console.WriteLine("Get service properties");
ServiceProperties originalProperties = await queueClient.GetServicePropertiesAsync();
try
{
// Set service properties
Console.WriteLine("Set service properties");
ServiceProperties props = await queueClient.GetServicePropertiesAsync();
props.Logging.LoggingOperations = LoggingOperations.Read | LoggingOperations.Write;
props.Logging.RetentionDays = 5;
props.Logging.Version = Constants.AnalyticsConstants.LoggingVersionV1;
props.HourMetrics.MetricsLevel = MetricsLevel.Service;
props.HourMetrics.RetentionDays = 6;
props.HourMetrics.Version = Constants.AnalyticsConstants.MetricsVersionV1;
props.MinuteMetrics.MetricsLevel = MetricsLevel.Service;
props.MinuteMetrics.RetentionDays = 6;
props.MinuteMetrics.Version = Constants.AnalyticsConstants.MetricsVersionV1;
await queueClient.SetServicePropertiesAsync(props);
}
finally
{
// Revert back to original service properties
Console.WriteLine("Revert back to original service properties");
await queueClient.SetServicePropertiesAsync(originalProperties);
}
Console.WriteLine();
}