private void optionsSaveBtn_Click(object sender, EventArgs e) { LinkedList <SettingsCategory> categories = new LinkedList <SettingsCategory>(); // Start blisshive save BlissHiveSettingsCategory blisshiveCategory = new BlissHiveSettingsCategory(); foreach (ListViewItem item in this.optionsBlisshiveAllItemsListView.Items) { blisshiveCategory.itemsList.AddLast(item.Text); } foreach (ListViewItem item in this.optionsBlisshiveBlackListListView.Items) { blisshiveCategory.blackListItems.AddLast(item.Text); } categories.AddLast(blisshiveCategory); // End blisshive save // Start FTP save FTPSettingsCategory ftpCategory = new FTPSettingsCategory(); ftpCategory.ip = this.optionsFTPIPTF.Text; ftpCategory.port = this.optionsFTPPortTF.Text; ftpCategory.username = this.optionsFTPUsernameTF.Text; ftpCategory.password = this.optionsFTPPasswordTF.Text; ftpCategory.rootFolder = this.optionsFTPRootFolderTF.Text; categories.AddLast(ftpCategory); // End FTP save SettingsController.GetInstance().SaveSettingFile(categories, OptionsForm.SettingsFileLocation); this.Close(); }
void OptionsForm_Shown(object sender, EventArgs e) { this.Location = new Point(this.Owner.Location.X + ownerWindowOffset.X, this.Owner.Location.Y + ownerWindowOffset.Y); LinkedList <SettingsCategory> categories = SettingsController.GetInstance().LoadSettingsFile(OptionsForm.SettingsFileLocation); foreach (SettingsCategory category in categories) { if (category is BlissHiveSettingsCategory) { // Load blisshive settings into the interface BlissHiveSettingsCategory blissCategory = (BlissHiveSettingsCategory)category; foreach (String item in blissCategory.itemsList) { this.optionsBlisshiveAllItemsListView.Items.Add(item); } foreach (String item in blissCategory.blackListItems) { this.optionsBlisshiveBlackListListView.Items.Add(item); } } else if (category is FTPSettingsCategory) { FTPSettingsCategory ftpCategory = (FTPSettingsCategory)category; this.optionsFTPIPTF.Text = ftpCategory.ip; this.optionsFTPPortTF.Text = ftpCategory.port; this.optionsFTPUsernameTF.Text = ftpCategory.username; this.optionsFTPPasswordTF.Text = ftpCategory.password; this.optionsFTPRootFolderTF.Text = ftpCategory.rootFolder; } } }
private void optionsSaveBtn_Click(object sender, EventArgs e) { LinkedList<SettingsCategory> categories = new LinkedList<SettingsCategory>(); // Start blisshive save BlissHiveSettingsCategory blisshiveCategory = new BlissHiveSettingsCategory(); foreach (ListViewItem item in this.optionsBlisshiveAllItemsListView.Items) { blisshiveCategory.itemsList.AddLast(item.Text); } foreach (ListViewItem item in this.optionsBlisshiveBlackListListView.Items) { blisshiveCategory.blackListItems.AddLast(item.Text); } categories.AddLast(blisshiveCategory); // End blisshive save // Start FTP save FTPSettingsCategory ftpCategory = new FTPSettingsCategory(); ftpCategory.ip = this.optionsFTPIPTF.Text; ftpCategory.port = this.optionsFTPPortTF.Text; ftpCategory.username = this.optionsFTPUsernameTF.Text; ftpCategory.password = this.optionsFTPPasswordTF.Text; ftpCategory.rootFolder = this.optionsFTPRootFolderTF.Text; categories.AddLast(ftpCategory); // End FTP save SettingsController.GetInstance().SaveSettingFile(categories, OptionsForm.SettingsFileLocation); this.Close(); }