示例#1
0
文件: MainForm.cs 项目: r3c/menora
        private void UpdateTimerTick(object sender, EventArgs e)
        {
            int temperature;

            switch (Process.GetRule(this.rules, Process.GetProcesses()))
            {
            case Rule.Apply:
                temperature = Point.TemperatureAt(this.points.Values, (int)DateTime.Now.TimeOfDay.TotalMinutes);

                Gamma.ApplyGamma(temperature);

                this.modeConfigValue.Text = string.Format(CultureInfo.InvariantCulture, "{0}K (apply)", temperature);

                break;

            case Rule.Reset:
                Gamma.ApplyGamma(Point.DefaultTemperature);

                this.modeConfigValue.Text = string.Format(CultureInfo.InvariantCulture, "{0}K (reset)", Point.DefaultTemperature);

                break;

            default:
                this.modeConfigValue.Text = "(pause)";

                break;
            }
        }
示例#2
0
文件: MainForm.cs 项目: r3c/menora
        private void ModeDirectTrackBarValueChanged(object sender, EventArgs e)
        {
            int temperature = this.modeDirectTrackBar.Value;

            Gamma.ApplyGamma(temperature);

            this.modeDirectRadio.Checked = true;
            this.modeDirectValue.Text    = temperature.ToString(CultureInfo.InvariantCulture) + "K";
            this.updateTimer.Enabled     = false;
        }
示例#3
0
文件: MainForm.cs 项目: r3c/menora
        private void ModeTimeTrackBarChanged(object sender, EventArgs e)
        {
            int temperature = Point.TemperatureAt(this.points.Values, this.modeTimeTrackBar.Value);

            Gamma.ApplyGamma(temperature);

            this.modeTimeValue.Text       = string.Format(CultureInfo.InvariantCulture, "{0:00}:{1:00}", this.modeTimeTrackBar.Value / 60, this.modeTimeTrackBar.Value % 60);
            this.modeTimeRadio.Checked    = true;
            this.modeTimeTemperature.Text = temperature.ToString(CultureInfo.InvariantCulture) + "K";
            this.updateTimer.Enabled      = false;
        }
示例#4
0
文件: MainForm.cs 项目: r3c/menora
 private void MainFormClosed(object sender, FormClosedEventArgs e)
 {
     // Restore default temperature on exit
     Gamma.ApplyGamma(Point.DefaultTemperature);
 }