static void EnsureMainThread () { if (!Helper.CheckAccess ()) throw new InvalidOperationException ("Must be called from the main thread"); } }