tools/VsIdeHostAdapter/Framework/UIThreadInvoker.cs
/// <summary>
///     This needs to be called on the UI thread.
///     The control itself does not know about UI thread. How it works is:
///     control.Invoke is called on the same thread where Control was initialized.
/// </summary>
This needs to be called on the UI thread.
The control itself does not know about UI thread. How it works is:
control.Invoke is called on the same thread where Control was initialized.
This needs to be called on the UI thread . The control itself does not know about UI thread . How it works is : control . Invoke is called on the same thread where Control was initialized .
[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "handle")]
        public static void Initialize()
        {
            Trace.WriteLine(
                string.Format(
                    CultureInfo.InvariantCulture,
                    "{0}, pid={1}, tid={2}: UIThreadInvoker.Initialize: Stack trace: {3}",
                    DateTime.Now,
                    Process.GetCurrentProcess().Id,
                    Thread.CurrentThread.ManagedThreadId,
                    Environment.StackTrace));
            if (s_uiThreadControl == null)
            {
                s_uiThreadControl = new Control();
                var handle = s_uiThreadControl.Handle;
            }
        }
[ SuppressMessage ( " " , " " , MessageId = " " ) ] public static void Initialize ( ) { Trace . WriteLine ( string . Format ( CultureInfo . InvariantCulture , " " , DateTime . Now , Process . GetCurrentProcess ( ) . Id , Thread . CurrentThread . ManagedThreadId , Environment . StackTrace ) ) ; if ( s_uiThreadControl == null ) { s_uiThreadControl = new Control ( ) ; var handle = s_uiThreadControl . Handle ; } }
This needs to be called on the UI thread.
This needs to be called on the UI thread .
// Force creating the control's handle needed by Control.Invoke.