Ejemplo n.º 1
0
    private void ShowAdvancedSettings(object sender, EventArgs e)
    {
      Advanced advanced = new Advanced();
      advanced.ProcessPriority = Program.Config.ProcessPriority;
      advanced.HideTrayIcon = Program.Config.HideTrayIcon;

      if (advanced.ShowDialog(this) == DialogResult.OK)
      {
        if (!advanced.ProcessPriority.Equals(Program.Config.ProcessPriority, StringComparison.OrdinalIgnoreCase))
        {
          Program.Config.ProcessPriority = advanced.ProcessPriority;
          Program.AdjustPriority(Program.Config.ProcessPriority);
        }

        Program.Config.HideTrayIcon = advanced.HideTrayIcon;
        Program.TrayIcon.Visible = !Program.Config.HideTrayIcon;
      }
    }
Ejemplo n.º 2
0
        private void ShowAdvancedSettings(object sender, EventArgs e)
        {
            Advanced advanced = new Advanced();
            advanced.ProcessPriority = Program.Config.ProcessPriority;
            advanced.LogVerbosity = Program.Config.LogVerbosity;
            advanced.HideTrayIcon = Program.Config.HideTrayIcon;
            try
            {
                advanced.checkBoxAutoRun.Checked = SystemRegistry.GetAutoRun("Translator");
            }
            catch (Exception ex)
            {
                IrssLog.Error(ex);
                advanced.checkBoxAutoRun.Checked = false;
            }

            if (advanced.ShowDialog(this) == DialogResult.OK)
            {
                Edited = true;

                IrssLog.Info("Log Verbosity Level: " + advanced.LogVerbosity.ToString());
                Program.Config.LogVerbosity = advanced.LogVerbosity;
                IrssLog.LogLevel = (IrssLog.Level)Enum.Parse(typeof(IrssLog.Level), advanced.LogVerbosity);

                if (!advanced.ProcessPriority.Equals(Program.Config.ProcessPriority, StringComparison.OrdinalIgnoreCase))
                {
                    Program.Config.ProcessPriority = advanced.ProcessPriority;
                    Program.AdjustPriority(Program.Config.ProcessPriority);
                }

                Program.Config.HideTrayIcon = advanced.HideTrayIcon;
                Program.TrayIcon.Visible = !Program.Config.HideTrayIcon;

                if (advanced.checkBoxAutoRun.Checked)
                    SystemRegistry.SetAutoRun("Translator", Application.ExecutablePath);
                else
                    SystemRegistry.RemoveAutoRun("Translator");

            }
        }