6 public ManualResetEventSlim
Event;
25 currentActionInfo.
Action();
27 catch (Exception ex) {
28 Log.
Error(
"Dispatched action failed. Reason: {0}", ex);
31 if (currentActionInfo.
Event !=
null) {
32 currentActionInfo.
Event.Set();
38 public static void Dispatch(Action action,
bool waitUntilCompleted =
false) {
40 throw new InvalidOperationException(
"Dispatcher is not initialized.");
46 else if (waitUntilCompleted) {
48 actionInfo.Action = action;
49 actionInfo.Event =
new ManualResetEventSlim(
false);
60 actionInfo =
new ActionInfo { Action = action };
61 actionInfos.Add(actionInfo);
System.Environment Environment
static void Dispatch(Action action, bool waitUntilCompleted=false)
static ? int m_mainThreadId
static void ExecuteActionsOnCurrentThread()
static void BeforeFrame()
static List< ActionInfo > m_actionInfos
static List< ActionInfo > m_currentActionInfos
static void Error(object message)
ManualResetEventSlim Event