private void btn_SaveSettings_Click(object sender, EventArgs e) { List <string> tempdata = new List <string>(); if (Grid_FoldersData.Rows.Count > 0 && (targetfolder_address != null || targetfolder_address != string.Empty || string.IsNullOrEmpty(targetfolder_address)) && targetfolder_address != " ") { foreach (DataGridViewRow item in Grid_FoldersData.Rows) { tempdata.Add(item.Cells["txtAddress"].Value.ToString()); } GetFiles_Data.dest_AddressFolder = null; GetFiles_Data.dest_AddressFolder = targetfolder_address; GetFiles_Data.SaveDataGridViewData(tempdata); } else { MessageBox.Show("Please fill all needed information (Example: Source Folder Address, Destination folder ... You Should Click on Strat Button for copying files for once (maybe it is your issue)... \nThanks :)", "FILL FIELDS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } tempdata.Clear(); }
private void btn_ImportSettings_Click(object sender, EventArgs e) { if (System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\CSVSettings.db")) { if (GetFiles_Data.DeSerializationProc() == true) { Grid_FoldersData.Rows.Clear(); int indexs = 0; Grid_FoldersData.DataSource = null; foreach (string item in GetFiles_Data.GridData) { Grid_FoldersData.Rows.Add(indexs++, item); } Grid_FoldersData.Refresh(); targetfolder_address = GetFiles_Data.dest_AddressFolder; btn_StartTimer.PerformClick(); System.IO.File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\CSVSettings.dbDECTEST"); } } else { MessageBox.Show("There is not any exported settings to import it...!!!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } }