public mainWindow(string[] args) { preferences = new Preferences(); webServiceTabControls = new Dictionary<int,List<webServiceTab>>(); InitializeComponent(); // closing = false; makeNewPhraseTab(args); tBoxSearchTerms.Text = string.Join<string>(" ", args); //timer = new System.Threading.Timer(checkForNewPhrase, null, 20000, 20000); // tabControlPhrases.Appearance = TabAppearance.FlatButtons; }
public SettingsForm(Preferences preferences_) { // changedSettings = new Dictionary<string,settings>(); preferences = preferences_; InitializeComponent(); int index; //will pass in preferences colleciton foreach (Preference preference in preferences.preferenceList) { index = dgvChooseSettings.Rows.Add(preference.ServiceName); // dgvChooseSettings.Rows[index].Height = 30; dgvChooseSettings.Columns[0].DefaultCellStyle.Font = new Font(dgvChooseSettings.DefaultCellStyle.Font, FontStyle.Bold); dgvChooseSettings.Rows[index].Cells["webService"].Value = preference.ServiceName; DataGridViewComboBoxCell cell = dgvChooseSettings.Rows[index].Cells["options"] as DataGridViewComboBoxCell; cell.Items.Add("Default"); cell.Items.Add("Always Display"); cell.Items.Add("Never Display"); if(preference.Setting == settings.alwaysDisplay) { cell.Value = cell.Items[1]; // dgvChooseSettings.Rows[index].Cells["alwaysDisplayS"].Value = true; //dgvChooseSettings.Rows[index].Cells["alwaysDisplayS"].ReadOnly = true; } else if(preference.Setting == settings.neverDisplay) { cell.Value = cell.Items[2]; //dgvChooseSettings.Rows[index].Cells["neverDisplayS"].Value = true; //dgvChooseSettings.Rows[index].Cells["neverDisplayS"].ReadOnly = true; } else { cell.Value = cell.Items[0]; //dgvChooseSettings.Rows[index].Cells["defaultS"].Value = true; //dgvChooseSettings.Rows[index].Cells["defaultS"].ReadOnly = true; } index = dgvChooseSettings.Rows.Add(); dgvChooseSettings.Rows[index].Cells[1] = new DataGridViewTextBoxCell(); dgvChooseSettings.Rows[index].Height = 6; } }