Exemple #1
0
        public static void ShowMonitorView()
        {
            lock (SyncRoot)
            {
                if (!_hasRegisteredEvents)
                {
                    RegisterEvents();
                }

                if (_monitorView == null)
                {
                    Console.WriteLine("monitor view is null, go create a new one.\r\n");

                    _monitorView = new MonitorView();
                    _monitorView.Show();
                }
                else if (_monitorView.IsLoaded)
                {
                    Console.WriteLine("monitor view exists, clear it up and go create a new one.\r\n");

                    _monitorView.Close();
                    _monitorView = null;
                    _monitorView = new MonitorView();
                    _monitorView.Show();
                }
                else
                {
                    Console.WriteLine("monitor view is closed, go create a new one.\r\n");

                    _monitorView = null;
                    _monitorView = new MonitorView();
                    _monitorView.Show();
                }
            }
        }
Exemple #2
0
        private void MonitorView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            int count = monitorContainer.Children.Count;

            monitorContainer.Children.RemoveRange(0, count);
            _monitorView = null;
        }
 private void btnOpenMonitorView_Click(object sender, RoutedEventArgs e)
 {
     MonitorView.ShowMonitorView();
 }