コード例 #1
0
ファイル: TneApplication.cs プロジェクト: tnelab/TMiniblink
 static void WatchMsg()
 {
     NativeMethods.MSG msg = new NativeMethods.MSG();
     while (NativeMethods.GetMessage(ref msg, IntPtr.Zero, 0, 0))
     {
         lock (uiInvokeListLock_)
         {
             if (uiInvokeList_.Count > 0)
             {
                 foreach (var action in uiInvokeList_)
                 {
                     action();
                 }
                 uiInvokeList_.Clear();
             }
         }
         NativeMethods.TranslateMessage(ref msg);
         NativeMethods.DispatchMessage(ref msg);
     }
 }
コード例 #2
0
ファイル: TneApplication.cs プロジェクト: tnelab/TMiniblink
 public static void DoEvent()
 {
     if (IsMainTask())
     {
         lock (uiInvokeListLock_)
         {
             if (uiInvokeList_.Count > 0)
             {
                 foreach (var action in uiInvokeList_)
                 {
                     action();
                 }
                 uiInvokeList_.Clear();
             }
         }
     }
     UIInvoke(() => {
         NativeMethods.MSG msg = new NativeMethods.MSG();
         NativeMethods.GetMessage(ref msg, IntPtr.Zero, 0, 0);
         NativeMethods.TranslateMessage(ref msg);
         NativeMethods.DispatchMessage(ref msg);
     });
 }