ArtemisComm.Proxy.UI.SQLLogger.Extensions.UIThreadSetValue C# (CSharp) Méthode

UIThreadSetValue() private méthode

private UIThreadSetValue ( this me, DependencyProperty dp, object value ) : void
me this
dp System.Windows.DependencyProperty
value object
Résultat 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);
                }

            }
        }
    }