Ejemplo n.º 1
0
        private void UpdateMessages()
        {
            var inSight = false;
            TcoDiagnosticsViewModel MessageHandler = null;

            TcOpen.Inxton.TcoAppDomain.Current.Dispatcher.Invoke(() =>
            {
                if ((MessageHandler != null) && !MessageHandler.AutoUpdate)
                {
                    return;
                }

                inSight = UIElementAccessibilityHelper.IsInSight <Grid>(this.Element, this);
                if (inSight)
                {
                    MessageHandler = this.DataContext as TcoDiagnosticsViewModel;
                }
            });
            bool isAutoUpdate = MessageHandler == null ? false : MessageHandler.AutoUpdate;

            if (inSight && isAutoUpdate)
            {
                MessageHandler?.UpdateMessages();
            }
        }
 private void MessageUpdateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     TcOpen.Inxton.TcoAppDomain.Current.Dispatcher.Invoke(() => {
         if (UIElementAccessibilityHelper.IsInSight <Grid>(this.Element, this))
         {
             MessageHandler?.UpdateHealthInfo();
         }
     });
 }
Ejemplo n.º 3
0
        private void MessageUpdateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            var isInSight = false;
            TcoObjectMessageHandler MessageHandler = null;

            TcOpen.Inxton.TcoAppDomain.Current.Dispatcher.Invoke(() =>
            {
                isInSight      = UIElementAccessibilityHelper.IsInSight <Grid>(this.Element, this);
                MessageHandler = this.DataContext as TcoObjectMessageHandler;
            });

            if (isInSight)
            {
                MessageHandler?.UpdateHealthInfo();
            }
        }