/// <summary> /// Load the list of strings passed into a MiscFile object. /// </summary> /// <param name="lines">The list of strings that contains the text in a file</param> /// <returns>A MiscFile object populated with the strings passed in</returns> public static MiscFile Load(List<String> lines) { MiscFile file = new MiscFile(); foreach (String line in lines) { file.Raw += line + System.Environment.NewLine; } return file; }
private void addFileToolStripMenuItem_Click(object sender, EventArgs e) { // Add file to the selected folder DirectoryInfo directory = modFilesTree.SelectedNode.Tag as DirectoryInfo; String fileName = "New File.txt"; MiscFile file = new MiscFile(); file.BelongsTo = directory.FullName + "/" + fileName; // Write a blank file StreamWriter stream = File.CreateText(file.BelongsTo); stream.Close(); PopulateTreeView(); }