Exemplo n.º 1
0
        /// <summary>
        /// Runs a given action on the UI thread
        /// </summary>
        /// <param name="action">The action to run on the UI thread</param>
        private void RunActionOnUiThread(Action action)
        {
            if (action == null)
            {
                return;
            }

            if (SourceControl.InvokeRequired)
            {
                SourceControl.Invoke(action);
            }
            else
            {
                action.Invoke();
            }
        }