private void saveApiBtn_Click(object sender, RoutedEventArgs e) { NewApi na = new NewApi(sheetNameTxt.Text, pathTxt.Text, sheetIdTxt.Text); SaveToFile(na); MessageBox.Show("Restart DevPlanner to upload your changes"); this.Close(); }
//saving to txt bool SaveToFile(NewApi api) { using (StreamWriter sw = new StreamWriter("api.txt", true)) { sw.WriteLine("{0}|{1}|{2}", api.name, api.path, api.id); sw.Close(); } return(true); }
public void getApi(NewApi api) { SpreadsheetId = api.id; path = api.path; inProgressProjectsList.Clear(); pubProjList.Clear(); accessSheets(); readSheetData(); publicList.ItemsSource = null; publicList.ItemsSource = pubProjList; inProgressList.ItemsSource = null; inProgressList.ItemsSource = inProgressProjectsList; deadlineMessage(); }
void ReadApiData() { using (StreamReader sr = new StreamReader("api.txt")) { string line; while ((line = sr.ReadLine()) != null) { string[] par = line.Split('|'); NewApi na = new NewApi(par[0], par[1], par[2]); if (!apiList.Contains(na)) { apiList.Add(na); } } } }