/* Loads user defined macros to the collection */ private void loadUserDefinedCollection() { KeyMacro km; if (File.Exists(macroFolderPath)) { using (StreamReader reader = new StreamReader(macroFolderPath)) { while (!reader.EndOfStream) { var readLine = reader.ReadLine(); var tokens = readLine.Split(','); if (tokens.Length > 1) { var macroString = tokens[1].Split('\\'); keyNames.Add(tokens[0]); km = new KeyMacro { macroName = tokens[0], macroString = macroString.ToList() }; MacroKeyBinds.Add(km); } } } } return; }
/* Loads predefined macro list collection */ private void loadPredefinedMacroCollection() { var resourceName = "GuiShellTest.Resources.defaultKeyMacros.csv"; KeyMacro km; using (Stream stream = assembly.GetManifestResourceStream(resourceName)) using (StreamReader reader = new StreamReader(stream)) { while (!reader.EndOfStream) { var readLine = reader.ReadLine(); var tokens = readLine.Split(','); var macroString = tokens[1].Split('\\'); keyNames.Add(tokens[0]); km = new KeyMacro { macroName = tokens[0], macroString = macroString.ToList() }; MacroKeyBinds.Add(km); } } }