public static Settings Instance() { if( instance == null ) { instance = new Settings(); } return instance; }
private void SelectCategory(Settings settings) { if (settings.Category != string.Empty) { lstCategories.SelectedIndices.Clear(); for (int i = 0; i < lstCategories.Items.Count; i++) { if (lstCategories.Items[i].Name == settings.Category) { lstCategories.SelectedIndices.Add(i); break; } } } }
private void SelectFilter(Settings settings) { if (settings.Filter != string.Empty) { for (int i = 0; i < cboFilter.Items.Count; i++) { string name = cboFilter.GetItemText(cboFilter.Items[i]); if (name == settings.Filter) { mchkAdvancedCategories.Checked = true; cboFilter.SelectedIndex = i; cboFilter.Text = name; ApplyFilter((Filter)cboFilter.SelectedItem); } } } }
private void SelectAutoCats(Settings settings) { if (settings.AutoCats != null) { List<string> autocats = settings.AutoCats.Split(',').ToList(); foreach (string ac in autocats) { for (int i = 0; i < lvAutoCatType.Items.Count; i++) { if (lvAutoCatType.Items[i].Name == ac) lvAutoCatType.Items[i].Checked = true; } } } }