private void ControlSendClicked(object sender, SledTtyGui.SendClickedEventArgs e) { if (e.Plugin == null) { // Don't clear the user entered text e.ClearText = false; // Show error message MessageBox.Show( Localization.SledTTYErrorInvalidLanguage, Localization.SledTTYErrorTitle, MessageBoxButtons.OK); return; } Write(new SledTtyMessage(SledMessageType.Info, e.Text)); m_bShouldFlush = true; m_debugService.SendScmp(new DevCmd(e.Plugin.LanguageId, e.Text)); }
public SledTtyService( MainForm mainForm, ICommandService commandService, ISettingsService settingsService, IControlHostService controlHostService) { m_mainForm = mainForm; m_commandService = commandService; m_lastFlush = DateTime.Now; // Create GUI m_control = new SledTtyGui { Name = "TTY", ColumnNames = new[] { "Time", "Data" } }; m_control.SendClicked += ControlSendClicked; // Register menu commandService.RegisterMenu( Menu.Tty, Localization.SledTTY, Localization.SledTTYOptions); // Register command to bring up TTY filters commandService.RegisterCommand( Command.Filter, Menu.Tty, CommandGroup.Tty, Localization.SledTTYFilterTTYOutput, Localization.SledTTYFilterTTYOutputComment, Keys.None, null, CommandVisibility.Menu, this); // Register clear TTY window command commandService.RegisterCommand( Command.Clear, Menu.Tty, CommandGroup.Tty, Localization.SledTTYClearTTYWindow, Localization.SledTTYClearTTYWindowComment, Keys.None, null, CommandVisibility.Menu, this); // Save the TTY filter list settingsService.RegisterSettings( this, new BoundPropertyDescriptor( this, () => TtyFilters, Resources.Resource.TTYFilterListTitle, Resources.Resource.TTY, Resources.Resource.TTYFilterListComment)); // Save GUI settings settingsService.RegisterSettings( this, new BoundPropertyDescriptor( this, () => GuiSettings, "Tty GUI Settings", Resources.Resource.TTY, "Tty GUI settings")); }
public SledTtyService( MainForm mainForm, ICommandService commandService, ISettingsService settingsService, IControlHostService controlHostService) { m_mainForm = mainForm; m_commandService = commandService; m_lastFlush = DateTime.Now; // Create GUI m_control = new SledTtyGui { Name = "TTY", ColumnNames = new[] {"Time", "Data"} }; m_control.SendClicked += ControlSendClicked; // Register menu commandService.RegisterMenu( Menu.Tty, Localization.SledTTY, Localization.SledTTYOptions); // Register command to bring up TTY filters commandService.RegisterCommand( Command.Filter, Menu.Tty, CommandGroup.Tty, Localization.SledTTYFilterTTYOutput, Localization.SledTTYFilterTTYOutputComment, Keys.None, null, CommandVisibility.Menu, this); // Register clear TTY window command commandService.RegisterCommand( Command.Clear, Menu.Tty, CommandGroup.Tty, Localization.SledTTYClearTTYWindow, Localization.SledTTYClearTTYWindowComment, Keys.None, null, CommandVisibility.Menu, this); // Save the TTY filter list settingsService.RegisterSettings( this, new BoundPropertyDescriptor( this, () => TtyFilters, Resources.Resource.TTYFilterListTitle, Resources.Resource.TTY, Resources.Resource.TTYFilterListComment)); // Save GUI settings settingsService.RegisterSettings( this, new BoundPropertyDescriptor( this, () => GuiSettings, "Tty GUI Settings", Resources.Resource.TTY, "Tty GUI settings")); }