private void populatePresetView() { lv_presetListView.Columns.Clear(); lv_presetListView.Columns.Add("Saved Presets"); lv_presetListView.Columns[0].Width = lv_presetListView.Width - 4; for (int i = 0; i < mPresetList.Size(); i++) { lv_presetListView.Items.Add(mPresetList[i].Name); // If the number of monitors required is not equal to how many there currently are if (mPresetList[i].MonitorNum != Monitor.AllMonitors.Length) { lv_presetListView.Items[i].BackColor = Color.PaleVioletRed; } } lv_presetListView.Items[0].BackColor = Color.LimeGreen; }
private void setPresetListDefaults() { cb_presetSelection.Items.Clear(); cb_presetSelection.SelectedIndex = -1; for (int i = 0; i < presetList.Size(); i++) { string name = ""; if (presetList[i].MonitorNum < Monitor.AllMonitors.Length) { name += "//Monitor < 1: "; } else if (presetList[i].MonitorNum > Monitor.AllMonitors.Length) { name += "//Monitor > 1: "; } name += presetList[i].Name; cb_presetSelection.Items.Add(name); } }
public mainForm() { InitializeComponent(); Data_Config.SavedConfigs.updateConfigs(); Microsoft.Win32.SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged); Data_Config.Monitor.update(); // Preset Management presetList = new Data_Config.PresetList("presetData.bplist"); presetList.readFromFile(); presetIndex = SavedConfigs.getPresetIndex(presetList.Size()); // sets the default preset setDefaultPreset(); btn_presetRemove.Enabled = false; // Collects the number of radio buttons ( for layout purposes and for collecting data for the ClockForm ) radioList = gb_displayType.Controls.OfType <RadioButton>().ToArray(); // Sets up the Default layout of the mainForm setFormDefaults(); // Initiate the clock form clockForm = new ClockForm(); clockForm.setSecondState(presetList[presetIndex].DisplaySeconds); clockForm.setDeadlineValue(deadlineTimePicker.Value); clockForm.setMinUntilValue((int)minUpDown.Value); deadlineMinUntilValue = Data_Config.SavedConfigs.getDefaultMinDeadline(); clockForm.applyPreset(presetList[presetIndex]); cb_presetSelection.SelectedIndex = presetIndex; cb_alwaysOnTopBtn.Checked = SavedConfigs.getDefaultTopStatus(); setAlwaysOnTopButtonColour(cb_alwaysOnTopBtn.Checked); }