private void RunCommand(YnoteCommand c) { try { foreach (var command in Commands) { if (command.Key == c.Key) { command.ProcessCommand(c.Value, Globals.Ynote); } } if (c.Key == "SetSyntax" || c.Key == "SetSyntaxFile") { LangMenu.Text = c.Value; } completemenu.Items = null; if (!IsDisposed) { Close(); } } catch { MessageBox.Show("Error Running Command!"); if (!IsDisposed) { Close(); } } }
private void RunCommand(YnoteCommand c) { try { foreach (var command in Globals.Commands) { if (command.Key == c.Key) { command.ProcessCommand(c.Value, Globals.Ynote); break; } } if (c.Key == "SetSyntax") { LangMenu.Text = c.Value; } } catch (Exception ex) { MessageBox.Show("Error Running Command!\n" + ex.Message); } completemenu.Items = null; if (!IsDisposed) { Close(); } }
private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { RunCommand(YnoteCommand.FromString(tbcommand.Text)); } else if (e.KeyCode == Keys.Escape) { completemenu.Items = null; Close(); } }
public static void RunCommand(IYnote ynote, string commandstr) { var command = YnoteCommand.FromString(commandstr); if (Commands == null) { ReloadCommands(); } foreach (var cmd in Commands) { if (cmd.Key == command.Key) { cmd.ProcessCommand(command.Value, ynote); break; } } }
internal static IDictionary <string, string> GenerateDictionary(string manifest) { IDictionary <string, string> dic = new Dictionary <string, string>(); var lines = File.ReadAllLines(manifest); foreach (var line in lines) { var command = YnoteCommand.FromString(line); command.Value = command.Value.Replace("$ynotedata", GlobalSettings.SettingsDir); if (command.Value.IndexOf("$ynotedir") != -1) { command.Value = command.Value.Replace("$ynotedir", Application.StartupPath); } dic.Add(command.Key, command.Value); } return(dic); }
internal static IDictionary <string, string> GenerateDictionary(string manifest) { IDictionary <string, string> dic = new Dictionary <string, string>(); var lines = File.ReadAllLines(manifest); foreach ( var command in lines.Select( line => YnoteCommand.FromString(line.Replace("$ynotedata", GlobalSettings.SettingsDir) .Replace("$ynotedir", Application.StartupPath)))) { dic.Add(command.Key, command.Value); } //foreach (var line in lines) //{ // var command = Parse(line.Replace("$ynotedir", Application.StartupPath)); // dic.Add(command.Key, command.Value); //} return(dic); }
private void RunCommand(YnoteCommand c) { try { foreach (var command in Globals.Commands) { if (command.Key == c.Key) { command.ProcessCommand(c.Value, Globals.Ynote); break; } } if (c.Key == "SetSyntax") LangMenu.Text = c.Value; } catch (Exception ex) { MessageBox.Show("Error Running Command!\n" + ex.Message); } completemenu.Items = null; if (!IsDisposed) Close(); }