本文整理匯總了C#中XenAdmin.Actions.AsyncAction.RunExternal方法的典型用法代碼示例。如果您正苦於以下問題:C# AsyncAction.RunExternal方法的具體用法?C# AsyncAction.RunExternal怎麽用?C# AsyncAction.RunExternal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XenAdmin.Actions.AsyncAction
的用法示例。
在下文中一共展示了AsyncAction.RunExternal方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExtractApiCallList
private List<string> ExtractApiCallList(AsyncAction myAction)
{
RbacMethodList rbacMethods = new RbacMethodList();
RbacCollectorProxy.GetProxy(rbacMethods);
Session session = new Session(RbacCollectorProxy.GetProxy(rbacMethods), myAction.Connection);
myAction.RunExternal(session);
return rbacMethods.ConvertAll(c => c.Method.ToLower().Replace('.', '_').Replace("async_", ""));
}
示例2: EnqueueAction
void EnqueueAction(AsyncAction action, ProduceConsumerQueue queue, List<Exception> exceptions)
{
action.Completed += action_Completed;
queue.EnqueueItem(
() =>
{
if (Cancelling) // don't start any more actions
return;
try
{
action.RunExternal(action.Session);
}
catch (Exception e)
{
Failure f = e as Failure;
if (f != null && Connection != null &&
f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
{
Failure.ParseRBACFailure(f, action.Connection, action.Session ?? action.Connection.Session);
}
exceptions.Add(e);
// Record the first exception we come to. Though later if there are more than one we will replace this with non specific one.
if (Exception == null)
Exception = e;
}
});
}