public void SaveInfoToFile(FileFormatForm i_FileFormatForm) { using (Stream stream = File.Open(this.FileName, FileMode.CreateNew)) using (StreamWriter streamWriter = new StreamWriter(stream)) { string formatString = i_FileFormatForm.ChosenFileFormat.ToString(); streamWriter.Write(formatString); streamWriter.Write(this.SaveToFileString); } }
private void buttonSave_Click(object sender, EventArgs e) { FileFormatForm fileFormat = new FileFormatForm(FacebookAppFacade.m_LoggedInUserProxy); fileFormat.ShowDialog(); FacebookAppFacade.m_LoggedInUserProxy.SaveToFileString = this.textBoxToFile.Text; if (this.saveFileDialog1.ShowDialog() == DialogResult.OK) { FacebookAppFacade.m_LoggedInUserProxy.FileName = this.saveFileDialog1.FileName; FacebookAppFacade.m_LoggedInUserProxy.SaveInfoToFile(fileFormat); } }