コード例 #1
0
 private void EnsureRunningOnMainThread()
 {
     if (!Object.CurrentThreadIsMainThread())
     {
         throw new InvalidOperationException("EnsureRunningOnMainThread can only be called from the main thread");
     }
 }