예제 #1
0
        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
        {
            switch (e.Type)
            {
            case EventType.Command:
                DataEvent evnt = (DataEvent)e;
                if (evnt.Action == "ResultsPanel.ClearResults")
                {
                    e.Handled = true;
                    this.pluginUI.ClearOutput();
                }
                else if (evnt.Action == "ResultsPanel.ShowResults")
                {
                    e.Handled = true;
                    this.pluginUI.AddLogEntries();
                    this.pluginUI.DisplayOutput();
                }
                break;

            case EventType.ApplySettings:
                this.pluginUI.ApplySettings();
                break;

            case EventType.ProcessStart:
                this.pluginUI.ClearOutput();
                break;

            case EventType.ProcessEnd:
                this.pluginUI.DisplayOutput();
                break;

            case EventType.Trace:
                this.pluginUI.AddLogEntries();
                break;

            case EventType.FileOpen:
                TextEvent fileOpen = (TextEvent)e;
                this.pluginUI.AddSquiggles(fileOpen.Value);
                break;

            case EventType.Keys:
                KeyEvent ke = (KeyEvent)e;
                if (ke.Value == this.NextError)
                {
                    ke.Handled = true;
                    this.pluginUI.NextEntry(null, null);
                }
                else if (ke.Value == this.PrevError)
                {
                    ke.Handled = true;
                    this.pluginUI.PreviousEntry(null, null);
                }
                else if (ke.Value == this.CopyEntry)
                {
                    ke.Handled = pluginUI.CopyTextShortcut();
                }
                else if (ke.Value == this.IgnoreEntry)
                {
                    ke.Handled = pluginUI.IgnoreEntryShortcut();
                }
                break;

            case EventType.Shortcut:
                DataEvent de = (DataEvent)e;
                if (de.Action == "ResultsPanel.ShowNextResult")
                {
                    this.NextError = (Keys)de.Data;
                }
                else if (de.Action == "ResultsPanel.ShowPrevResult")
                {
                    this.PrevError = (Keys)de.Data;
                }
                break;
            }
        }
예제 #2
0
        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
        {
            switch (e.Type)
            {
            case EventType.Command:
                DataEvent evnt = (DataEvent)e;
                if (evnt.Action == "ResultsPanel.ClearResults")
                {
                    e.Handled = true;
                    this.pluginUI.ClearOutput();
                }
                else if (evnt.Action == "ResultsPanel.ShowResults")
                {
                    e.Handled = true;
                    this.pluginUI.AddLogEntries();
                    this.pluginUI.DisplayOutput();
                }
                break;

            case EventType.ApplySettings:
                this.pluginUI.ApplySettings();
                break;

            case EventType.ProcessStart:
                this.pluginUI.ClearOutput();
                break;

            case EventType.ProcessEnd:
                this.pluginUI.DisplayOutput();
                break;

            case EventType.Trace:
                this.pluginUI.AddLogEntries();
                break;

            case EventType.FileOpen:
                TextEvent fileOpen = (TextEvent)e;
                this.pluginUI.AddSquiggles(fileOpen.Value);
                break;

            case EventType.Keys:
                KeyEvent ke = (KeyEvent)e;
                switch (PluginBase.MainForm.GetShortcutItemId(ke.Value))
                {
                case null:
                    break;

                case "ResultsPanel.ShowNextResult":
                    ke.Handled = pluginUI.NextEntry();
                    break;

                case "ResultsPanel.ShowPrevResult":
                    ke.Handled = pluginUI.PreviousEntry();
                    break;

                case "ResultsPanel.ClearResults":
                    ke.Handled = pluginUI.ClearOutput();
                    break;

                case "ResultsPanel.ClearIgnoredEntries":
                    ke.Handled = pluginUI.ClearIgnoredEntries();
                    break;

                default:
                    if (ke.Value == CopyEntryKeys)
                    {
                        ke.Handled = pluginUI.CopyTextShortcut();
                    }
                    else if (ke.Value == IgnoreEntryKeys)
                    {
                        ke.Handled = pluginUI.IgnoreEntryShortcut();
                    }
                    break;
                }

                break;
            }
        }