本文整理汇总了C#中IServiceManagement.GetHostedService方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceManagement.GetHostedService方法的具体用法?C# IServiceManagement.GetHostedService怎么用?C# IServiceManagement.GetHostedService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceManagement
的用法示例。
在下文中一共展示了IServiceManagement.GetHostedService方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformOperation
protected override void PerformOperation(IServiceManagement channel)
{
if (!string.IsNullOrEmpty(HostedServiceName))
{
if (!string.IsNullOrEmpty(ShowDeploymentString))
{
bool result = false;
if (!bool.TryParse(ShowDeploymentString, out result))
{
Console.WriteLine("show-deployments is not a boolean type.");
Console.WriteLine("Getting HostedService");
}
else if (result == true)
{
Console.WriteLine("Getting detailed HostedService");
}
var service = channel.GetHostedServiceWithDetails(SubscriptionId, HostedServiceName, result);
Utility.LogObject(service);
}
else
{
Console.WriteLine("Getting HostedService");
var service = channel.GetHostedService(SubscriptionId, HostedServiceName);
Utility.LogObject(service);
}
}
else if(!string.IsNullOrEmpty(StorageServiceName))
{
Console.WriteLine("Getting StorageService");
var service = channel.GetStorageService(SubscriptionId, StorageServiceName);
Utility.LogObject(service);
}
else if (!string.IsNullOrEmpty(AffinityGroupName))
{
Console.WriteLine("Getting AffinityGroup");
var service = channel.GetAffinityGroup(SubscriptionId, AffinityGroupName);
Utility.LogObject(service);
}
}