Пример #1
0
        private void OpenMembers(object sender, EventArgs e)
        {
            Controls.NavigationBar navBar = GetNavigationBar();
            if (navBar == null || !navBar.Visible)
            {
                return;
            }

            navBar.OpenMembers();
        }
Пример #2
0
        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(object sender, NotifyEvent e, HandlingPriority prority)
        {
            if (e.Type == EventType.FileOpen || e.Type == EventType.FileNew)
            {
                ITabbedDocument document = PluginBase.MainForm.CurrentDocument;
                if (document != null)
                {
                    // Check to see if we've already added an NavigationBar to the
                    // current document.
                    if (document.SciControl == null)
                        return;

                    Controls.NavigationBar bar = GetNavigationBar(document);
                    if (bar != null)
                        return;

                    // Dock a new navigation bar to the top of the current document
                    bar = new Controls.NavigationBar(document, _settings);
                    document.Controls.Add(bar);
                }
            }
            else if (e.Type == EventType.FileSwitch)
            {
                ITabbedDocument document = PluginBase.MainForm.CurrentDocument;
                if (document != null)
                {
                    // Check to see if this document contains a text editor.
                    if (document.SciControl == null)
                        return;

                    // Refresh the navigation bar
                    Controls.NavigationBar bar = GetNavigationBar(document);
                    if (bar != null)
                        bar.RefreshSettings();
                }
            }
            else if (e.Type == EventType.Command)
            {
                DataEvent de = e as DataEvent;

                if (de.Action.StartsWith("ProjectManager."))
                {
                    if (de.Action == ProjectManagerCommands.NewProject)
                        NavigationManager.Instance.Clear();
                    else if (de.Action == ProjectManagerCommands.OpenProject)
                        NavigationManager.Instance.Clear();
                }
            }
            else if (e.Type == EventType.ApplyTheme)
            {
                foreach (var document in PluginBase.MainForm.Documents)
                {
                    if (document.SciControl == null)
                        continue;

                    var bar = GetNavigationBar(document);
                    if (bar != null)
                        bar.ApplyTheme();
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
        {
            if (e.Type == EventType.FileOpen || e.Type == EventType.FileNew)
            {
                ITabbedDocument document = PluginBase.MainForm.CurrentDocument;
                if (document != null)
                {
                    // Check to see if we've already added an NavigationBar to the
                    // current document.
                    if (document.SciControl == null)
                    {
                        return;
                    }

                    Controls.NavigationBar bar = GetNavigationBar(document);
                    if (bar != null)
                    {
                        return;
                    }

                    // Dock a new navigation bar to the top of the current document
                    bar = new Controls.NavigationBar(document, _settings);
                    document.Controls.Add(bar);
                }
            }
            else if (e.Type == EventType.FileSwitch)
            {
                ITabbedDocument document = PluginBase.MainForm.CurrentDocument;
                if (document != null)
                {
                    // Check to see if this document contains a text editor.
                    if (document.SciControl == null)
                    {
                        return;
                    }

                    // Refresh the navigation bar
                    Controls.NavigationBar bar = GetNavigationBar(document);
                    if (bar != null)
                    {
                        bar.RefreshSettings();
                    }
                }
            }
            else if (e.Type == EventType.Command)
            {
                DataEvent de = e as DataEvent;

                if (de.Action.StartsWith("ProjectManager."))
                {
                    if (de.Action == ProjectManagerCommands.NewProject)
                    {
                        NavigationManager.Instance.Clear();
                    }
                    else if (de.Action == ProjectManagerCommands.OpenProject)
                    {
                        NavigationManager.Instance.Clear();
                    }
                }
            }
        }