本文整理汇总了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;
}
});
}