public void SetProfileList(string[] ProfileNames, string SelectProfile) { SelectedProfileChangedCauseType SelectedProfileChangedCausePrev = SelectedProfileChangedCause; SelectedProfileChangedCause = SelectedProfileChangedCauseType.Init; // Workaround: Mono's scaling calculation results in wrong size // - placement off for the PVC that already existed (due to designer initialization) // - the new PVC copies are ok that were not selected during init // - the new PVC copies are too small when tab was selected during init // Solution: Overwrite own calculated size again DataGridView1.Width = Width; DataGridView1.Height = Height - DataGridView1.Top; ComboBox1.Items.AddRange(ProfileNames); if (ComboBox1.Items.Count == 0) { SelectProfile = null; pi.ClearSplits(); } if (SelectProfile != null) { this.SelectedProfile = SelectProfile; } SelectedProfileChangedCause = SelectedProfileChangedCausePrev; }
public void RenameProfile(string NameOld, string NameNew) { SelectedProfileChangedCauseType SelectedProfileChangedCausePrev = SelectedProfileChangedCause; SelectedProfileChangedCause = SelectedProfileChangedCauseType.Rename; ComboBox1.Items[ComboBox1.Items.IndexOf(NameOld)] = NameNew; SelectedProfileChangedCause = SelectedProfileChangedCausePrev; }
public void DeleteProfile(string Name) { SelectedProfileChangedCauseType SelectedProfileChangedCausePrev = SelectedProfileChangedCause; SelectedProfileChangedCause = SelectedProfileChangedCauseType.Delete; int idx = ComboBox1.Items.IndexOf(Name); if (idx == ComboBox1.SelectedIndex) { ComboBox1.SelectedItem = null; pi.ClearSplits(); } ComboBox1.Items.RemoveAt(idx); SelectedProfileChangedCause = SelectedProfileChangedCausePrev; }
public void DeleteSelectedProfile() { SelectedProfileChangedCauseType SelectedProfileChangedCausePrev = SelectedProfileChangedCause; SelectedProfileChangedCause = SelectedProfileChangedCauseType.Delete; int idx = ComboBox1.SelectedIndex; ComboBox1.Items.RemoveAt(idx); if (ComboBox1.Items.Count == 0) { ComboBox1.SelectedItem = null; pi.ClearSplits(); } else { ComboBox1.SelectedIndex = (ComboBox1.Items.Count >= idx ? ComboBox1.Items.Count - 1 : idx); } SelectedProfileChangedCause = SelectedProfileChangedCausePrev; }
public void CreateNewProfile(string NameNew, bool Select, bool AsCopy) { SelectedProfileChangedCauseType SelectedProfileChangedCausePrev = SelectedProfileChangedCause; SelectedProfileChangedCause = SelectedProfileChangedCauseType.Create; // Add new profile to the list.. ComboBox1.Items.Add(NameNew); if (Select) { // Select and reset new profile.. pi.ProfileName = NameNew; if (!AsCopy) { pi.ClearSplits(); // Clear profile when it shall not be copied pi.AttemptsCount = 0; // Reset Attempts } SelectedProfile = NameNew; } SelectedProfileChangedCause = SelectedProfileChangedCausePrev; }