當前位置: 首頁>>代碼示例>>C#>>正文


C# AsyncAction.RunExternal方法代碼示例

本文整理匯總了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_", ""));
 }
開發者ID:ChrisH4rding,項目名稱:xenadmin,代碼行數:8,代碼來源:TestAPICallVersions.cs

示例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;
             }
         });
 }
開發者ID:ushamandya,項目名稱:xenadmin,代碼行數:27,代碼來源:ParallelAction.cs


注:本文中的XenAdmin.Actions.AsyncAction.RunExternal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。