예제 #1
0
        public void Run()
        {
            Debug.Assert(DataExchange != null && Helper != null && Launcher != null);

            //chatLocal.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 0xDD, 0xDD, 0xDD));
            //chatGlobal.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 0xDD, 0xDD, 0xDD));
            globalChatMode.IsChecked = true;

            //speedPanelGrid.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 0xDD, 0xDD, 0xDD));

            textShadow.Color       = System.Windows.Media.Color.FromRgb(255, 255, 255);
            textShadow.Direction   = 320;
            textShadow.ShadowDepth = 0.5;
            textShadow.Opacity     = 1.0;
            textShadow.BlurRadius  = 2.0;
            textShadow.Freeze(); //possibly fix memory leak

            var updateTimer = new Timer(500);

            updateTimer.Elapsed += (a, b) => { try { Dispatcher.Invoke(() => DataExchange.CreateUpdate()); } catch (TaskCanceledException) { } };
            updateTimer.Start();

            speedLabelTimer           = new System.Timers.Timer(1000);
            speedLabelTimer.AutoReset = true;
            speedLabelTimer.Elapsed  += (a, b) => { try { Dispatcher.Invoke(RecalculateSpeedLabels); } catch (TaskCanceledException) { } };
            speedLabelTimer.Start();

            ignoreEvents = true;
            if (canvasId.Text.Length == 0)
            {
                canvasId.Text = "7";
            }
            ignoreEvents = false;

            DataExchange.UpdateGeneralSettingsFromGUI();
        }