/// <summary> /// Opens an assembly info file and puts it into a myFile /// </summary> /// <param name="filename">Path to a folder containing an assembly info file</param> /// <returns>Returns a myFile with the contents of the assembly info file</returns> public myFile openAssemblyInfo(string filename) { myFile info = new myFile(); info.setFilename(filename); string path = filename + "\\properties\\AssemblyInfo.cs"; if (File.Exists(path)) { foreach (string line in File.ReadLines(filename + "\\properties\\AssemblyInfo.cs", Encoding.UTF8)) { info.add(line); } } return(info); }
/// <summary> /// Opens a json file and puts the contents into a myFile /// </summary> /// <param name="filename">A path that contains a manifest.json file</param> /// <returns>Returns a myFile that contains the contents and the corresponding path</returns> public myFile openJSON(string filename) { myFile json = new myFile(); json.setFilename(filename); try { foreach (string line in File.ReadLines(filename + "\\manifest.json", Encoding.UTF8)) { json.add(line); } } catch (System.IO.FileNotFoundException) { Console.WriteLine(); } return(json); }