예제 #1
0
 private AnalyzerTreeView()
 {
     this.ShowRoot = false;
     this.Root     = new AnalyzerTreeNode {
         Language = MainWindow.Instance.CurrentLanguage
     };
     ContextMenuProvider.Add(this);
 }
예제 #2
0
        public static ContextMenuProvider Add(HexBox hexBox)
        {
            var provider = new ContextMenuProvider(hexBox);

            hexBox.ContextMenuOpening += provider.hexBox_ContextMenuOpening;
            hexBox.ContextMenu         = new ContextMenu();
            return(provider);
        }
예제 #3
0
		/// <summary>
		/// Enables extensible context menu support for the specified tree view.
		/// </summary>
		public static void Add(SharpTreeView treeView)
		{
			var provider = new ContextMenuProvider(treeView);
			treeView.ContextMenuOpening += 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();
		}
예제 #4
0
        public static ContextMenuProvider Add(TabControl tabControl)
        {
            var provider = new ContextMenuProvider(tabControl);

            tabControl.ContextMenuOpening += provider.tabControl_ContextMenuOpening;
            tabControl.ContextMenu         = new ContextMenu();
            return(provider);
        }
예제 #5
0
        public static ContextMenuProvider Add(ListBox listBox)
        {
            var provider = new ContextMenuProvider(listBox);

            listBox.ContextMenuOpening += provider.listBox_ContextMenuOpening;
            listBox.ContextMenu         = new ContextMenu();
            return(provider);
        }
예제 #6
0
        /// <summary>
        /// Enables extensible context menu support for the specified tree view.
        /// </summary>
        public static void Add(SharpTreeView treeView)
        {
            var provider = new ContextMenuProvider(treeView);

            treeView.ContextMenuOpening += 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();
        }
예제 #7
0
 private AnalyzerTreeView()
 {
     this.ShowRoot = false;
     this.Root     = new AnalyzerRootNode {
         Language = MainWindow.Instance.CurrentLanguage
     };
     ContextMenuProvider.Add(this);
     MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
 }
예제 #8
0
        /// <summary>
        /// Enables extensible context menu support for the specified text view.
        /// </summary>
        public static ContextMenuProvider Add(DecompilerTextView textView)
        {
            var provider = new ContextMenuProvider(textView);

            textView.ContextMenuOpening += 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();
            return(provider);
        }
예제 #9
0
        private SearchPane()
        {
            InitializeComponent();
            searchModeComboBox.Items.Add(new { Image = Images.Class, Name = "Type" });
            searchModeComboBox.Items.Add(new { Image = Images.Property, Name = "Member" });
            searchModeComboBox.Items.Add(new { Image = Images.Literal, Name = "Constant" });
            searchModeComboBox.SelectedIndex = (int)SearchMode.Type;
            ContextMenuProvider.Add(listBox);

            MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
        }
예제 #10
0
파일: TabState.cs 프로젝트: cynecx/dnSpy
        public TabStateDecompile(Language language)
        {
            var view = TextView;

            TabItem.Content = view;
            TabItem.Style   = App.Current.FindResource("TabStateDecompileTabItemStyle") as Style;
            this.language   = language;
            UpdateHeader();
            ContextMenuProvider.Add(view);
            view.DragOver += view_DragOver;
            view.OnThemeUpdated();
        }
예제 #11
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_CurrentAssemblyListChanged;
     MainWindow.Instance.OnModuleModified           += MainWindow_OnModuleModified;
     dntheme.Themes.ThemeChanged += Themes_ThemeChanged;
     Options.DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged += CurrentDisplaySettings_PropertyChanged;
 }
예제 #12
0
        TabManager <TState> CreateTabManager(int insertIndex)
        {
            var tabControl = new TabControl();

            tabControl.Style = App.Current.FindResource("TabStateDecompileTabControl") as Style;
            var tabManager = new TabManager <TState>(this, tabControl, onSelectionChanged, onAddRemoveTabState);

            tabManagers.Insert(insertIndex, tabManager);
            ContextMenuProvider.Add(tabManager.TabControl);
            if (OnTabGroupAdded != null)
            {
                OnTabGroupAdded(this, TabGroupEventArgs.Empty);
            }
            return(tabManager);
        }
        /// <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);

            // Context menu is shown only when the ContextMenu property is not null before the
            // ContextMenuOpening event handler is called.
            treeView.ContextMenu = new ContextMenu();
            treeView.ContextMenu.ContextMenuOpening += provider.treeView_ContextMenuOpening;

            if (textView != null)
            {
                // Context menu is shown only when the ContextMenu property is not null before the
                // ContextMenuOpening event handler is called.
                textView.ContextMenu = new ContextMenu();
                textView.ContextMenu.ContextMenuOpening += provider.textView_ContextMenuOpening;
            }
        }
예제 #14
0
        private SearchPane()
        {
            InitializeComponent();
            searchModeComboBox.Items.Add(new { Image = Images.Library, Name = "Types and Members" });
            searchModeComboBox.Items.Add(new { Image = Images.Class, Name = "Type" });
            searchModeComboBox.Items.Add(new { Image = Images.Property, Name = "Member" });
            searchModeComboBox.Items.Add(new { Image = Images.Method, Name = "Method" });
            searchModeComboBox.Items.Add(new { Image = Images.Field, Name = "Field" });
            searchModeComboBox.Items.Add(new { Image = Images.Property, Name = "Property" });
            searchModeComboBox.Items.Add(new { Image = Images.Event, Name = "Event" });
            searchModeComboBox.Items.Add(new { Image = Images.Literal, Name = "Constant" });
            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;
        }
예제 #15
0
        public MainWindow()
        {
            instance                 = this;
            spySettings              = ILSpySettings.Load();
            this.sessionSettings     = new SessionSettings(spySettings);
            this.assemblyListManager = new AssemblyListManager(spySettings);

            if (Environment.OSVersion.Version.Major >= 6)
            {
                this.Icon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico"));
            }
            else
            {
                this.Icon = Images.AssemblyLoading;
            }

            this.DataContext = sessionSettings;
            this.Left        = sessionSettings.WindowBounds.Left;
            this.Top         = sessionSettings.WindowBounds.Top;
            this.Width       = sessionSettings.WindowBounds.Width;
            this.Height      = sessionSettings.WindowBounds.Height;
            // TODO: validate bounds (maybe a monitor was removed...)
            this.WindowState = sessionSettings.WindowState;

            InitializeComponent();
            App.CompositionContainer.ComposeParts(this);
            Grid.SetRow(decompilerTextView, 1);
            rightPane.Children.Add(decompilerTextView);

            if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1)
            {
                leftColumn.Width  = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star);
                rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star);
            }
            sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged;

            InitMainMenu();
            InitToolbar();
            ContextMenuProvider.Add(treeView);
            ContextMenuProvider.Add(analyzerTree);

            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }
예제 #16
0
        private SearchPane()
        {
            InitializeComponent();
            searchModeComboBox.Items.Add(new { Image = Images.Library, Name = "Types and Members" });
            searchModeComboBox.Items.Add(new { Image = Images.Class, Name = "Type" });
            searchModeComboBox.Items.Add(new { Image = Images.Property, Name = "Member" });
            searchModeComboBox.Items.Add(new { Image = Images.Method, Name = "Method" });
            searchModeComboBox.Items.Add(new { Image = Images.Field, Name = "Field" });
            searchModeComboBox.Items.Add(new { Image = Images.Property, Name = "Property" });
            searchModeComboBox.Items.Add(new { Image = Images.Event, Name = "Event" });
            searchModeComboBox.Items.Add(new { Image = Images.Literal, Name = "Constant" });
            searchModeComboBox.Items.Add(new { Image = Images.Library, Name = "Metadata Token" });

            ContextMenuProvider.Add(listBox);
            MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
            MainWindow.Instance.SessionSettings.FilterSettings.PropertyChanged += FilterSettings_PropertyChanged;
            CompositionTarget.Rendering += UpdateResults;

            // This starts empty search right away, so do at the end (we're still in ctor)
            searchModeComboBox.SelectedIndex = (int)MainWindow.Instance.SessionSettings.SelectedSearchMode;
        }
예제 #17
0
        public MainWindow()
        {
            instance = this;
            var spySettings = ILSpySettings.Load();

            this.spySettingsForMainWindow_Loaded = spySettings;
            this.sessionSettings     = new SessionSettings(spySettings);
            this.assemblyListManager = new AssemblyListManager(spySettings);

            this.Icon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico"));

            this.DataContext = new MainWindowDataContext {
                Workspace       = DockWorkspace.Instance,
                SessionSettings = sessionSettings
            };

            DockWorkspace.Instance.LoadSettings(sessionSettings);

            InitializeComponent();

            XmlLayoutSerializer serializer = new XmlLayoutSerializer(DockManager);

            serializer.LayoutSerializationCallback += DockWorkspace.Instance.LayoutSerializationCallback;
            try {
                sessionSettings.DockLayout.Deserialize(serializer);
            } finally {
                serializer.LayoutSerializationCallback -= DockWorkspace.Instance.LayoutSerializationCallback;
            }

            DockWorkspace.Instance.EnsureUnclosablePanes();

            sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged;

            InitMainMenu();
            InitToolbar();
            ContextMenuProvider.Add(treeView);

            this.Loaded += MainWindow_Loaded;
        }
예제 #18
0
파일: SearchPane.cs 프로젝트: ottrur/dnSpy
        private SearchPane()
        {
            InitializeComponent();
            this.DataContext = this;
            foreach (var type in searchTypes)
            {
                searchModeComboBox.Items.Add(type);
                searchModeToIndex[type.SearchMode] = searchModeComboBox.Items.Count - 1;
            }
            searchModeComboBox.SelectedIndex = searchModeToIndex[SearchMode.TypeDef];
            ContextMenuProvider.Add(listBox);

            MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
            var checkBoxes = new[] { matchWholeWordsCheckBox, caseSensitiveCheckBox, matchAnyWordsCheckBox };

            foreach (var cb in checkBoxes)
            {
                cb.Checked   += (s, e) => RestartSearch();
                cb.Unchecked += (s, e) => RestartSearch();
            }

            dnSpy.dntheme.Themes.ThemeChanged += Themes_ThemeChanged;
            Options.DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged += CurrentDisplaySettings_PropertyChanged;
        }
예제 #19
0
		/// <summary>
		/// Enables extensible context menu support for the specified tree view.
		/// </summary>
		public static void Add(SharpTreeView treeView)
		{
			var provider = new ContextMenuProvider(treeView);
			treeView.ContextMenuOpening += provider.treeView_ContextMenuOpening;
			treeView.ContextMenuClosing -= provider.treeView_ContextMenuClosing;
		}
예제 #20
0
		public static void Add(ListBox listBox)
		{
			var provider = new ContextMenuProvider(listBox);
			listBox.ContextMenuOpening += provider.listBox_ContextMenuOpening;
			listBox.ContextMenu = new ContextMenu();
		}