Exemple #1
0
 private AnalyzerTreeView()
 {
     this.ShowRoot = false;
     this.Root     = new AnalyzerRootNode {
         Language = MainWindow.Instance.CurrentLanguage
     };
     this.BorderThickness = new Thickness(0);
     ContextMenuProvider.Add(this);
     MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
 }
Exemple #2
0
        /// <summary>
        /// Enables extensible context menu support for the specified tree view.
        /// </summary>
        public static void Add(SharpTreeView treeView, DecompilerTextView textView = null)
        {
            var provider = new ContextMenuProvider(treeView, textView);

            treeView.PointerReleased += provider.treeView_ContextMenuOpening;
            // Context menu is shown only when the ContextMenu property is not null before the
            // ContextMenuOpening event handler is called.
            treeView.ContextMenu = new ContextMenu();
            if (textView != null)
            {
                textView.PointerReleased += provider.textView_ContextMenuOpening;
                // Context menu is shown only when the ContextMenu property is not null before the
                // ContextMenuOpening event handler is called.
                textView.ContextMenu = new ContextMenu();
            }
        }
Exemple #3
0
        private SearchPane()
        {
            InitializeComponent();
            var items = new[] {
                (new { Image = Images.Library, Name = "Types and Members" }),
                (new { Image = Images.Class, Name = "Type" }),
                (new { Image = Images.Property, Name = "Member" }),
                (new { Image = Images.Method, Name = "Method" }),
                (new { Image = Images.Field, Name = "Field" }),
                (new { Image = Images.Property, Name = "Property" }),
                (new { Image = Images.Event, Name = "Event" }),
                (new { Image = Images.Literal, Name = "Constant" }),
                (new { Image = Images.Library, Name = "Metadata Token" })
            };

            searchModeComboBox.Items             = items;
            searchModeComboBox.SelectedIndex     = (int)MainWindow.Instance.SessionSettings.SelectedSearchMode;
            searchModeComboBox.SelectionChanged += (sender, e) => MainWindow.Instance.SessionSettings.SelectedSearchMode = (SearchMode)searchModeComboBox.SelectedIndex;
            ContextMenuProvider.Add(listBox);

            MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
        }