ArtemisComm.Proxy.UI.SQLLogger.Extensions.UIThreadSetValue C# (CSharp) Method

UIThreadSetValue() private method

private UIThreadSetValue ( this me, DependencyProperty dp, object value ) : void
me this
dp System.Windows.DependencyProperty
value object
return void
        public static void UIThreadSetValue(this DependencyObject me, DependencyProperty dp, object value)
        {
            if (me != null)
            {
                if (Application.Current.Dispatcher != System.Windows.Threading.Dispatcher.CurrentDispatcher)
                {
                    if (!Application.Current.Dispatcher.HasShutdownFinished
                        && !Application.Current.Dispatcher.HasShutdownStarted)
                    {
                        Application.Current.Dispatcher.Invoke(
                            new Action<DependencyProperty, object>(me.SetValue), dp, value);
                    }
                }
                else
                {
                    me.SetValue(dp, value);
                }

            }
        }
    }