private AnalyzerTreeView() { this.ShowRoot = false; this.Root = new AnalyzerTreeNode { Language = MainWindow.Instance.CurrentLanguage }; ContextMenuProvider.Add(this); }
public static ContextMenuProvider Add(HexBox hexBox) { var provider = new ContextMenuProvider(hexBox); hexBox.ContextMenuOpening += provider.hexBox_ContextMenuOpening; hexBox.ContextMenu = new ContextMenu(); return(provider); }
/// <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(); }
public static ContextMenuProvider Add(TabControl tabControl) { var provider = new ContextMenuProvider(tabControl); tabControl.ContextMenuOpening += provider.tabControl_ContextMenuOpening; tabControl.ContextMenu = new ContextMenu(); return(provider); }
public static ContextMenuProvider Add(ListBox listBox) { var provider = new ContextMenuProvider(listBox); listBox.ContextMenuOpening += provider.listBox_ContextMenuOpening; listBox.ContextMenu = new ContextMenu(); return(provider); }
private AnalyzerTreeView() { this.ShowRoot = false; this.Root = new AnalyzerRootNode { Language = MainWindow.Instance.CurrentLanguage }; ContextMenuProvider.Add(this); MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged; }
/// <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); }
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; }
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(); }
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; }
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; } }
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; }
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); }
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; }
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; }
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; }
/// <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; }
public static void Add(ListBox listBox) { var provider = new ContextMenuProvider(listBox); listBox.ContextMenuOpening += provider.listBox_ContextMenuOpening; listBox.ContextMenu = new ContextMenu(); }