Questor.frmMain.tUpdateUI_Tick C# (CSharp) Méthode

tUpdateUI_Tick() private méthode

private tUpdateUI_Tick ( object sender, EventArgs e ) : void
sender object
e EventArgs
Résultat void
        private void tUpdateUI_Tick(object sender, EventArgs e)
        {
            // The if's in here stop the UI from flickering
            var text = "Questor [" + _questor.CharacterName + "]";
            if (Text != text)
                Text = text;

            text = _questor.State.ToString();
            if ((string)QuestorStateComboBox.SelectedItem != text && !QuestorStateComboBox.DroppedDown)
                QuestorStateComboBox.SelectedItem = text;

            text = Cache.Instance.DamageType.ToString();
            if ((string)DamageTypeComboBox.SelectedItem != text && !DamageTypeComboBox.DroppedDown)
                DamageTypeComboBox.SelectedItem = text;

            if (AutoStartCheckBox.Checked != _questor.AutoStart)
            {
                AutoStartCheckBox.Checked = _questor.AutoStart;
                StartButton.Enabled = !_questor.AutoStart;
            }

            if (PauseCheckBox.Checked != _questor.Paused)
                PauseCheckBox.Checked = _questor.Paused;

            if (Disable3DCheckBox.Checked != _questor.Disable3D)
                Disable3DCheckBox.Checked = _questor.Disable3D;

            if (Settings.Instance.WindowXPosition.HasValue)
            {
                Left = Settings.Instance.WindowXPosition.Value;
                Settings.Instance.WindowXPosition = null;
            }

            if (Settings.Instance.WindowYPosition.HasValue)
            {
                Top = Settings.Instance.WindowYPosition.Value;
                Settings.Instance.WindowYPosition = null;
            }

            if (Cache.Instance.ExtConsole != null)
            {
                if (txtExtConsole.Lines.Count() >= Settings.Instance.maxLineConsole)
                    txtExtConsole.Text = "";

                if (Settings.Instance.SaveLog)
                {
                    string Carpeta = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Log\\" + _questor.CharacterName + "\\";
                    string filename = Carpeta + string.Format("{0:ddMMyyyy}", DateTime.Today) + ".log";

                    Directory.CreateDirectory(Carpeta);
                    File.AppendAllText(filename, Cache.Instance.ExtConsole);
                }
                txtExtConsole.AppendText(Cache.Instance.ExtConsole);
                Cache.Instance.ExtConsole = null;
            }
        }