本文整理汇总了C#中IOperation.StatusCheck方法的典型用法代码示例。如果您正苦于以下问题:C# IOperation.StatusCheck方法的具体用法?C# IOperation.StatusCheck怎么用?C# IOperation.StatusCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOperation
的用法示例。
在下文中一共展示了IOperation.StatusCheck方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WaitForResultOfRequest
protected void WaitForResultOfRequest(ILog logger, string workerTypeName, IOperation operation, Guid subscriptionId, string certificateThumbprint, string requestId)
{
OperationResult operationResult = new OperationResult();
operationResult.Status = OperationStatus.InProgress;
bool done = false;
while (!done)
{
operationResult = operation.StatusCheck(subscriptionId, certificateThumbprint, requestId);
if (operationResult.Status == OperationStatus.InProgress)
{
string logMessage = string.Format(CultureInfo.CurrentCulture, "{0} '{1}' submitted a deployment request with ID '{2}', the operation was found to be in process, waiting for '{3}' seconds.", workerTypeName, this.Id, requestId, FiveSecondsInMilliseconds / 1000);
logger.Info(logMessage);
Thread.Sleep(FiveSecondsInMilliseconds);
}
else
{
done = true;
}
}
if (operationResult.Status == OperationStatus.Failed)
{
string logMessage = string.Format(CultureInfo.CurrentCulture, "{0} '{1}' submitted a deployment request with ID '{2}' and it failed. The code was '{3}' and message '{4}'.", workerTypeName, this.Id, requestId, operationResult.Code, operationResult.Message);
logger.Error(logMessage);
}
else if (operationResult.Status == OperationStatus.Succeeded)
{
string logMessage = string.Format(CultureInfo.CurrentCulture, "{0} '{1}' submitted a deployment request with ID '{2}' and it succeeded. The code was '{3}' and message '{4}'.", workerTypeName, this.Id, requestId, operationResult.Code, operationResult.Message);
logger.Info(logMessage);
}
}