private void presetForm_closed(object sender, EventArgs e) { presetList = presetForm.getPresetList(); presetForm.FormClosing -= new FormClosingEventHandler(presetForm_closed); presetForm = null; setPresetListDefaults(); }
public PresetSettingsForm(PresetList presets, int xLocation, int yLocation, int typeOfSize, int size, int radioIndex, AnalogLayout layout, ColourScheme clockColours, bool seconds) { InitializeComponent(); mPresetList = presets; populatePresetView(); x = xLocation; y = yLocation; sizeType = typeOfSize; customSize = size; clockType = radioIndex; analogLayout = layout; digitalColours = clockColours; displaySeconds = seconds; }
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); }