public static bool TryLoad(string line) { if (!(line.Substring(0, 10) == "write file")) { return(false); } WriteToFileInstruction.Load(line); return(true); }
public static IInstruction Load(string line) { WriteToFileInstruction toFileInstruction = new WriteToFileInstruction("", "", false); List <string> list = new List <string>(); Program.ToWords(line, 'ﻃ', (ICollection <string>)list); toFileInstruction.Contents = list[1].Replace("\\n", "\n"); toFileInstruction.Path = list[2]; toFileInstruction.Variable = bool.Parse(list[3]); return((IInstruction)toFileInstruction); }