From b72999543593ce5e35a1cd14fb4a9d8608267cd9 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 23 May 2026 11:17:50 +0200 Subject: [PATCH] Remove WPF ILSpy host (prep for Avalonia rewrite) Strip the WPF ILSpy/, ILSpy.Tests/, and ILSpy.BamlDecompiler/ projects and their solution entries so this commit can serve as the base for replaying the rewritten Avalonia history on top. The BAML plugin needed UseWpf + AvalonEdit and had a ProjectReference to ILSpy/ILSpy.csproj; once both are gone it cannot build and would block bisect for every intermediate commit. The Avalonia main app will absorb its three exports (factory, file handler, entry node) in the later "BAML to XAML decompiler integration" commit. --- .../ICSharpCode.Decompiler.PowerShell.csproj | 4 + ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj | 2 +- .../MermaidDiagrammer/html}/ILSpy.ico | Bin .../ILSpy.BamlDecompiler.Tests.csproj | 2 - ILSpy.BamlDecompiler/BamlResourceEntryNode.cs | 76 - .../BamlResourceNodeFactory.cs | 85 - .../ILSpy.BamlDecompiler.csproj | 35 - .../Properties/AssemblyInfo.cs | 36 - .../Properties/launchSettings.json | 9 - ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs | 66 - .../Analyzers/ExportAnalyzerAttributeTests.cs | 43 - .../MemberImplementsInterfaceAnalyzerTests.cs | 190 - .../Analyzers/MethodUsesAnalyzerTests.cs | 52 - .../Analyzers/TestCases/MainAssembly.cs | 21 - .../Analyzers/TypeUsedByAnalyzerTests.cs | 61 - ILSpy.Tests/BitmapContainer.resources | Bin 1158 -> 0 bytes ILSpy.Tests/CommandLineArgumentsTests.cs | 127 - ILSpy.Tests/ILSpy.Tests.csproj | 91 - ILSpy.Tests/Icon.ico | Bin 45451 -> 0 bytes ILSpy.Tests/IconContainer.resx | 124 - ILSpy.Tests/ResourceReaderWriterTests.cs | 232 -- ILSpy.Tests/Test.resources | Bin 684 -> 0 bytes ILSpy.Tests/UpdateServiceTests.cs | 109 - ILSpy.sln | 39 +- ILSpy/AboutPage.cs | 241 -- ILSpy/Analyzers/AnalyzeCommand.cs | 93 - ILSpy/Analyzers/AnalyzerEntityTreeNode.cs | 78 - ILSpy/Analyzers/AnalyzerRootNode.cs | 59 - ILSpy/Analyzers/AnalyzerSearchTreeNode.cs | 136 - ILSpy/Analyzers/AnalyzerTreeNode.cs | 62 - ILSpy/Analyzers/AnalyzerTreeView.xaml | 22 - ILSpy/Analyzers/AnalyzerTreeView.xaml.cs | 50 - ILSpy/Analyzers/AnalyzerTreeViewModel.cs | 134 - .../CopyAnalysisResultsContextMenuEntry.cs | 58 - .../RemoveAnalyzeContextMenuEntry.cs | 51 - .../TreeNodes/AnalyzedAccessorTreeNode.cs | 40 - .../TreeNodes/AnalyzedEventTreeNode.cs | 85 - .../TreeNodes/AnalyzedFieldTreeNode.cs | 60 - .../TreeNodes/AnalyzedMethodTreeNode.cs | 62 - .../TreeNodes/AnalyzedModuleTreeNode.cs | 94 - .../TreeNodes/AnalyzedPropertyTreeNode.cs | 68 - .../TreeNodes/AnalyzedTypeTreeNode.cs | 59 - ILSpy/App.xaml | 39 - ILSpy/App.xaml.cs | 277 -- ILSpy/AppEnv/AppEnvironment.cs | 9 - ILSpy/AppEnv/CommandLineArguments.cs | 119 - ILSpy/AppEnv/CommandLineTools.cs | 241 -- ILSpy/AppEnv/SingleInstance.cs | 286 -- ILSpy/AssemblyTree/AssemblyListPane.xaml | 55 - ILSpy/AssemblyTree/AssemblyListPane.xaml.cs | 86 - ILSpy/AssemblyTree/AssemblyTreeModel.cs | 1111 ------ ILSpy/AssemblyTree/AssemblyTreeModel.wpf.cs | 83 - ILSpy/AvalonEdit/ITextMarker.cs | 168 - ILSpy/AvalonEdit/TextMarkerService.cs | 372 -- ILSpy/Commands/BrowseBackCommand.cs | 65 - ILSpy/Commands/BrowseForwardCommand.cs | 65 - ILSpy/Commands/CheckForUpdatesCommand.cs | 34 - ILSpy/Commands/CommandWrapper.cs | 66 - ILSpy/Commands/CompareContextMenuEntry.cs | 53 - .../CopyFullyQualifiedNameContextMenuEntry.cs | 50 - .../Commands/CreateDiagramContextMenuEntry.cs | 124 - ILSpy/Commands/DecompileAllCommand.cs | 122 - ILSpy/Commands/DecompileCommand.cs | 72 - ILSpy/Commands/DecompileInNewViewCommand.cs | 96 - ILSpy/Commands/DelegateCommand.cs | 73 - ILSpy/Commands/DisassembleAllCommand.cs | 89 - ILSpy/Commands/ExitCommand.cs | 33 - ILSpy/Commands/ExportCommandAttribute.cs | 113 - .../ExtractPackageEntryContextMenuEntry.cs | 237 -- ILSpy/Commands/GeneratePdbContextMenuEntry.cs | 210 -- ILSpy/Commands/IProtocolHandler.cs | 30 - ILSpy/Commands/ManageAssemblyListsCommand.cs | 46 - ILSpy/Commands/OpenCommand.cs | 57 - ILSpy/Commands/OpenFromGacCommand.cs | 48 - ILSpy/Commands/Pdb2XmlCommand.cs | 97 - ILSpy/Commands/RefreshCommand.cs | 45 - .../RemoveAssembliesWithLoadErrors.cs | 70 - ILSpy/Commands/SaveCodeContextMenuEntry.cs | 140 - ILSpy/Commands/SaveCommand.cs | 45 - ILSpy/Commands/ScopeSearchToAssembly.cs | 96 - ILSpy/Commands/ScopeSearchToNamespace.cs | 94 - ILSpy/Commands/SearchMsdnContextMenuEntry.cs | 141 - ILSpy/Commands/SelectPdbContextMenuEntry.cs | 67 - ILSpy/Commands/SetThemeCommand.cs | 18 - ILSpy/Commands/ShowCFGContextMenuEntry.cs | 77 - ILSpy/Commands/ShowPane.cs | 25 - ILSpy/Commands/SimpleCommand.cs | 51 - ILSpy/Commands/SortAssemblyListCommand.cs | 52 - ILSpy/ContextMenuEntry.cs | 375 -- ILSpy/Controls/CollapsiblePanel.cs | 209 -- ILSpy/Controls/CultureSelectionConverter.cs | 47 - ILSpy/Controls/CustomDialog.cs | 169 - ILSpy/Controls/ExtensionMethods.cs | 80 - ILSpy/Controls/GridViewColumnAutoSize.cs | 108 - ILSpy/Controls/MainMenu.xaml | 53 - ILSpy/Controls/MainMenu.xaml.cs | 212 -- ILSpy/Controls/MainToolBar.xaml | 88 - ILSpy/Controls/MainToolBar.xaml.cs | 237 -- ILSpy/Controls/MarkupExtensions.cs | 69 - ILSpy/Controls/ResourceObjectTable.xaml | 82 - ILSpy/Controls/ResourceObjectTable.xaml.cs | 115 - ILSpy/Controls/ResourceStringTable.xaml | 75 - ILSpy/Controls/ResourceStringTable.xaml.cs | 111 - ILSpy/Controls/SearchBox.cs | 161 - ILSpy/Controls/SearchBoxStyle.xaml | 65 - ILSpy/Controls/SortableGridViewColumn.cs | 254 -- ILSpy/Controls/TreeView/EditTextBox.cs | 100 - ILSpy/Controls/TreeView/ExtensionMethods.cs | 51 - ILSpy/Controls/TreeView/GeneralAdorner.cs | 80 - ILSpy/Controls/TreeView/InsertMarker.cs | 32 - ILSpy/Controls/TreeView/LinesRenderer.cs | 82 - ILSpy/Controls/TreeView/SharpGridView.cs | 40 - ILSpy/Controls/TreeView/SharpTreeNodeView.cs | 190 - ILSpy/Controls/TreeView/SharpTreeView.cs | 851 ----- ILSpy/Controls/TreeView/SharpTreeView.xaml | 318 -- .../TreeView/SharpTreeViewAutomationPeer.cs | 34 - ILSpy/Controls/TreeView/SharpTreeViewItem.cs | 174 - .../SharpTreeViewItemAutomationPeer.cs | 96 - .../TreeView/SharpTreeViewTextSearch.cs | 173 - .../Controls/TreeView/WpfWindowsDataObject.cs | 33 - .../TreeView/WpfWindowsDragDropManager.cs | 14 - .../TreeView/WpfWindowsDragEventArgs.cs | 20 - .../TreeView/WpfWindowsRoutedEventArgs.cs | 18 - ILSpy/Controls/XamlResourceExtension.cs | 38 - ILSpy/Controls/ZoomButtons.cs | 73 - ILSpy/Controls/ZoomScrollViewer.cs | 179 - ILSpy/Controls/ZoomScrollViewer.xaml | 138 - ILSpy/DecompilationOptions.cs | 114 - ILSpy/Docking/CloseAllDocumentsCommand.cs | 26 - ILSpy/Docking/DockLayoutSettings.cs | 122 - ILSpy/Docking/DockWorkspace.cs | 200 -- ILSpy/Docking/DockWorkspace.wpf.cs | 150 - ILSpy/Docking/PaneStyleSelector.cs | 42 - ILSpy/Docking/TabPageGuardConverter.cs | 40 - ILSpy/EntityReference.cs | 62 - ILSpy/ExtensionMethods.cs | 224 -- ILSpy/GlobalUsings.cs | 19 - ILSpy/GuessFileType.cs | 184 - ILSpy/ILSpy.csproj | 135 - ILSpy/ILSpySettingsFilePathProvider.cs | 44 - ILSpy/ILSpyTraceListener.cs | 128 - ILSpy/ISmartTextOutput.cs | 45 - ILSpy/Images/AccessOverlayIcon.cs | 31 - ILSpy/Images/Assembly.svg | 1 - ILSpy/Images/Assembly.xaml | 11 - ILSpy/Images/AssemblyList.svg | 1 - ILSpy/Images/AssemblyList.xaml | 10 - ILSpy/Images/AssemblyListGAC.svg | 84 - ILSpy/Images/AssemblyListGAC.xaml | 44 - ILSpy/Images/AssemblyLoading.svg | 49 - ILSpy/Images/AssemblyLoading.xaml | 28 - ILSpy/Images/AssemblyWarning.svg | 1 - ILSpy/Images/AssemblyWarning.xaml | 11 - ILSpy/Images/Back.svg | 1 - ILSpy/Images/Back.xaml | 10 - ILSpy/Images/Class.svg | 1 - ILSpy/Images/Class.xaml | 9 - ILSpy/Images/Close.svg | 1 - ILSpy/Images/Close.xaml | 9 - ILSpy/Images/CollapseAll.svg | 1 - ILSpy/Images/CollapseAll.xaml | 11 - ILSpy/Images/Constructor.svg | 70 - ILSpy/Images/Constructor.xaml | 12 - ILSpy/Images/Copy.svg | 1 - ILSpy/Images/Copy.xaml | 10 - ILSpy/Images/Delegate.svg | 1 - ILSpy/Images/Delegate.xaml | 10 - ILSpy/Images/Delete.svg | 1 - ILSpy/Images/Delete.xaml | 9 - ILSpy/Images/DictionaryContain.svg | 1 - ILSpy/Images/DictionaryContain.xaml | 13 - ILSpy/Images/Enum.svg | 1 - ILSpy/Images/Enum.xaml | 10 - ILSpy/Images/EnumValue.svg | 1 - ILSpy/Images/EnumValue.xaml | 10 - ILSpy/Images/Event.svg | 1 - ILSpy/Images/Event.xaml | 9 - ILSpy/Images/ExpandAll.svg | 1 - ILSpy/Images/ExpandAll.xaml | 11 - ILSpy/Images/ExportOverlay.svg | 86 - ILSpy/Images/ExportOverlay.xaml | 18 - ILSpy/Images/ExtensionMethod.svg | 1 - ILSpy/Images/ExtensionMethod.xaml | 11 - ILSpy/Images/Field.svg | 1 - ILSpy/Images/Field.xaml | 10 - ILSpy/Images/FieldReadOnly.svg | 69 - ILSpy/Images/FieldReadOnly.xaml | 10 - ILSpy/Images/FindAssembly.svg | 93 - ILSpy/Images/FindAssembly.xaml | 23 - ILSpy/Images/Folder.Closed.svg | 1 - ILSpy/Images/Folder.Closed.xaml | 10 - ILSpy/Images/Folder.Open.xaml | 9 - ILSpy/Images/FolderOpen.svg | 1 - ILSpy/Images/Forward.svg | 1 - ILSpy/Images/Forward.xaml | 10 - ILSpy/Images/Header.svg | 1 - ILSpy/Images/Header.xaml | 11 - ILSpy/Images/Heap.svg | 1 - ILSpy/Images/Heap.xaml | 10 - ILSpy/Images/ILSpy-Large.ico | Bin 58965 -> 0 bytes ILSpy/Images/ILSpy.pdn | Bin 98513 -> 0 bytes ILSpy/Images/Images.cs | 465 --- ILSpy/Images/Indexer.svg | 1 - ILSpy/Images/Indexer.xaml | 9 - ILSpy/Images/Interface.svg | 1 - ILSpy/Images/Interface.xaml | 10 - ILSpy/Images/Library.svg | 1 - ILSpy/Images/Library.xaml | 12 - ILSpy/Images/ListFolder.Open.svg | 1 - ILSpy/Images/ListFolder.Open.xaml | 12 - ILSpy/Images/ListFolder.svg | 1 - ILSpy/Images/ListFolder.xaml | 11 - ILSpy/Images/Literal.svg | 1 - ILSpy/Images/Literal.xaml | 11 - ILSpy/Images/MemberIcon.cs | 36 - ILSpy/Images/Metadata.svg | 1 - ILSpy/Images/Metadata.xaml | 15 - ILSpy/Images/MetadataFile.svg | 73 - ILSpy/Images/MetadataFile.xaml | 29 - ILSpy/Images/MetadataTable.svg | 1 - ILSpy/Images/MetadataTable.xaml | 10 - ILSpy/Images/MetadataTableGroup.svg | 1 - ILSpy/Images/MetadataTableGroup.xaml | 10 - ILSpy/Images/Method.svg | 1 - ILSpy/Images/Method.xaml | 10 - ILSpy/Images/Namespace.svg | 1 - ILSpy/Images/Namespace.xaml | 9 - ILSpy/Images/NuGet.png | Bin 13750 -> 0 bytes ILSpy/Images/OK.svg | 1 - ILSpy/Images/OK.xaml | 10 - ILSpy/Images/Open.svg | 1 - ILSpy/Images/Open.xaml | 10 - ILSpy/Images/Operator.svg | 1 - ILSpy/Images/Operator.xaml | 10 - ILSpy/Images/OverlayCompilerControlled.svg | 76 - ILSpy/Images/OverlayCompilerControlled.xaml | 10 - ILSpy/Images/OverlayExtension.svg | 51 - ILSpy/Images/OverlayExtension.xaml | 11 - ILSpy/Images/OverlayInternal.svg | 76 - ILSpy/Images/OverlayInternal.xaml | Bin 2976 -> 0 bytes ILSpy/Images/OverlayPrivate.svg | 80 - ILSpy/Images/OverlayPrivate.xaml | Bin 1438 -> 0 bytes ILSpy/Images/OverlayPrivateProtected.svg | 84 - ILSpy/Images/OverlayPrivateProtected.xaml | Bin 2826 -> 0 bytes ILSpy/Images/OverlayProtected.svg | 72 - ILSpy/Images/OverlayProtected.xaml | Bin 1290 -> 0 bytes ILSpy/Images/OverlayProtectedInternal.svg | 79 - ILSpy/Images/OverlayProtectedInternal.xaml | Bin 3318 -> 0 bytes ILSpy/Images/OverlayStatic.svg | 73 - ILSpy/Images/OverlayStatic.xaml | Bin 944 -> 0 bytes ILSpy/Images/PInvokeMethod.svg | 79 - ILSpy/Images/PInvokeMethod.xaml | 14 - ILSpy/Images/ProgramDebugDatabase.svg | 1 - ILSpy/Images/ProgramDebugDatabase.xaml | 14 - ILSpy/Images/Property.svg | 1 - ILSpy/Images/Property.xaml | 9 - ILSpy/Images/README.md | 85 - ILSpy/Images/ReferenceFolder.svg | 90 - ILSpy/Images/ReferenceFolder.xaml | Bin 2824 -> 0 bytes ILSpy/Images/ReferenceOverlay.svg | 55 - ILSpy/Images/ReferenceOverlay.xaml | 12 - ILSpy/Images/Refresh.svg | 1 - ILSpy/Images/Refresh.xaml | 9 - ILSpy/Images/Resource.svg | 1 - ILSpy/Images/Resource.xaml | 10 - ILSpy/Images/ResourceImage.svg | 1 - ILSpy/Images/ResourceImage.xaml | 13 - ILSpy/Images/ResourceResourcesFile.svg | 1 - ILSpy/Images/ResourceResourcesFile.xaml | 23 - ILSpy/Images/ResourceXml.svg | 1 - ILSpy/Images/ResourceXml.xaml | 10 - ILSpy/Images/ResourceXsd.svg | 93 - ILSpy/Images/ResourceXsd.xaml | 12 - ILSpy/Images/ResourceXsl.svg | 1 - ILSpy/Images/ResourceXsl.xaml | 10 - ILSpy/Images/ResourceXslt.svg | 2 - ILSpy/Images/ResourceXslt.xaml | 10 - ILSpy/Images/ResultToJSON.svg | 1 - ILSpy/Images/ResultToJSON.xaml | 10 - ILSpy/Images/Save.svg | 1 - ILSpy/Images/Save.xaml | 10 - ILSpy/Images/Search.svg | 1 - ILSpy/Images/Search.xaml | 10 - ILSpy/Images/SearchMsdn.svg | 89 - ILSpy/Images/SearchMsdn.xaml | 21 - ILSpy/Images/ShowAll.svg | 142 - ILSpy/Images/ShowAll.xaml | Bin 9342 -> 0 bytes ILSpy/Images/ShowPrivateInternal.svg | 101 - ILSpy/Images/ShowPrivateInternal.xaml | Bin 5948 -> 0 bytes ILSpy/Images/ShowPublicOnly.svg | 1 - ILSpy/Images/ShowPublicOnly.xaml | 10 - ILSpy/Images/Sort.svg | 1 - ILSpy/Images/Sort.xaml | 11 - ILSpy/Images/Struct.svg | 1 - ILSpy/Images/Struct.xaml | 9 - ILSpy/Images/SubTypes.svg | 1 - ILSpy/Images/SubTypes.xaml | 13 - ILSpy/Images/SuperTypes.svg | 1 - ILSpy/Images/SuperTypes.xaml | 13 - ILSpy/Images/SwitchSourceOrTarget.svg | 1 - ILSpy/Images/SwitchSourceOrTarget.xaml | 9 - ILSpy/Images/TypeIcon.cs | 29 - ILSpy/Images/ViewCode.svg | 1 - ILSpy/Images/ViewCode.xaml | 10 - ILSpy/Images/VirtualMethod.svg | 93 - ILSpy/Images/VirtualMethod.xaml | 13 - ILSpy/Images/Warning.svg | 1 - ILSpy/Images/Warning.xaml | 10 - ILSpy/Images/WebAssembly.svg | 8 - ILSpy/Images/WebAssembly.xaml | 7 - .../WpfWindowsTreeNodeImagesProvider.cs | 9 - ILSpy/Images/ZoomIn.svg | 65 - ILSpy/Images/ZoomIn.xaml | 27 - ILSpy/Images/ZoomOut.svg | 57 - ILSpy/Images/ZoomOut.xaml | 20 - ILSpy/LanguageSettings.cs | 154 - ILSpy/Languages/CSharpBracketSearcher.cs | 453 --- .../CSharpHighlightingTokenWriter.cs | 568 --- ILSpy/Languages/CSharpILMixedLanguage.cs | 188 - ILSpy/Languages/CSharpLanguage.cs | 812 ----- ILSpy/Languages/CSharpLanguage.wpf.cs | 75 - ILSpy/Languages/ILAstLanguage.cs | 150 - ILSpy/Languages/ILLanguage.cs | 241 -- ILSpy/Languages/IResourceFileHandler.cs | 54 - ILSpy/Languages/Language.cs | 428 --- ILSpy/Languages/LanguageService.cs | 147 - ILSpy/MainWindow.xaml | 114 - ILSpy/MainWindow.xaml.cs | 113 - ILSpy/MainWindowViewModel.cs | 40 - ILSpy/Metadata/CoffHeaderTreeNode.cs | 130 - .../CorTables/AssemblyRefTableTreeNode.cs | 97 - .../CorTables/AssemblyTableTreeNode.cs | 94 - .../CorTables/ClassLayoutTableTreeNode.cs | 106 - .../CorTables/ConstantTableTreeNode.cs | 92 - .../CorTables/CustomAttributeTableTreeNode.cs | 99 - .../CorTables/DeclSecurityTableTreeNode.cs | 97 - .../CorTables/EventMapTableTreeNode.cs | 107 - .../Metadata/CorTables/EventTableTreeNode.cs | 98 - .../CorTables/ExportedTypeTableTreeNode.cs | 104 - .../CorTables/FieldLayoutTableTreeNode.cs | 98 - .../CorTables/FieldMarshalTableTreeNode.cs | 98 - .../CorTables/FieldRVATableTreeNode.cs | 101 - .../Metadata/CorTables/FieldTableTreeNode.cs | 92 - ILSpy/Metadata/CorTables/FileTableTreeNode.cs | 87 - .../GenericParamConstraintTableTreeNode.cs | 106 - .../CorTables/GenericParamTableTreeNode.cs | 93 - .../CorTables/ImplMapTableTreeNode.cs | 129 - .../CorTables/InterfaceImplTableTreeNode.cs | 105 - .../ManifestResourceTableTreeNode.cs | 89 - .../CorTables/MemberRefTableTreeNode.cs | 89 - .../CorTables/MethodImplTableTreeNode.cs | 102 - .../CorTables/MethodSemanticsTableTreeNode.cs | 100 - .../CorTables/MethodSpecTableTreeNode.cs | 100 - .../Metadata/CorTables/MethodTableTreeNode.cs | 124 - .../CorTables/ModuleRefTableTreeNode.cs | 70 - .../Metadata/CorTables/ModuleTableTreeNode.cs | 82 - .../CorTables/NestedClassTableTreeNode.cs | 101 - .../Metadata/CorTables/ParamTableTreeNode.cs | 80 - .../CorTables/PropertyMapTableTreeNode.cs | 106 - .../CorTables/PropertyTableTreeNode.cs | 90 - ILSpy/Metadata/CorTables/PtrTableTreeNode.cs | 114 - .../CorTables/StandAloneSigTableTreeNode.cs | 74 - .../CorTables/TypeDefTableTreeNode.cs | 165 - .../CorTables/TypeRefTableTreeNode.cs | 86 - .../CorTables/TypeSpecTableTreeNode.cs | 83 - ILSpy/Metadata/DataDirectoriesTreeNode.cs | 108 - .../DebugDirectory/CodeViewTreeNode.cs | 74 - .../DebugDirectoryEntryTreeNode.cs | 63 - .../DebugDirectory/PdbChecksumTreeNode.cs | 83 - ILSpy/Metadata/DebugDirectoryTreeNode.cs | 141 - ILSpy/Metadata/DebugMetadataTablesTreeNode.cs | 79 - .../CustomDebugInformationTableTreeNode.cs | 305 -- .../DebugTables/DocumentTableTreeNode.cs | 120 - .../DebugTables/ImportScopeTableTreeNode.cs | 78 - .../DebugTables/LocalConstantTableTreeNode.cs | 76 - .../DebugTables/LocalScopeTableTreeNode.cs | 110 - .../DebugTables/LocalVariableTableTreeNode.cs | 82 - .../MethodDebugInformationTableTreeNode.cs | 133 - .../StateMachineMethodTableTreeNode.cs | 99 - ILSpy/Metadata/DosHeaderTreeNode.cs | 95 - ILSpy/Metadata/FlagsContentFilter.cs | 22 - ILSpy/Metadata/FlagsFilterControl.xaml | 36 - ILSpy/Metadata/FlagsFilterControl.xaml.cs | 105 - ILSpy/Metadata/FlagsTooltip.xaml | 44 - ILSpy/Metadata/FlagsTooltip.xaml.cs | 172 - ILSpy/Metadata/GoToTokenCommand.cs | 101 - ILSpy/Metadata/Heaps/BlobHeapTreeNode.cs | 80 - ILSpy/Metadata/Heaps/GuidHeapTreeNode.cs | 78 - ILSpy/Metadata/Heaps/StringHeapTreeNode.cs | 79 - .../Metadata/Heaps/UserStringHeapTreeNode.cs | 79 - ILSpy/Metadata/Helper.wpf.cs | 43 - ILSpy/Metadata/Helpers.cs | 375 -- .../HexFilterControl.ContentFilter.cs | 31 - ILSpy/Metadata/HexFilterControl.xaml | 32 - ILSpy/Metadata/HexFilterControl.xaml.cs | 64 - ILSpy/Metadata/MetaDataGrid.cs | 119 - ILSpy/Metadata/MetadataHeapTreeNode.cs | 65 - ILSpy/Metadata/MetadataProtocolHandler.cs | 52 - ILSpy/Metadata/MetadataTableTreeNode.cs | 182 - ILSpy/Metadata/MetadataTableTreeNode.wpf.cs | 32 - ILSpy/Metadata/MetadataTableViews.xaml | 128 - ILSpy/Metadata/MetadataTableViews.xaml.cs | 50 - ILSpy/Metadata/MetadataTablesTreeNode.cs | 169 - ILSpy/Metadata/MetadataTreeNode.cs | 167 - ILSpy/Metadata/OptionalHeaderTreeNode.cs | 139 - ILSpy/NativeMethods.cs | 71 - ILSpy/NavigationHistory.cs | 105 - ILSpy/NavigationState.cs | 81 - ILSpy/Options/DecompilerSettingsPanel.xaml | 38 - ILSpy/Options/DecompilerSettingsPanel.xaml.cs | 40 - ILSpy/Options/DecompilerSettingsViewModel.cs | 164 - ILSpy/Options/DisplaySettings.cs | 223 -- ILSpy/Options/DisplaySettingsPanel.xaml | 87 - ILSpy/Options/DisplaySettingsPanel.xaml.cs | 93 - ILSpy/Options/DisplaySettingsViewModel.cs | 94 - ILSpy/Options/ExportOptionPageAttribute.cs | 30 - ILSpy/Options/IOptionPage.cs | 29 - ILSpy/Options/IOptionsMetadata.cs | 25 - ILSpy/Options/MiscSettings.cs | 60 - ILSpy/Options/MiscSettingsPanel.xaml | 19 - ILSpy/Options/MiscSettingsPanel.xaml.cs | 39 - ILSpy/Options/MiscSettingsViewModel.cs | 104 - ILSpy/Options/OptionsDialog.xaml | 43 - ILSpy/Options/OptionsDialog.xaml.cs | 38 - ILSpy/Options/OptionsDialogViewModel.cs | 86 - ILSpy/Options/ShowOptionsCommand.cs | 56 - ILSpy/Properties/AssemblyInfo.cs | 38 - ILSpy/Properties/Resources.Designer.cs | 3172 ----------------- ILSpy/Properties/Resources.resx | 1171 ------ ILSpy/Properties/WPFAssemblyInfo.cs | 23 - ILSpy/Properties/launchSettings.json | 13 - ILSpy/Search/SearchPane.xaml | 92 - ILSpy/Search/SearchPane.xaml.cs | 592 --- ILSpy/Search/SearchPaneModel.cs | 87 - ILSpy/Search/SearchResultFactory.cs | 177 - ILSpy/Search/ShowSearchCommand.cs | 49 - ILSpy/SessionSettings.cs | 203 -- ILSpy/SmartTextOutputExtensions.cs | 61 - ILSpy/SolutionWriter.cs | 267 -- ILSpy/TaskHelper.cs | 208 -- ILSpy/TextView/Asm-Mode.xshd | 1215 ------- ILSpy/TextView/AvalonEditTextOutput.cs | 375 -- ILSpy/TextView/BracketHighlightRenderer.cs | 93 - ILSpy/TextView/BracketSearchResult.cs | 43 - ILSpy/TextView/CSharp-Mode.xshd | 159 - ILSpy/TextView/CaretHighlightAdorner.cs | 77 - ILSpy/TextView/DecompilerTextEditor.cs | 13 - ILSpy/TextView/DecompilerTextView.cs | 1484 -------- ILSpy/TextView/DecompilerTextView.xaml | 116 - ILSpy/TextView/DefaultBracketSearcher.cs | 32 - ILSpy/TextView/DocumentationUIBuilder.cs | 600 ---- ILSpy/TextView/EditorCommands.cs | 64 - ILSpy/TextView/FoldingCommands.cs | 107 - ILSpy/TextView/IBracketSearcher.cs | 34 - ILSpy/TextView/ILAsm-Mode.xshd | 540 --- .../TextView/OutputLengthExceededException.cs | 40 - ILSpy/TextView/ReferenceElementGenerator.cs | 75 - .../ThemeAwareHighlightingColorizer.cs | 46 - ILSpy/TextView/UIElementGenerator.cs | 74 - ILSpy/TextView/ViewState.cs | 56 - ILSpy/TextView/VisualLineReferenceText.cs | 50 - ILSpy/TextView/VisualLineReferenceText.wpf.cs | 37 - ILSpy/TextView/XML-Mode.xshd | 63 - .../ZoomLevelToTextFormattingModeConverter.cs | 38 - ILSpy/Themes/Base.Dark.xaml | 71 - ILSpy/Themes/Base.Light.xaml | 63 - ILSpy/Themes/ResourceKeys.cs | 38 - ILSpy/Themes/SyntaxColor.cs | 32 - ILSpy/Themes/Theme.Dark.xaml | 96 - ILSpy/Themes/Theme.Light.xaml | 96 - ILSpy/Themes/Theme.RSharpDark.xaml | 101 - ILSpy/Themes/Theme.RSharpLight.xaml | 101 - ILSpy/Themes/Theme.VSCodeDarkPlus.xaml | 106 - ILSpy/Themes/Theme.VSCodeLightPlus.xaml | 106 - ILSpy/Themes/ThemeManager.cs | 219 -- ILSpy/Themes/WindowStyleManagerBehavior.cs | 130 - ILSpy/Themes/generic.xaml | 35 - ILSpy/TreeNodes/AssemblyListTreeNode.cs | 345 -- ...ssemblyReferenceReferencedTypesTreeNode.cs | 64 - ILSpy/TreeNodes/AssemblyReferenceTreeNode.cs | 197 - ILSpy/TreeNodes/AssemblyTreeNode.cs | 776 ---- ILSpy/TreeNodes/BaseTypesEntryNode.cs | 69 - ILSpy/TreeNodes/BaseTypesTreeNode.cs | 80 - ILSpy/TreeNodes/DerivedTypesEntryNode.cs | 106 - ILSpy/TreeNodes/DerivedTypesTreeNode.cs | 93 - ILSpy/TreeNodes/EventTreeNode.cs | 110 - ILSpy/TreeNodes/ExportedTypeTreeNode.cs | 63 - ILSpy/TreeNodes/ExtensionTreeNode.cs | 107 - ILSpy/TreeNodes/FieldTreeNode.cs | 111 - ILSpy/TreeNodes/FilterResult.cs | 40 - ILSpy/TreeNodes/ILSpyTreeNode.cs | 186 - ILSpy/TreeNodes/IMemberTreeNode.cs | 37 - ILSpy/TreeNodes/MemberReferenceTreeNode.cs | 70 - ILSpy/TreeNodes/MethodTreeNode.cs | 132 - ILSpy/TreeNodes/ModuleReferenceTreeNode.cs | 97 - ILSpy/TreeNodes/NamespaceTreeNode.cs | 73 - ILSpy/TreeNodes/NaturalStringComparer.cs | 32 - ILSpy/TreeNodes/PackageFolderTreeNode.cs | 94 - ILSpy/TreeNodes/PropertyTreeNode.cs | 118 - ILSpy/TreeNodes/ReferenceFolderTreeNode.cs | 91 - ILSpy/TreeNodes/ResourceListTreeNode.cs | 88 - .../ResourceNodes/CursorResourceEntryNode.cs | 105 - .../ResourceNodes/IResourceNodeFactory.cs | 31 - .../ResourceNodes/IconResourceEntryNode.cs | 89 - .../ImageListResourceEntryNode.cs | 85 - .../ResourceNodes/ImageResourceEntryNode.cs | 59 - .../ImageResourceEntryNode.wpf.cs | 55 - .../ResourceNodes/ResourceEntryNode.cs | 94 - .../ResourceNodes/ResourceTreeNode.cs | 132 - .../ResourceNodes/ResourcesFileTreeNode.cs | 223 -- .../ResourceNodes/XamlResourceNode.cs | 93 - .../ResourceNodes/XmlResourceNode.cs | 114 - ILSpy/TreeNodes/ThreadingSupport.cs | 218 -- ILSpy/TreeNodes/TypeReferenceTreeNode.cs | 76 - ILSpy/TreeNodes/TypeTreeNode.cs | 201 -- ILSpy/Updates/AppUpdateService.cs | 35 - ILSpy/Updates/AvailableVersionInfo.cs | 28 - ILSpy/Updates/UpdateService.cs | 151 - ILSpy/Updates/UpdateSettings.cs | 74 - ILSpy/Util/GlobalUtils.cs | 52 - ILSpy/Util/GlobalUtils.wpf.cs | 28 - ILSpy/Util/GraphVizGraph.cs | 231 -- ILSpy/Util/MessageBus.cs | 126 - ILSpy/Util/ResourceHelper.cs | 33 - ILSpy/Util/SettingsService.cs | 141 - ILSpy/Util/ShellHelper.cs | 146 - ILSpy/ViewModels/CompareViewModel.cs | 716 ---- ILSpy/ViewModels/DebugStepsPaneModel.cs | 42 - ILSpy/ViewModels/LegacyToolPaneModel.cs | 44 - .../ManageAssemblyListsViewModel.cs | 290 -- ILSpy/ViewModels/Pane.cs | 49 - ILSpy/ViewModels/PaneModel.cs | 124 - ILSpy/ViewModels/TabPageModel.cs | 81 - ILSpy/ViewModels/TabPageModelExtensions.cs | 89 - .../ViewModels/TabPageModelExtensions.wpf.cs | 44 - ILSpy/ViewModels/ToolPaneModel.cs | 46 - ILSpy/ViewModels/UpdatePanelViewModel.cs | 100 - ILSpy/Views/CompareView.xaml | 86 - ILSpy/Views/CompareView.xaml.cs | 33 - ILSpy/Views/CreateListDialog.xaml | 25 - ILSpy/Views/CreateListDialog.xaml.cs | 35 - ILSpy/Views/DebugSteps.xaml | 32 - ILSpy/Views/DebugSteps.xaml.cs | 163 - ILSpy/Views/GacEntry.cs | 87 - ILSpy/Views/ManageAssemblyLIstsDialog.xaml.cs | 46 - ILSpy/Views/ManageAssemblyListsDialog.xaml | 64 - ILSpy/Views/OpenFromGacDialog.xaml | 48 - ILSpy/Views/OpenFromGacDialog.xaml.cs | 138 - ILSpy/Views/UpdatePanel.xaml | 22 - ILSpy/Views/UpdatePanel.xaml.cs | 39 - ILSpy/app.manifest | 77 - 551 files changed, 7 insertions(+), 52618 deletions(-) rename {ILSpy/Images => ICSharpCode.ILSpyX/MermaidDiagrammer/html}/ILSpy.ico (100%) delete mode 100644 ILSpy.BamlDecompiler/BamlResourceEntryNode.cs delete mode 100644 ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs delete mode 100644 ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj delete mode 100644 ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs delete mode 100644 ILSpy.BamlDecompiler/Properties/launchSettings.json delete mode 100644 ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs delete mode 100644 ILSpy.Tests/Analyzers/ExportAnalyzerAttributeTests.cs delete mode 100644 ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs delete mode 100644 ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs delete mode 100644 ILSpy.Tests/Analyzers/TestCases/MainAssembly.cs delete mode 100644 ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs delete mode 100644 ILSpy.Tests/BitmapContainer.resources delete mode 100644 ILSpy.Tests/CommandLineArgumentsTests.cs delete mode 100644 ILSpy.Tests/ILSpy.Tests.csproj delete mode 100644 ILSpy.Tests/Icon.ico delete mode 100644 ILSpy.Tests/IconContainer.resx delete mode 100644 ILSpy.Tests/ResourceReaderWriterTests.cs delete mode 100644 ILSpy.Tests/Test.resources delete mode 100644 ILSpy.Tests/UpdateServiceTests.cs delete mode 100644 ILSpy/AboutPage.cs delete mode 100644 ILSpy/Analyzers/AnalyzeCommand.cs delete mode 100644 ILSpy/Analyzers/AnalyzerEntityTreeNode.cs delete mode 100644 ILSpy/Analyzers/AnalyzerRootNode.cs delete mode 100644 ILSpy/Analyzers/AnalyzerSearchTreeNode.cs delete mode 100644 ILSpy/Analyzers/AnalyzerTreeNode.cs delete mode 100644 ILSpy/Analyzers/AnalyzerTreeView.xaml delete mode 100644 ILSpy/Analyzers/AnalyzerTreeView.xaml.cs delete mode 100644 ILSpy/Analyzers/AnalyzerTreeViewModel.cs delete mode 100644 ILSpy/Analyzers/CopyAnalysisResultsContextMenuEntry.cs delete mode 100644 ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs delete mode 100644 ILSpy/Analyzers/TreeNodes/AnalyzedAccessorTreeNode.cs delete mode 100644 ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs delete mode 100644 ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs delete mode 100644 ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs delete mode 100644 ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs delete mode 100644 ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs delete mode 100644 ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs delete mode 100644 ILSpy/App.xaml delete mode 100644 ILSpy/App.xaml.cs delete mode 100644 ILSpy/AppEnv/AppEnvironment.cs delete mode 100644 ILSpy/AppEnv/CommandLineArguments.cs delete mode 100644 ILSpy/AppEnv/CommandLineTools.cs delete mode 100644 ILSpy/AppEnv/SingleInstance.cs delete mode 100644 ILSpy/AssemblyTree/AssemblyListPane.xaml delete mode 100644 ILSpy/AssemblyTree/AssemblyListPane.xaml.cs delete mode 100644 ILSpy/AssemblyTree/AssemblyTreeModel.cs delete mode 100644 ILSpy/AssemblyTree/AssemblyTreeModel.wpf.cs delete mode 100644 ILSpy/AvalonEdit/ITextMarker.cs delete mode 100644 ILSpy/AvalonEdit/TextMarkerService.cs delete mode 100644 ILSpy/Commands/BrowseBackCommand.cs delete mode 100644 ILSpy/Commands/BrowseForwardCommand.cs delete mode 100644 ILSpy/Commands/CheckForUpdatesCommand.cs delete mode 100644 ILSpy/Commands/CommandWrapper.cs delete mode 100644 ILSpy/Commands/CompareContextMenuEntry.cs delete mode 100644 ILSpy/Commands/CopyFullyQualifiedNameContextMenuEntry.cs delete mode 100644 ILSpy/Commands/CreateDiagramContextMenuEntry.cs delete mode 100644 ILSpy/Commands/DecompileAllCommand.cs delete mode 100644 ILSpy/Commands/DecompileCommand.cs delete mode 100644 ILSpy/Commands/DecompileInNewViewCommand.cs delete mode 100644 ILSpy/Commands/DelegateCommand.cs delete mode 100644 ILSpy/Commands/DisassembleAllCommand.cs delete mode 100644 ILSpy/Commands/ExitCommand.cs delete mode 100644 ILSpy/Commands/ExportCommandAttribute.cs delete mode 100644 ILSpy/Commands/ExtractPackageEntryContextMenuEntry.cs delete mode 100644 ILSpy/Commands/GeneratePdbContextMenuEntry.cs delete mode 100644 ILSpy/Commands/IProtocolHandler.cs delete mode 100644 ILSpy/Commands/ManageAssemblyListsCommand.cs delete mode 100644 ILSpy/Commands/OpenCommand.cs delete mode 100644 ILSpy/Commands/OpenFromGacCommand.cs delete mode 100644 ILSpy/Commands/Pdb2XmlCommand.cs delete mode 100644 ILSpy/Commands/RefreshCommand.cs delete mode 100644 ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs delete mode 100644 ILSpy/Commands/SaveCodeContextMenuEntry.cs delete mode 100644 ILSpy/Commands/SaveCommand.cs delete mode 100644 ILSpy/Commands/ScopeSearchToAssembly.cs delete mode 100644 ILSpy/Commands/ScopeSearchToNamespace.cs delete mode 100644 ILSpy/Commands/SearchMsdnContextMenuEntry.cs delete mode 100644 ILSpy/Commands/SelectPdbContextMenuEntry.cs delete mode 100644 ILSpy/Commands/SetThemeCommand.cs delete mode 100644 ILSpy/Commands/ShowCFGContextMenuEntry.cs delete mode 100644 ILSpy/Commands/ShowPane.cs delete mode 100644 ILSpy/Commands/SimpleCommand.cs delete mode 100644 ILSpy/Commands/SortAssemblyListCommand.cs delete mode 100644 ILSpy/ContextMenuEntry.cs delete mode 100644 ILSpy/Controls/CollapsiblePanel.cs delete mode 100644 ILSpy/Controls/CultureSelectionConverter.cs delete mode 100644 ILSpy/Controls/CustomDialog.cs delete mode 100644 ILSpy/Controls/ExtensionMethods.cs delete mode 100644 ILSpy/Controls/GridViewColumnAutoSize.cs delete mode 100644 ILSpy/Controls/MainMenu.xaml delete mode 100644 ILSpy/Controls/MainMenu.xaml.cs delete mode 100644 ILSpy/Controls/MainToolBar.xaml delete mode 100644 ILSpy/Controls/MainToolBar.xaml.cs delete mode 100644 ILSpy/Controls/MarkupExtensions.cs delete mode 100644 ILSpy/Controls/ResourceObjectTable.xaml delete mode 100644 ILSpy/Controls/ResourceObjectTable.xaml.cs delete mode 100644 ILSpy/Controls/ResourceStringTable.xaml delete mode 100644 ILSpy/Controls/ResourceStringTable.xaml.cs delete mode 100644 ILSpy/Controls/SearchBox.cs delete mode 100644 ILSpy/Controls/SearchBoxStyle.xaml delete mode 100644 ILSpy/Controls/SortableGridViewColumn.cs delete mode 100644 ILSpy/Controls/TreeView/EditTextBox.cs delete mode 100644 ILSpy/Controls/TreeView/ExtensionMethods.cs delete mode 100644 ILSpy/Controls/TreeView/GeneralAdorner.cs delete mode 100644 ILSpy/Controls/TreeView/InsertMarker.cs delete mode 100644 ILSpy/Controls/TreeView/LinesRenderer.cs delete mode 100644 ILSpy/Controls/TreeView/SharpGridView.cs delete mode 100644 ILSpy/Controls/TreeView/SharpTreeNodeView.cs delete mode 100644 ILSpy/Controls/TreeView/SharpTreeView.cs delete mode 100644 ILSpy/Controls/TreeView/SharpTreeView.xaml delete mode 100644 ILSpy/Controls/TreeView/SharpTreeViewAutomationPeer.cs delete mode 100644 ILSpy/Controls/TreeView/SharpTreeViewItem.cs delete mode 100644 ILSpy/Controls/TreeView/SharpTreeViewItemAutomationPeer.cs delete mode 100644 ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs delete mode 100644 ILSpy/Controls/TreeView/WpfWindowsDataObject.cs delete mode 100644 ILSpy/Controls/TreeView/WpfWindowsDragDropManager.cs delete mode 100644 ILSpy/Controls/TreeView/WpfWindowsDragEventArgs.cs delete mode 100644 ILSpy/Controls/TreeView/WpfWindowsRoutedEventArgs.cs delete mode 100644 ILSpy/Controls/XamlResourceExtension.cs delete mode 100644 ILSpy/Controls/ZoomButtons.cs delete mode 100644 ILSpy/Controls/ZoomScrollViewer.cs delete mode 100644 ILSpy/Controls/ZoomScrollViewer.xaml delete mode 100644 ILSpy/DecompilationOptions.cs delete mode 100644 ILSpy/Docking/CloseAllDocumentsCommand.cs delete mode 100644 ILSpy/Docking/DockLayoutSettings.cs delete mode 100644 ILSpy/Docking/DockWorkspace.cs delete mode 100644 ILSpy/Docking/DockWorkspace.wpf.cs delete mode 100644 ILSpy/Docking/PaneStyleSelector.cs delete mode 100644 ILSpy/Docking/TabPageGuardConverter.cs delete mode 100644 ILSpy/EntityReference.cs delete mode 100644 ILSpy/ExtensionMethods.cs delete mode 100644 ILSpy/GlobalUsings.cs delete mode 100644 ILSpy/GuessFileType.cs delete mode 100644 ILSpy/ILSpy.csproj delete mode 100644 ILSpy/ILSpySettingsFilePathProvider.cs delete mode 100644 ILSpy/ILSpyTraceListener.cs delete mode 100644 ILSpy/ISmartTextOutput.cs delete mode 100644 ILSpy/Images/AccessOverlayIcon.cs delete mode 100644 ILSpy/Images/Assembly.svg delete mode 100644 ILSpy/Images/Assembly.xaml delete mode 100644 ILSpy/Images/AssemblyList.svg delete mode 100644 ILSpy/Images/AssemblyList.xaml delete mode 100644 ILSpy/Images/AssemblyListGAC.svg delete mode 100644 ILSpy/Images/AssemblyListGAC.xaml delete mode 100644 ILSpy/Images/AssemblyLoading.svg delete mode 100644 ILSpy/Images/AssemblyLoading.xaml delete mode 100644 ILSpy/Images/AssemblyWarning.svg delete mode 100644 ILSpy/Images/AssemblyWarning.xaml delete mode 100644 ILSpy/Images/Back.svg delete mode 100644 ILSpy/Images/Back.xaml delete mode 100644 ILSpy/Images/Class.svg delete mode 100644 ILSpy/Images/Class.xaml delete mode 100644 ILSpy/Images/Close.svg delete mode 100644 ILSpy/Images/Close.xaml delete mode 100644 ILSpy/Images/CollapseAll.svg delete mode 100644 ILSpy/Images/CollapseAll.xaml delete mode 100644 ILSpy/Images/Constructor.svg delete mode 100644 ILSpy/Images/Constructor.xaml delete mode 100644 ILSpy/Images/Copy.svg delete mode 100644 ILSpy/Images/Copy.xaml delete mode 100644 ILSpy/Images/Delegate.svg delete mode 100644 ILSpy/Images/Delegate.xaml delete mode 100644 ILSpy/Images/Delete.svg delete mode 100644 ILSpy/Images/Delete.xaml delete mode 100644 ILSpy/Images/DictionaryContain.svg delete mode 100644 ILSpy/Images/DictionaryContain.xaml delete mode 100644 ILSpy/Images/Enum.svg delete mode 100644 ILSpy/Images/Enum.xaml delete mode 100644 ILSpy/Images/EnumValue.svg delete mode 100644 ILSpy/Images/EnumValue.xaml delete mode 100644 ILSpy/Images/Event.svg delete mode 100644 ILSpy/Images/Event.xaml delete mode 100644 ILSpy/Images/ExpandAll.svg delete mode 100644 ILSpy/Images/ExpandAll.xaml delete mode 100644 ILSpy/Images/ExportOverlay.svg delete mode 100644 ILSpy/Images/ExportOverlay.xaml delete mode 100644 ILSpy/Images/ExtensionMethod.svg delete mode 100644 ILSpy/Images/ExtensionMethod.xaml delete mode 100644 ILSpy/Images/Field.svg delete mode 100644 ILSpy/Images/Field.xaml delete mode 100644 ILSpy/Images/FieldReadOnly.svg delete mode 100644 ILSpy/Images/FieldReadOnly.xaml delete mode 100644 ILSpy/Images/FindAssembly.svg delete mode 100644 ILSpy/Images/FindAssembly.xaml delete mode 100644 ILSpy/Images/Folder.Closed.svg delete mode 100644 ILSpy/Images/Folder.Closed.xaml delete mode 100644 ILSpy/Images/Folder.Open.xaml delete mode 100644 ILSpy/Images/FolderOpen.svg delete mode 100644 ILSpy/Images/Forward.svg delete mode 100644 ILSpy/Images/Forward.xaml delete mode 100644 ILSpy/Images/Header.svg delete mode 100644 ILSpy/Images/Header.xaml delete mode 100644 ILSpy/Images/Heap.svg delete mode 100644 ILSpy/Images/Heap.xaml delete mode 100644 ILSpy/Images/ILSpy-Large.ico delete mode 100644 ILSpy/Images/ILSpy.pdn delete mode 100644 ILSpy/Images/Images.cs delete mode 100644 ILSpy/Images/Indexer.svg delete mode 100644 ILSpy/Images/Indexer.xaml delete mode 100644 ILSpy/Images/Interface.svg delete mode 100644 ILSpy/Images/Interface.xaml delete mode 100644 ILSpy/Images/Library.svg delete mode 100644 ILSpy/Images/Library.xaml delete mode 100644 ILSpy/Images/ListFolder.Open.svg delete mode 100644 ILSpy/Images/ListFolder.Open.xaml delete mode 100644 ILSpy/Images/ListFolder.svg delete mode 100644 ILSpy/Images/ListFolder.xaml delete mode 100644 ILSpy/Images/Literal.svg delete mode 100644 ILSpy/Images/Literal.xaml delete mode 100644 ILSpy/Images/MemberIcon.cs delete mode 100644 ILSpy/Images/Metadata.svg delete mode 100644 ILSpy/Images/Metadata.xaml delete mode 100644 ILSpy/Images/MetadataFile.svg delete mode 100644 ILSpy/Images/MetadataFile.xaml delete mode 100644 ILSpy/Images/MetadataTable.svg delete mode 100644 ILSpy/Images/MetadataTable.xaml delete mode 100644 ILSpy/Images/MetadataTableGroup.svg delete mode 100644 ILSpy/Images/MetadataTableGroup.xaml delete mode 100644 ILSpy/Images/Method.svg delete mode 100644 ILSpy/Images/Method.xaml delete mode 100644 ILSpy/Images/Namespace.svg delete mode 100644 ILSpy/Images/Namespace.xaml delete mode 100644 ILSpy/Images/NuGet.png delete mode 100644 ILSpy/Images/OK.svg delete mode 100644 ILSpy/Images/OK.xaml delete mode 100644 ILSpy/Images/Open.svg delete mode 100644 ILSpy/Images/Open.xaml delete mode 100644 ILSpy/Images/Operator.svg delete mode 100644 ILSpy/Images/Operator.xaml delete mode 100644 ILSpy/Images/OverlayCompilerControlled.svg delete mode 100644 ILSpy/Images/OverlayCompilerControlled.xaml delete mode 100644 ILSpy/Images/OverlayExtension.svg delete mode 100644 ILSpy/Images/OverlayExtension.xaml delete mode 100644 ILSpy/Images/OverlayInternal.svg delete mode 100644 ILSpy/Images/OverlayInternal.xaml delete mode 100644 ILSpy/Images/OverlayPrivate.svg delete mode 100644 ILSpy/Images/OverlayPrivate.xaml delete mode 100644 ILSpy/Images/OverlayPrivateProtected.svg delete mode 100644 ILSpy/Images/OverlayPrivateProtected.xaml delete mode 100644 ILSpy/Images/OverlayProtected.svg delete mode 100644 ILSpy/Images/OverlayProtected.xaml delete mode 100644 ILSpy/Images/OverlayProtectedInternal.svg delete mode 100644 ILSpy/Images/OverlayProtectedInternal.xaml delete mode 100644 ILSpy/Images/OverlayStatic.svg delete mode 100644 ILSpy/Images/OverlayStatic.xaml delete mode 100644 ILSpy/Images/PInvokeMethod.svg delete mode 100644 ILSpy/Images/PInvokeMethod.xaml delete mode 100644 ILSpy/Images/ProgramDebugDatabase.svg delete mode 100644 ILSpy/Images/ProgramDebugDatabase.xaml delete mode 100644 ILSpy/Images/Property.svg delete mode 100644 ILSpy/Images/Property.xaml delete mode 100644 ILSpy/Images/README.md delete mode 100644 ILSpy/Images/ReferenceFolder.svg delete mode 100644 ILSpy/Images/ReferenceFolder.xaml delete mode 100644 ILSpy/Images/ReferenceOverlay.svg delete mode 100644 ILSpy/Images/ReferenceOverlay.xaml delete mode 100644 ILSpy/Images/Refresh.svg delete mode 100644 ILSpy/Images/Refresh.xaml delete mode 100644 ILSpy/Images/Resource.svg delete mode 100644 ILSpy/Images/Resource.xaml delete mode 100644 ILSpy/Images/ResourceImage.svg delete mode 100644 ILSpy/Images/ResourceImage.xaml delete mode 100644 ILSpy/Images/ResourceResourcesFile.svg delete mode 100644 ILSpy/Images/ResourceResourcesFile.xaml delete mode 100644 ILSpy/Images/ResourceXml.svg delete mode 100644 ILSpy/Images/ResourceXml.xaml delete mode 100644 ILSpy/Images/ResourceXsd.svg delete mode 100644 ILSpy/Images/ResourceXsd.xaml delete mode 100644 ILSpy/Images/ResourceXsl.svg delete mode 100644 ILSpy/Images/ResourceXsl.xaml delete mode 100644 ILSpy/Images/ResourceXslt.svg delete mode 100644 ILSpy/Images/ResourceXslt.xaml delete mode 100644 ILSpy/Images/ResultToJSON.svg delete mode 100644 ILSpy/Images/ResultToJSON.xaml delete mode 100644 ILSpy/Images/Save.svg delete mode 100644 ILSpy/Images/Save.xaml delete mode 100644 ILSpy/Images/Search.svg delete mode 100644 ILSpy/Images/Search.xaml delete mode 100644 ILSpy/Images/SearchMsdn.svg delete mode 100644 ILSpy/Images/SearchMsdn.xaml delete mode 100644 ILSpy/Images/ShowAll.svg delete mode 100644 ILSpy/Images/ShowAll.xaml delete mode 100644 ILSpy/Images/ShowPrivateInternal.svg delete mode 100644 ILSpy/Images/ShowPrivateInternal.xaml delete mode 100644 ILSpy/Images/ShowPublicOnly.svg delete mode 100644 ILSpy/Images/ShowPublicOnly.xaml delete mode 100644 ILSpy/Images/Sort.svg delete mode 100644 ILSpy/Images/Sort.xaml delete mode 100644 ILSpy/Images/Struct.svg delete mode 100644 ILSpy/Images/Struct.xaml delete mode 100644 ILSpy/Images/SubTypes.svg delete mode 100644 ILSpy/Images/SubTypes.xaml delete mode 100644 ILSpy/Images/SuperTypes.svg delete mode 100644 ILSpy/Images/SuperTypes.xaml delete mode 100644 ILSpy/Images/SwitchSourceOrTarget.svg delete mode 100644 ILSpy/Images/SwitchSourceOrTarget.xaml delete mode 100644 ILSpy/Images/TypeIcon.cs delete mode 100644 ILSpy/Images/ViewCode.svg delete mode 100644 ILSpy/Images/ViewCode.xaml delete mode 100644 ILSpy/Images/VirtualMethod.svg delete mode 100644 ILSpy/Images/VirtualMethod.xaml delete mode 100644 ILSpy/Images/Warning.svg delete mode 100644 ILSpy/Images/Warning.xaml delete mode 100644 ILSpy/Images/WebAssembly.svg delete mode 100644 ILSpy/Images/WebAssembly.xaml delete mode 100644 ILSpy/Images/WpfWindowsTreeNodeImagesProvider.cs delete mode 100644 ILSpy/Images/ZoomIn.svg delete mode 100644 ILSpy/Images/ZoomIn.xaml delete mode 100644 ILSpy/Images/ZoomOut.svg delete mode 100644 ILSpy/Images/ZoomOut.xaml delete mode 100644 ILSpy/LanguageSettings.cs delete mode 100644 ILSpy/Languages/CSharpBracketSearcher.cs delete mode 100644 ILSpy/Languages/CSharpHighlightingTokenWriter.cs delete mode 100644 ILSpy/Languages/CSharpILMixedLanguage.cs delete mode 100644 ILSpy/Languages/CSharpLanguage.cs delete mode 100644 ILSpy/Languages/CSharpLanguage.wpf.cs delete mode 100644 ILSpy/Languages/ILAstLanguage.cs delete mode 100644 ILSpy/Languages/ILLanguage.cs delete mode 100644 ILSpy/Languages/IResourceFileHandler.cs delete mode 100644 ILSpy/Languages/Language.cs delete mode 100644 ILSpy/Languages/LanguageService.cs delete mode 100644 ILSpy/MainWindow.xaml delete mode 100644 ILSpy/MainWindow.xaml.cs delete mode 100644 ILSpy/MainWindowViewModel.cs delete mode 100644 ILSpy/Metadata/CoffHeaderTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/AssemblyRefTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/AssemblyTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ClassLayoutTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ConstantTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/CustomAttributeTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/DeclSecurityTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/EventMapTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/EventTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ExportedTypeTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/FieldLayoutTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/FieldMarshalTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/FieldRVATableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/FieldTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/FileTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/GenericParamConstraintTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/GenericParamTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ImplMapTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/InterfaceImplTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ManifestResourceTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/MemberRefTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/MethodImplTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/MethodSemanticsTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/MethodSpecTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/MethodTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ModuleRefTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ModuleTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/NestedClassTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/ParamTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/PropertyMapTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/PropertyTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/PtrTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/StandAloneSigTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/TypeDefTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/TypeRefTableTreeNode.cs delete mode 100644 ILSpy/Metadata/CorTables/TypeSpecTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DataDirectoriesTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugDirectory/CodeViewTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugDirectory/DebugDirectoryEntryTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugDirectory/PdbChecksumTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugDirectoryTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugMetadataTablesTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/DocumentTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/ImportScopeTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/LocalConstantTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/LocalScopeTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/LocalVariableTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/MethodDebugInformationTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DebugTables/StateMachineMethodTableTreeNode.cs delete mode 100644 ILSpy/Metadata/DosHeaderTreeNode.cs delete mode 100644 ILSpy/Metadata/FlagsContentFilter.cs delete mode 100644 ILSpy/Metadata/FlagsFilterControl.xaml delete mode 100644 ILSpy/Metadata/FlagsFilterControl.xaml.cs delete mode 100644 ILSpy/Metadata/FlagsTooltip.xaml delete mode 100644 ILSpy/Metadata/FlagsTooltip.xaml.cs delete mode 100644 ILSpy/Metadata/GoToTokenCommand.cs delete mode 100644 ILSpy/Metadata/Heaps/BlobHeapTreeNode.cs delete mode 100644 ILSpy/Metadata/Heaps/GuidHeapTreeNode.cs delete mode 100644 ILSpy/Metadata/Heaps/StringHeapTreeNode.cs delete mode 100644 ILSpy/Metadata/Heaps/UserStringHeapTreeNode.cs delete mode 100644 ILSpy/Metadata/Helper.wpf.cs delete mode 100644 ILSpy/Metadata/Helpers.cs delete mode 100644 ILSpy/Metadata/HexFilterControl.ContentFilter.cs delete mode 100644 ILSpy/Metadata/HexFilterControl.xaml delete mode 100644 ILSpy/Metadata/HexFilterControl.xaml.cs delete mode 100644 ILSpy/Metadata/MetaDataGrid.cs delete mode 100644 ILSpy/Metadata/MetadataHeapTreeNode.cs delete mode 100644 ILSpy/Metadata/MetadataProtocolHandler.cs delete mode 100644 ILSpy/Metadata/MetadataTableTreeNode.cs delete mode 100644 ILSpy/Metadata/MetadataTableTreeNode.wpf.cs delete mode 100644 ILSpy/Metadata/MetadataTableViews.xaml delete mode 100644 ILSpy/Metadata/MetadataTableViews.xaml.cs delete mode 100644 ILSpy/Metadata/MetadataTablesTreeNode.cs delete mode 100644 ILSpy/Metadata/MetadataTreeNode.cs delete mode 100644 ILSpy/Metadata/OptionalHeaderTreeNode.cs delete mode 100644 ILSpy/NativeMethods.cs delete mode 100644 ILSpy/NavigationHistory.cs delete mode 100644 ILSpy/NavigationState.cs delete mode 100644 ILSpy/Options/DecompilerSettingsPanel.xaml delete mode 100644 ILSpy/Options/DecompilerSettingsPanel.xaml.cs delete mode 100644 ILSpy/Options/DecompilerSettingsViewModel.cs delete mode 100644 ILSpy/Options/DisplaySettings.cs delete mode 100644 ILSpy/Options/DisplaySettingsPanel.xaml delete mode 100644 ILSpy/Options/DisplaySettingsPanel.xaml.cs delete mode 100644 ILSpy/Options/DisplaySettingsViewModel.cs delete mode 100644 ILSpy/Options/ExportOptionPageAttribute.cs delete mode 100644 ILSpy/Options/IOptionPage.cs delete mode 100644 ILSpy/Options/IOptionsMetadata.cs delete mode 100644 ILSpy/Options/MiscSettings.cs delete mode 100644 ILSpy/Options/MiscSettingsPanel.xaml delete mode 100644 ILSpy/Options/MiscSettingsPanel.xaml.cs delete mode 100644 ILSpy/Options/MiscSettingsViewModel.cs delete mode 100644 ILSpy/Options/OptionsDialog.xaml delete mode 100644 ILSpy/Options/OptionsDialog.xaml.cs delete mode 100644 ILSpy/Options/OptionsDialogViewModel.cs delete mode 100644 ILSpy/Options/ShowOptionsCommand.cs delete mode 100644 ILSpy/Properties/AssemblyInfo.cs delete mode 100644 ILSpy/Properties/Resources.Designer.cs delete mode 100644 ILSpy/Properties/Resources.resx delete mode 100644 ILSpy/Properties/WPFAssemblyInfo.cs delete mode 100644 ILSpy/Properties/launchSettings.json delete mode 100644 ILSpy/Search/SearchPane.xaml delete mode 100644 ILSpy/Search/SearchPane.xaml.cs delete mode 100644 ILSpy/Search/SearchPaneModel.cs delete mode 100644 ILSpy/Search/SearchResultFactory.cs delete mode 100644 ILSpy/Search/ShowSearchCommand.cs delete mode 100644 ILSpy/SessionSettings.cs delete mode 100644 ILSpy/SmartTextOutputExtensions.cs delete mode 100644 ILSpy/SolutionWriter.cs delete mode 100644 ILSpy/TaskHelper.cs delete mode 100644 ILSpy/TextView/Asm-Mode.xshd delete mode 100644 ILSpy/TextView/AvalonEditTextOutput.cs delete mode 100644 ILSpy/TextView/BracketHighlightRenderer.cs delete mode 100644 ILSpy/TextView/BracketSearchResult.cs delete mode 100644 ILSpy/TextView/CSharp-Mode.xshd delete mode 100644 ILSpy/TextView/CaretHighlightAdorner.cs delete mode 100644 ILSpy/TextView/DecompilerTextEditor.cs delete mode 100644 ILSpy/TextView/DecompilerTextView.cs delete mode 100644 ILSpy/TextView/DecompilerTextView.xaml delete mode 100644 ILSpy/TextView/DefaultBracketSearcher.cs delete mode 100644 ILSpy/TextView/DocumentationUIBuilder.cs delete mode 100644 ILSpy/TextView/EditorCommands.cs delete mode 100644 ILSpy/TextView/FoldingCommands.cs delete mode 100644 ILSpy/TextView/IBracketSearcher.cs delete mode 100644 ILSpy/TextView/ILAsm-Mode.xshd delete mode 100644 ILSpy/TextView/OutputLengthExceededException.cs delete mode 100644 ILSpy/TextView/ReferenceElementGenerator.cs delete mode 100644 ILSpy/TextView/ThemeAwareHighlightingColorizer.cs delete mode 100644 ILSpy/TextView/UIElementGenerator.cs delete mode 100644 ILSpy/TextView/ViewState.cs delete mode 100644 ILSpy/TextView/VisualLineReferenceText.cs delete mode 100644 ILSpy/TextView/VisualLineReferenceText.wpf.cs delete mode 100644 ILSpy/TextView/XML-Mode.xshd delete mode 100644 ILSpy/TextView/ZoomLevelToTextFormattingModeConverter.cs delete mode 100644 ILSpy/Themes/Base.Dark.xaml delete mode 100644 ILSpy/Themes/Base.Light.xaml delete mode 100644 ILSpy/Themes/ResourceKeys.cs delete mode 100644 ILSpy/Themes/SyntaxColor.cs delete mode 100644 ILSpy/Themes/Theme.Dark.xaml delete mode 100644 ILSpy/Themes/Theme.Light.xaml delete mode 100644 ILSpy/Themes/Theme.RSharpDark.xaml delete mode 100644 ILSpy/Themes/Theme.RSharpLight.xaml delete mode 100644 ILSpy/Themes/Theme.VSCodeDarkPlus.xaml delete mode 100644 ILSpy/Themes/Theme.VSCodeLightPlus.xaml delete mode 100644 ILSpy/Themes/ThemeManager.cs delete mode 100644 ILSpy/Themes/WindowStyleManagerBehavior.cs delete mode 100644 ILSpy/Themes/generic.xaml delete mode 100644 ILSpy/TreeNodes/AssemblyListTreeNode.cs delete mode 100644 ILSpy/TreeNodes/AssemblyReferenceReferencedTypesTreeNode.cs delete mode 100644 ILSpy/TreeNodes/AssemblyReferenceTreeNode.cs delete mode 100644 ILSpy/TreeNodes/AssemblyTreeNode.cs delete mode 100644 ILSpy/TreeNodes/BaseTypesEntryNode.cs delete mode 100644 ILSpy/TreeNodes/BaseTypesTreeNode.cs delete mode 100644 ILSpy/TreeNodes/DerivedTypesEntryNode.cs delete mode 100644 ILSpy/TreeNodes/DerivedTypesTreeNode.cs delete mode 100644 ILSpy/TreeNodes/EventTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ExportedTypeTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ExtensionTreeNode.cs delete mode 100644 ILSpy/TreeNodes/FieldTreeNode.cs delete mode 100644 ILSpy/TreeNodes/FilterResult.cs delete mode 100644 ILSpy/TreeNodes/ILSpyTreeNode.cs delete mode 100644 ILSpy/TreeNodes/IMemberTreeNode.cs delete mode 100644 ILSpy/TreeNodes/MemberReferenceTreeNode.cs delete mode 100644 ILSpy/TreeNodes/MethodTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ModuleReferenceTreeNode.cs delete mode 100644 ILSpy/TreeNodes/NamespaceTreeNode.cs delete mode 100644 ILSpy/TreeNodes/NaturalStringComparer.cs delete mode 100644 ILSpy/TreeNodes/PackageFolderTreeNode.cs delete mode 100644 ILSpy/TreeNodes/PropertyTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ReferenceFolderTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceListTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/CursorResourceEntryNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/IResourceNodeFactory.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/IconResourceEntryNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/ImageListResourceEntryNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/ImageResourceEntryNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/ImageResourceEntryNode.wpf.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/ResourceEntryNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/ResourceTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/ResourcesFileTreeNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/XamlResourceNode.cs delete mode 100644 ILSpy/TreeNodes/ResourceNodes/XmlResourceNode.cs delete mode 100644 ILSpy/TreeNodes/ThreadingSupport.cs delete mode 100644 ILSpy/TreeNodes/TypeReferenceTreeNode.cs delete mode 100644 ILSpy/TreeNodes/TypeTreeNode.cs delete mode 100644 ILSpy/Updates/AppUpdateService.cs delete mode 100644 ILSpy/Updates/AvailableVersionInfo.cs delete mode 100644 ILSpy/Updates/UpdateService.cs delete mode 100644 ILSpy/Updates/UpdateSettings.cs delete mode 100644 ILSpy/Util/GlobalUtils.cs delete mode 100644 ILSpy/Util/GlobalUtils.wpf.cs delete mode 100644 ILSpy/Util/GraphVizGraph.cs delete mode 100644 ILSpy/Util/MessageBus.cs delete mode 100644 ILSpy/Util/ResourceHelper.cs delete mode 100644 ILSpy/Util/SettingsService.cs delete mode 100644 ILSpy/Util/ShellHelper.cs delete mode 100644 ILSpy/ViewModels/CompareViewModel.cs delete mode 100644 ILSpy/ViewModels/DebugStepsPaneModel.cs delete mode 100644 ILSpy/ViewModels/LegacyToolPaneModel.cs delete mode 100644 ILSpy/ViewModels/ManageAssemblyListsViewModel.cs delete mode 100644 ILSpy/ViewModels/Pane.cs delete mode 100644 ILSpy/ViewModels/PaneModel.cs delete mode 100644 ILSpy/ViewModels/TabPageModel.cs delete mode 100644 ILSpy/ViewModels/TabPageModelExtensions.cs delete mode 100644 ILSpy/ViewModels/TabPageModelExtensions.wpf.cs delete mode 100644 ILSpy/ViewModels/ToolPaneModel.cs delete mode 100644 ILSpy/ViewModels/UpdatePanelViewModel.cs delete mode 100644 ILSpy/Views/CompareView.xaml delete mode 100644 ILSpy/Views/CompareView.xaml.cs delete mode 100644 ILSpy/Views/CreateListDialog.xaml delete mode 100644 ILSpy/Views/CreateListDialog.xaml.cs delete mode 100644 ILSpy/Views/DebugSteps.xaml delete mode 100644 ILSpy/Views/DebugSteps.xaml.cs delete mode 100644 ILSpy/Views/GacEntry.cs delete mode 100644 ILSpy/Views/ManageAssemblyLIstsDialog.xaml.cs delete mode 100644 ILSpy/Views/ManageAssemblyListsDialog.xaml delete mode 100644 ILSpy/Views/OpenFromGacDialog.xaml delete mode 100644 ILSpy/Views/OpenFromGacDialog.xaml.cs delete mode 100644 ILSpy/Views/UpdatePanel.xaml delete mode 100644 ILSpy/Views/UpdatePanel.xaml.cs delete mode 100644 ILSpy/app.manifest diff --git a/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj b/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj index 3807571cf..3ed5470e6 100644 --- a/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj +++ b/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj @@ -11,6 +11,10 @@ + + diff --git a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj index d388d459a..a1609b05a 100644 --- a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj +++ b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj @@ -81,7 +81,7 @@ - + diff --git a/ILSpy/Images/ILSpy.ico b/ICSharpCode.ILSpyX/MermaidDiagrammer/html/ILSpy.ico similarity index 100% rename from ILSpy/Images/ILSpy.ico rename to ICSharpCode.ILSpyX/MermaidDiagrammer/html/ILSpy.ico diff --git a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj index b966a2f49..7b15c728a 100644 --- a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj +++ b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj @@ -46,8 +46,6 @@ - - diff --git a/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs b/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs deleted file mode 100644 index 5e2003192..000000000 --- a/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.BamlDecompiler; -using ICSharpCode.ILSpy; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ILSpy.BamlDecompiler -{ - public sealed class BamlResourceEntryNode : ResourceEntryNode - { - public BamlResourceEntryNode(string key, Func data) : base(key, data) - { - } - - public override bool View(TabPageModel tabPage) - { - IHighlightingDefinition highlighting = null; - - tabPage.SupportsLanguageSwitching = false; - tabPage.ShowTextView(textView => textView.RunWithCancellation( - token => Task.Factory.StartNew( - () => { - AvalonEditTextOutput output = new AvalonEditTextOutput(); - try - { - LoadBaml(output, token); - highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml"); - } - catch (Exception ex) - { - output.Write(ex.ToString()); - } - return output; - }, token)) - .Then(output => textView.ShowNode(output, this, highlighting)) - .HandleExceptions()); - return true; - } - - void LoadBaml(AvalonEditTextOutput output, CancellationToken cancellationToken) - { - var asm = this.Ancestors().OfType().First().LoadedAssembly; - using var data = OpenStream(); - BamlDecompilerTypeSystem typeSystem = new BamlDecompilerTypeSystem(asm.GetMetadataFileOrNull(), asm.GetAssemblyResolver()); - var decompiler = new XamlDecompiler(typeSystem, new BamlDecompilerSettings()); - decompiler.CancellationToken = cancellationToken; - var result = decompiler.Decompile(data); - output.Write(result.Xaml.ToString()); - } - } -} diff --git a/ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs b/ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs deleted file mode 100644 index 151885b16..000000000 --- a/ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Composition; -using System.IO; - -using ICSharpCode.BamlDecompiler; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp.ProjectDecompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Abstractions; - -namespace ILSpy.BamlDecompiler -{ - [Export(typeof(IResourceNodeFactory))] - [Shared] - public sealed class BamlResourceNodeFactory : IResourceNodeFactory - { - public ITreeNode CreateNode(Resource resource) - { - if (resource.Name.EndsWith(".baml", StringComparison.OrdinalIgnoreCase)) - return new BamlResourceEntryNode(resource.Name, resource.TryOpenStream); - else - return null; - } - } - - [Export(typeof(IResourceFileHandler))] - [Shared] - public sealed class BamlResourceFileHandler : IResourceFileHandler - { - public string EntryType => "Page"; - public bool CanHandle(string name, ResourceFileHandlerContext context) => name.EndsWith(".baml", StringComparison.OrdinalIgnoreCase); - - public string WriteResourceToFile(LoadedAssembly assembly, string fileName, Stream stream, ResourceFileHandlerContext context) - { - BamlDecompilerTypeSystem typeSystem = new BamlDecompilerTypeSystem(assembly.GetMetadataFileOrNull(), assembly.GetAssemblyResolver()); - var decompiler = new XamlDecompiler(typeSystem, new BamlDecompilerSettings() { - ThrowOnAssemblyResolveErrors = context.DecompilationOptions.DecompilerSettings.ThrowOnAssemblyResolveErrors - }); - decompiler.CancellationToken = context.DecompilationOptions.CancellationToken; - var result = decompiler.Decompile(stream); - var typeDefinition = result.TypeName.HasValue ? typeSystem.MainModule.GetTypeDefinition(result.TypeName.Value.TopLevelTypeName) : null; - if (typeDefinition != null) - { - fileName = WholeProjectDecompiler.SanitizeFileName(typeDefinition.ReflectionName + ".xaml"); - var partialTypeInfo = new PartialTypeInfo(typeDefinition); - foreach (var member in result.GeneratedMembers) - { - partialTypeInfo.AddDeclaredMember(member); - } - context.AddPartialTypeInfo(partialTypeInfo); - } - else - { - fileName = Path.ChangeExtension(fileName, ".xaml"); - } - context.AdditionalProperties.Add("Generator", "MSBuild:Compile"); - context.AdditionalProperties.Add("SubType", "Designer"); - string saveFileName = Path.Combine(context.DecompilationOptions.SaveAsProjectDirectory, fileName); - Directory.CreateDirectory(Path.GetDirectoryName(saveFileName)); - result.Xaml.Save(saveFileName); - return fileName; - } - } -} diff --git a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj deleted file mode 100644 index f7e3d7059..000000000 --- a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - ILSpy.BamlDecompiler.Plugin - net10.0-windows - win-x64;win-arm64 - false - False - 6488064 - true - true - - - - full - true - True - - - - pdbonly - true - - - - ..\ILSpy\bin\$(Configuration)\ - - - - - - - - - \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs b/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs deleted file mode 100644 index 4fbbcee16..000000000 --- a/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region Using directives - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Versioning; - -#endregion - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ILSpy.BamlDecompiler.Plugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ILSpy.BamlDecompiler.Plugin")] -[assembly: AssemblyCopyright("Copyright 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] -[assembly: TargetPlatform("Windows10.0")] -[assembly: SupportedOSPlatform("Windows7.0")] - -[assembly: InternalsVisibleTo("ILSpy.BamlDecompiler.Tests")] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all the values or you can use the default the Revision and -// Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] diff --git a/ILSpy.BamlDecompiler/Properties/launchSettings.json b/ILSpy.BamlDecompiler/Properties/launchSettings.json deleted file mode 100644 index 93c6637b2..000000000 --- a/ILSpy.BamlDecompiler/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "ILSpy.BamlDecompiler": { - "commandName": "Executable", - "executablePath": "$(SolutionDir)\\ILSpy\\bin\\Debug\\net6.0-windows\\ILSpy.exe", - "commandLineArgs": "/separate" - } - } -} \ No newline at end of file diff --git a/ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs b/ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs deleted file mode 100644 index b255e7fa7..000000000 --- a/ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2024 Yuriy Zatuchnyy -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Linq; -using System.Threading.Tasks; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp.Resolver; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpyX.Analyzers; - -using NUnit.Framework; - -namespace ICSharpCode.ILSpy.Tests.Analyzers -{ - [TestFixture] - public class AnalyzerScopeTests - { - public class TestClass - { - - } - - [Test] - public void WhenPublicNestedClass_ThenNotInfiniteLoop() - { - // Given - ILSpyX.AssemblyList assemblyList = new ILSpyX.AssemblyList(); - var file = new PEFile(this.GetType().Assembly.Location); - var td = file.Metadata.TypeDefinitions.First(td => td.GetFullTypeName(file.Metadata).Name == nameof(TestClass)); - - Decompiler.Metadata.IAssemblyResolver assemblyResolver = new UniversalAssemblyResolver(null, false, null); - ICompilation compilation = new DecompilerTypeSystem(file, assemblyResolver); - ITypeResolveContext context = new CSharpResolver(compilation); - var module = ((IModuleReference)file).Resolve(context) as MetadataModule; - IEntity entity = module.GetDefinition(td); - - // When - var task = Task.Run(() => { - var target = new AnalyzerScope(assemblyList, entity); - }); - - var result = Task.WaitAny(new[] { task, Task.Delay(500) }); // 0.5 seconds - - // Then - Assert.That(result == 0, "The constructor should complete in less than 10 seconds"); - } - - } -} diff --git a/ILSpy.Tests/Analyzers/ExportAnalyzerAttributeTests.cs b/ILSpy.Tests/Analyzers/ExportAnalyzerAttributeTests.cs deleted file mode 100644 index c8e3af599..000000000 --- a/ILSpy.Tests/Analyzers/ExportAnalyzerAttributeTests.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2024 Andreas Weizel -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Linq; - -using ICSharpCode.ILSpyX.Analyzers; - -using NUnit.Framework; - -namespace ICSharpCode.ILSpy.Tests.Analyzers -{ - [TestFixture] - public class ExportAnalyzerAttributeTests - { - [Test] - public void CollectAnalyzers() - { - var analyzerNames = ExportAnalyzerAttribute.GetAnnotatedAnalyzers() - .Select(analyzer => analyzer.AnalyzerType.Name) - .ToArray(); - Assert.That(analyzerNames.Contains("AttributeAppliedToAnalyzer")); - Assert.That(analyzerNames.Contains("EventImplementedByAnalyzer")); - Assert.That(analyzerNames.Contains("MethodUsedByAnalyzer")); - Assert.That(analyzerNames.Contains("PropertyOverriddenByAnalyzer")); - Assert.That(analyzerNames.Contains("TypeInstantiatedByAnalyzer")); - } - } -} diff --git a/ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs b/ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs deleted file mode 100644 index a7077bcd3..000000000 --- a/ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) 2020 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.IO; -using System.Linq; -using System.Reflection.Metadata; -using System.Reflection.PortableExecutable; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.Decompiler.TypeSystem.Implementation; -using ICSharpCode.ILSpyX.Analyzers; -using ICSharpCode.ILSpyX.Analyzers.Builtin; - -using NSubstitute; - -using NUnit.Framework; - -namespace ICSharpCode.ILSpy.Tests.Analyzers -{ - [TestFixture] - public class MemberImplementsInterfaceAnalyzerTests - { - static readonly SymbolKind[] ValidSymbolKinds = { SymbolKind.Event, SymbolKind.Indexer, SymbolKind.Method, SymbolKind.Property }; - static readonly SymbolKind[] InvalidSymbolKinds = - Enum.GetValues(typeof(SymbolKind)).Cast().Except(ValidSymbolKinds).ToArray(); - - static readonly TypeKind[] ValidTypeKinds = { TypeKind.Class, TypeKind.Struct }; - static readonly TypeKind[] InvalidTypeKinds = Enum.GetValues(typeof(TypeKind)).Cast().Except(ValidTypeKinds).ToArray(); - - private ICompilation testAssembly; - - [OneTimeSetUp] - public void Setup() - { - string fileName = GetType().Assembly.Location; - - using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read)) - { - var module = new PEFile(fileName, stream, PEStreamOptions.PrefetchEntireImage, MetadataReaderOptions.None); - - testAssembly = new SimpleCompilation(module.WithOptions(TypeSystemOptions.Default), MinimalCorlib.Instance); - } - } - - [Test] - public void VerifyDoesNotShowForNoSymbol() - { - // Arrange - var analyzer = new MemberImplementsInterfaceAnalyzer(); - - // Act - var shouldShow = analyzer.Show(symbol: null); - - // Assert - Assert.That(!shouldShow, $"The analyzer will be unexpectedly shown for no symbol"); - } - - [Test] - [TestCaseSource(nameof(InvalidSymbolKinds))] - public void VerifyDoesNotShowForNonMembers(SymbolKind symbolKind) - { - // Arrange - var symbolMock = Substitute.For(); - symbolMock.SymbolKind.Returns(symbolKind); - var analyzer = new MemberImplementsInterfaceAnalyzer(); - - // Act - var shouldShow = analyzer.Show(symbolMock); - - // Assert - Assert.That(!shouldShow, $"The analyzer will be unexpectedly shown for symbol '{symbolKind}'"); - } - - [Test] - [TestCaseSource(nameof(ValidSymbolKinds))] - public void VerifyDoesNotShowForStaticMembers(SymbolKind symbolKind) - { - // Arrange - var memberMock = SetupMemberMock(symbolKind, TypeKind.Unknown, isStatic: true); - var analyzer = new MemberImplementsInterfaceAnalyzer(); - - // Act - var shouldShow = analyzer.Show(memberMock); - - // Assert - Assert.That(!shouldShow, $"The analyzer will be unexpectedly shown for static symbol '{symbolKind}'"); - } - - [Test] - [Pairwise] - public void VerifyDoesNotShowForUnsupportedTypes( - [ValueSource(nameof(ValidSymbolKinds))] SymbolKind symbolKind, - [ValueSource(nameof(InvalidTypeKinds))] TypeKind typeKind) - { - // Arrange - var memberMock = SetupMemberMock(symbolKind, typeKind, isStatic: true); - var analyzer = new MemberImplementsInterfaceAnalyzer(); - - // Act - var shouldShow = analyzer.Show(memberMock); - - // Assert - Assert.That(!shouldShow, $"The analyzer will be unexpectedly shown for symbol '{symbolKind}' and '{typeKind}'"); - } - - [Test] - [Pairwise] - public void VerifyShowsForSupportedTypes( - [ValueSource(nameof(ValidSymbolKinds))] SymbolKind symbolKind, - [ValueSource(nameof(ValidTypeKinds))] TypeKind typeKind) - { - // Arrange - var memberMock = SetupMemberMock(symbolKind, typeKind, isStatic: false); - var analyzer = new MemberImplementsInterfaceAnalyzer(); - - // Act - var shouldShow = analyzer.Show(memberMock); - - // Assert - Assert.That(shouldShow, $"The analyzer will not be shown for symbol '{symbolKind}' and '{typeKind}'"); - } - - [Test] - public void VerifyReturnsOnlyInterfaceMembers() - { - // Arrange - var symbol = SetupSymbolForAnalysis(typeof(TestClass), nameof(TestClass.TestMethod)); - var analyzer = new MemberImplementsInterfaceAnalyzer(); - - // Act - var results = analyzer.Analyze(symbol, new AnalyzerContext() { AssemblyList = new ILSpyX.AssemblyList(), Language = new CSharpLanguage() }); - - // Assert - Assert.That(results, Is.Not.Null); - Assert.That(results.Count(), Is.EqualTo(1)); - var result = results.FirstOrDefault() as IMethod; - Assert.That(result, Is.Not.Null); - Assert.That(result.DeclaringTypeDefinition, Is.Not.Null); - Assert.That(result.DeclaringTypeDefinition.Kind, Is.EqualTo(TypeKind.Interface)); - Assert.That(result.DeclaringTypeDefinition.Name, Is.EqualTo(nameof(ITestInterface))); - } - - private ISymbol SetupSymbolForAnalysis(Type type, string methodName) - { - var typeDefinition = testAssembly.FindType(type).GetDefinition(); - return typeDefinition.Methods.First(m => m.Name == methodName); - } - - private static IMember SetupMemberMock(SymbolKind symbolKind, TypeKind typeKind, bool isStatic) - { - var memberMock = Substitute.For(); - memberMock.SymbolKind.Returns(symbolKind); - memberMock.DeclaringTypeDefinition.Kind.Returns(typeKind); - memberMock.IsStatic.Returns(isStatic); - return memberMock; - } - - private interface ITestInterface - { - void TestMethod(); - } - - private class BaseClass - { - public virtual void TestMethod() => throw new NotImplementedException(); - } - - private class TestClass : BaseClass, ITestInterface - { - public override void TestMethod() => throw new NotImplementedException(); - } - } -} diff --git a/ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs b/ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs deleted file mode 100644 index c58cf41a9..000000000 --- a/ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Analyzers; -using ICSharpCode.ILSpyX.Analyzers.Builtin; - -using NUnit.Framework; - -namespace ICSharpCode.ILSpy.Tests.Analyzers -{ - [TestFixture] - public class MethodUsesAnalyzerTests - { - AssemblyList assemblyList; - CSharpLanguage language; - LoadedAssembly testAssembly; - ICompilation testAssemblyTypeSystem; - ITypeDefinition typeDefinition; - - [OneTimeSetUp] - public void Setup() - { - assemblyList = new AssemblyList(); - testAssembly = assemblyList.OpenAssembly(typeof(MethodUsesAnalyzerTests).Assembly.Location); - assemblyList.OpenAssembly(typeof(void).Assembly.Location); - testAssemblyTypeSystem = testAssembly.GetTypeSystemOrNull(); - language = new CSharpLanguage(); - typeDefinition = testAssemblyTypeSystem.FindType(typeof(TestCases.Main.MainAssembly)).GetDefinition(); - } - - [Test] - public void MainAssemblyUsesSystemStringEmpty() - { - var context = new AnalyzerContext { AssemblyList = assemblyList, Language = language }; - IMethod symbol = typeDefinition.Methods.First(m => m.Name == "UsesSystemStringEmpty"); - - var results = new MethodUsesAnalyzer().Analyze(symbol, context).ToList(); - - Assert.That(results.Count == 1); - var field = results.Single() as IField; - Assert.That(field, Is.Not.Null); - Assert.That(!field.MetadataToken.IsNil); - Assert.That("System.String.Empty", Is.EqualTo(field.FullName)); - } - } -} diff --git a/ILSpy.Tests/Analyzers/TestCases/MainAssembly.cs b/ILSpy.Tests/Analyzers/TestCases/MainAssembly.cs deleted file mode 100644 index b9228310b..000000000 --- a/ILSpy.Tests/Analyzers/TestCases/MainAssembly.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ICSharpCode.ILSpy.Tests.Analyzers.TestCases.Main -{ - class MainAssembly - { - public string UsesSystemStringEmpty() - { - return string.Empty; - } - - public int UsesInt32() - { - return int.Parse("1234"); - } - } -} diff --git a/ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs b/ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs deleted file mode 100644 index 637165e8d..000000000 --- a/ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2020 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Linq; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Analyzers; -using ICSharpCode.ILSpyX.Analyzers.Builtin; - -using NUnit.Framework; - -namespace ICSharpCode.ILSpy.Tests.Analyzers -{ - [TestFixture] - public class TypeUsedByAnalyzerTests - { - AssemblyList assemblyList; - CSharpLanguage language; - LoadedAssembly testAssembly; - ICompilation testAssemblyTypeSystem; - - [OneTimeSetUp] - public void Setup() - { - assemblyList = new AssemblyList(); - testAssembly = assemblyList.OpenAssembly(typeof(MethodUsesAnalyzerTests).Assembly.Location); - testAssemblyTypeSystem = new DecompilerTypeSystem(testAssembly.GetMetadataFileOrNull(), testAssembly.GetAssemblyResolver()); - language = new CSharpLanguage(); - } - - [Test] - public void SystemInt32UsedByMainAssembly() - { - var context = new AnalyzerContext { AssemblyList = assemblyList, Language = language }; - var symbol = testAssemblyTypeSystem.FindType(typeof(int)).GetDefinition(); - - var results = new TypeUsedByAnalyzer().Analyze(symbol, context).ToList(); - - Assert.That(results, Is.Not.Empty); - var method = results.OfType().SingleOrDefault(m => m.FullName == "ICSharpCode.ILSpy.Tests.Analyzers.TestCases.Main.MainAssembly.UsesInt32"); - Assert.That(method, Is.Not.Null); - Assert.That(!method.MetadataToken.IsNil); - } - } -} diff --git a/ILSpy.Tests/BitmapContainer.resources b/ILSpy.Tests/BitmapContainer.resources deleted file mode 100644 index d50495a740af107b61c9116f76979842e1b45b66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1158 zcmX?i>is@O1_p+SK%5g?SzMBus~417oL^d$oLUTL1*ImYq!#HYR*8GxXUf^%t3Noi54ZC+|=Nl{{sjzU0bQch;FcWPxwes*e}ZIZcpqG__J znW3ezNveT`r81^vrFkWpxv4PQgHubGfQ|w=4umtH>RpNw%QN%R^_((GauW-56i|i9 zahQQ|nrWJOnxSEesX?M~Vt}Iy5KUh5cPY?T22-HjJe~}>42cZs45Al2Q%3Nl|5)mW&{K{6~Zi6x2bOdz{CnSlg9h*$^YGIa*{x$|;KaRK?f zo*phiK-vI=IY4S}B;;KHQY`6?zK#qG8~eHcB(eheoCO|{#S9F5he4R}c>anMpg{qi zE{-7)?r*0V_8l@1aJ_sX;KGGQmu4XBT#;ePt^R;#${eObZk2NfBRA>)OiP(4pnlLr zT62BJvBw*qzpuzK^ZYN_yg&emY6Z5$=uH;C{`zX=?nN;dKL0FfK7WNL+smHy;lnp2 z9nU{U%JK5IGds^dI)A;#N8!%pFBh^`Wo(SF(7rFVP(n=YZvS!TO$`#7$CA&vv1qC6 ze({kv^w0#peH>@SOjP<7ye!FLTx9LI_~MJAohu}cKc1+0bHmLX5$1`kJ9#{fX8O#T zs&c7i!QZ<6LaVt2eaDmkgm@S((CgDYaeRI62iqGZwuh4$LBBj2*H)uG+XSGWk= zKKuOhucjZLJXUGhy}7(qVQEUm?z3AMM3mig&aqisbLCP2vigo?&?1cW2_>xaevjH?O@dRV@2Q`vIOZ0XIu}aPNKSR - - - - true - true - - - - net11.0-windows - false - win-x64 - win-arm64 - Exe - - True - - $(NoWarn);1701;1702;1705,67,169,1058,728,1720,649,168,251 - - false - - ICSharpCode.ILSpy.Tests - True - - True - ..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk - - - - full - true - - - - pdbonly - true - - - - TRACE;DEBUG;NET46;ROSLYN;CS60;CS70 - - - - - - - - - - - - - - - - - - - ResXCodeGenerator - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy.Tests/Icon.ico b/ILSpy.Tests/Icon.ico deleted file mode 100644 index 5d06b9f2857b39f0b5d3395e3e7999ba6bcc3a38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45451 zcmeHQ2V4`$_n!>`f|LYoh=qWPSiy=FB49<4^YlDC1oTw&lwubJvRJ^5oLDFdo((IW z*bpR96!ApE*^r{)4iE(uM5G8w{xgB)x2_3AY2KgtFnKfc-n{pHZ`JR%LyWA^>Ijs5h#!!DKZ6<{ARP;Z)WQ z%>g()gwV$Z;XMI(w3^Td>rl`75JDdtETRL@{VV`mZLBA#x6x?>)v8aLXgM8elUh`Q z#BO=`LR4EZeS$eS_n^ybSfM+OojMkPKmAlI=0Z$B#ciVP3IH_XP{!`KhR+9}P530s zu`|}%zkP1CsB3a3{`*Xq&9AyUKAzJjCUVX{?Yi7cqHm<1?do<=St)r4DzgMu3+ z8%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RYI z=s)rstD*{3RJn>WtEg@jHLIdrNKxFR@s!T)BE^*wXEaZX4KoL3;{W;JELdqxwMGD* zlhO4>2y;VSC(*SEuhlRVfO0ksXqSq=Rt(U#)Ng-(f4R?!>pQ+gx~hE2uPp|I@Ab7& zn>?YnzV@m2iS?}$xW0G$gdeq0YJ3R!Z}p$hL;XH9dXGx}4m7e)$dbzqWuJJLg}y~c ze5aQDPK#`lTy7})Kg#5HQbZd;iC8q0ee}+h&`r>q-lI08{hHp3%6kvmkoE~( zHGPv0#e|R}mm4bngl>7?#3S1zmmAtXfrCnsO>!pq-)f(%vp(fk`<36jYKZs~u_VWz z+(wjT(dM*IUK`t(*MC`llWoHogf^x9`r1a=i0wr9Lf+Q3m5DxxevR#hvj4TVW!WeD zRG0F%*siiK9e*P|b+Jd5`BvLi_R+l$F<$>#>W6fFZG!gEJ&-gGUxCH(YwiAj>?eI} z0Dns1YB0D2jM=~$=`@3x3$vsEKJh4kYuQTCI<~5Wo>Q=3X2VQ8r{K_GrIAv7_a`b0 z)SrCJ)l^2Z^7_~1Tv}UyVjN0Pq!ZyGXl?z8?`g{#S0g<&^(W5(MfR!xv!J&Ag#Tph z1a5-XWS{6SYkq2d`V)Gnv@ZC`u_kPyHX_#rKiMwP57DY~`4`VikWR!W_an+gf1)px vHI}#k5wcVo5)y*8y8vc3wJ)k8`?X}$7ah_Kn$R;(zCt~-GL&alJ}>=0A=}t% diff --git a/ILSpy.Tests/IconContainer.resx b/ILSpy.Tests/IconContainer.resx deleted file mode 100644 index 842140e25..000000000 --- a/ILSpy.Tests/IconContainer.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/ILSpy.Tests/ResourceReaderWriterTests.cs b/ILSpy.Tests/ResourceReaderWriterTests.cs deleted file mode 100644 index bc15fa8bf..000000000 --- a/ILSpy.Tests/ResourceReaderWriterTests.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) 2023 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Xml.Linq; -using System.Xml.XPath; - -using ICSharpCode.Decompiler.Util; - -using NUnit.Framework; -using NUnit.Framework.Internal; - -using TomsToolbox.Essentials; - -namespace ICSharpCode.ILSpy.Tests -{ - [TestFixture] - public class ResourceReaderWriterTests - { - const string winFormsAssemblyName = ", System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; - const string msCorLibAssemblyName = ", mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; - const string drawingAssemblyName = ", System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - - [Serializable] - public class SerializableClass - { - public string Name { get; set; } - public int Age { get; set; } - } - - static readonly object[][] testWriteCases = { - new object[] { "Decimal", 1.0m, "1.0", "System.Decimal" + msCorLibAssemblyName }, - new object[] { "TimeSpan", TimeSpan.FromSeconds(42), "00:00:42", "System.TimeSpan" + msCorLibAssemblyName }, - new object[] { "DateTime", DateTime.Parse("06/18/2023 21:36:30", CultureInfo.InvariantCulture), "06/18/2023 21:36:30", "System.DateTime" + msCorLibAssemblyName }, - }; - - static readonly object[][] testReadCases = { - new object[] { "Decimal", 1.0m }, - new object[] { "TimeSpan", TimeSpan.FromSeconds(42) }, - new object[] { "DateTime", DateTime.Parse("06/18/2023 21:36:30", CultureInfo.InvariantCulture) }, - }; - - static Stream GetResource(string fileName) - { - return typeof(ResourceReaderWriterTests).Assembly.GetManifestResourceStream(typeof(ResourceReaderWriterTests).Namespace + "." + fileName); - } - - static MemoryStream ProduceResourcesTestFile(string name, T value) - { - var ms = new MemoryStream(); - var writer = new System.Resources.ResourceWriter(ms); - writer.AddResource(name, value); - writer.Generate(); - ms.Position = 0; - return ms; - } - - static XElement ProduceResXTest(string name, T value) - { - using var ms = new MemoryStream(); - var writer = new Decompiler.Util.ResXResourceWriter(ms); - writer.AddResource(name, value); - writer.Generate(); - ms.Position = 0; - var doc = XDocument.Load(ms); - return doc.XPathSelectElement(".//data"); - } - - [TestCase("Null", null)] - [TestCase("String", "Hello World!")] - [TestCase("Char", 'A')] - [TestCase("Bool", true)] - [TestCase("Bool", false)] - [TestCase("Byte", (byte)1)] - [TestCase("SByte", (sbyte)-1)] - [TestCase("Int16", (short)1)] - [TestCase("UInt16", (ushort)1)] - [TestCase("Int32", 1)] - [TestCase("UInt32", (uint)1)] - [TestCase("Int64", (long)1)] - [TestCase("UInt64", (ulong)1)] - [TestCase("Single", 1.0f)] - [TestCase("Double", 1.0d)] - [TestCase("Bytes", new byte[] { 42, 43, 44 })] - [TestCaseSource(nameof(testReadCases))] - public void Read(string name, object value) - { - using var testFile = ProduceResourcesTestFile(name, value); - using var reader = new ResourcesFile(testFile); - var items = reader.ToArray(); - Assert.That(items.Length, Is.EqualTo(1)); - Assert.That(items[0].Key, Is.EqualTo(name)); - Assert.That(items[0].Value, Is.EqualTo(value)); - } - - [TestCase("Null", null, null, "System.Resources.ResXNullRef" + winFormsAssemblyName)] - [TestCase("String", "Hello World!", "Hello World!", null)] - [TestCase("Bool", true, "True", "System.Boolean" + msCorLibAssemblyName)] - [TestCase("Bool", false, "False", "System.Boolean" + msCorLibAssemblyName)] - [TestCase("Char", 'A', "A", "System.Char" + msCorLibAssemblyName)] - [TestCase("Byte", (byte)1, "1", "System.Byte" + msCorLibAssemblyName)] - [TestCase("SByte", (sbyte)-1, "-1", "System.SByte" + msCorLibAssemblyName)] - [TestCase("Int16", (short)1, "1", "System.Int16" + msCorLibAssemblyName)] - [TestCase("UInt16", (ushort)1, "1", "System.UInt16" + msCorLibAssemblyName)] - [TestCase("Int32", 1, "1", "System.Int32" + msCorLibAssemblyName)] - [TestCase("UInt32", (uint)1, "1", "System.UInt32" + msCorLibAssemblyName)] - [TestCase("Int64", (long)1, "1", "System.Int64" + msCorLibAssemblyName)] - [TestCase("UInt64", (ulong)1, "1", "System.UInt64" + msCorLibAssemblyName)] - [TestCase("Single", 1.0f, "1", "System.Single" + msCorLibAssemblyName)] - [TestCase("Double", 1.0d, "1", "System.Double" + msCorLibAssemblyName)] - [TestCaseSource(nameof(testWriteCases))] - public void Write(string name, object value, string serializedValue, string typeName) - { - var element = ProduceResXTest(name, value); - Assert.That(element.Attribute("name")?.Value, Is.EqualTo(name)); - if (typeName != null) - { - Assert.That(element.Attribute("type")?.Value, Is.EqualTo(typeName)); - } - var v = element.Element("value"); - Assert.That(v, Is.Not.Null); - Assert.That(v.IsEmpty ? serializedValue == null : v.Value == serializedValue); - } - - [Test] - public void ResXSerializableClassIsRejected() - { - Assert.Throws( - () => ProduceResXTest("Serial", new SerializableClass { Name = "Hugo", Age = 42 }) - ); - } - - [Test] - public void BitmapIsResourceSerializedObject() - { - Stream stream = typeof(ResourceReaderWriterTests).Assembly - .GetManifestResourceStream(typeof(ResourceReaderWriterTests).Namespace + ".Test.resources"); - using var reader = new ResourcesFile(stream); - var items = reader.ToArray(); - Assert.That(items.Length, Is.EqualTo(3)); - var item = items.FirstOrDefault(i => i.Key == "Bitmap"); - Assert.That(item.Key, Is.Not.Null); - Assert.That(item.Value, Is.InstanceOf()); - var rso = (ResourceSerializedObject)item.Value; - Assert.That(rso.TypeName, Is.Null); - } - - [Test] - public void ByteArrayIsSupported() - { - Stream stream = typeof(ResourceReaderWriterTests).Assembly - .GetManifestResourceStream(typeof(ResourceReaderWriterTests).Namespace + ".Test.resources"); - using var reader = new ResourcesFile(stream); - var items = reader.ToArray(); - Assert.That(items.Length, Is.EqualTo(3)); - var item = items.FirstOrDefault(i => i.Key == "Byte[]"); - Assert.That(item.Key, Is.Not.Null); - Assert.That(item.Value, Is.InstanceOf()); - byte[] array = (byte[])item.Value; - Assert.That(array.Length, Is.EqualTo(3)); - Assert.That(array[0], Is.EqualTo(42)); - Assert.That(array[1], Is.EqualTo(43)); - Assert.That(array[2], Is.EqualTo(44)); - } - - [Test] - public void MemoryStreamIsSupported() - { - Stream stream = typeof(ResourceReaderWriterTests).Assembly - .GetManifestResourceStream(typeof(ResourceReaderWriterTests).Namespace + ".Test.resources"); - using var reader = new ResourcesFile(stream); - var items = reader.ToArray(); - Assert.That(items.Length, Is.EqualTo(3)); - var item = items.FirstOrDefault(i => i.Key == "MemoryStream"); - Assert.That(item.Key, Is.Not.Null); - Assert.That(item.Value, Is.InstanceOf()); - } - - [Test] - public void IconDataCanBeDeserializedFromResX() - { - // Uses new serialization format - var resourcesStream = GetResource("IconContainer.resources"); - var reader = new ResourcesFile(resourcesStream); - var item = reader.Single(); - Assert.That(item.Key, Is.EqualTo("Icon")); - Assert.That(item.Value, Is.InstanceOf()); - var rso = (ResourceSerializedObject)item.Value; - var xml = ProduceResXTest("Icon", rso); - Assert.That(xml.GetAttribute("name"), Is.EqualTo("Icon")); - Assert.That(xml.GetAttribute("type"), Is.EqualTo("System.Drawing.Icon" + drawingAssemblyName)); - Assert.That(xml.GetAttribute("mimetype"), Is.EqualTo("application/x-microsoft.net.object.bytearray.base64")); - var base64Icon = xml.Element("value").Value; - using var memory = new MemoryStream(Convert.FromBase64String(base64Icon)); - new Icon(memory); - } - - [Test] - public void BitmapDataCanBeDeserializedFromResX() - { - // Uses old serialization format - var resourcesStream = GetResource("BitmapContainer.resources"); - var reader = new ResourcesFile(resourcesStream); - var item = reader.Single(x => x.Key == "Image1"); - Assert.That(item.Value, Is.InstanceOf()); - var rso = (ResourceSerializedObject)item.Value; - var xml = ProduceResXTest("Image1", rso); - Assert.That(xml.GetAttribute("name"), Is.EqualTo("Image1")); - Assert.That(xml.GetAttribute("type"), Is.Null); - Assert.That(xml.GetAttribute("mimetype"), Is.EqualTo("application/x-microsoft.net.object.binary.base64")); - } - } -} \ No newline at end of file diff --git a/ILSpy.Tests/Test.resources b/ILSpy.Tests/Test.resources deleted file mode 100644 index 375a8c249994f49322c7b0aa5fe8fc53c8beceb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 684 zcmX?i>is@O1_p+SK%5g?SzMBus~417oL^d$oLUTL1*ImYq!#HYR*8GxXUf^%t3Noi54ZC+|=Nl{{sjzU0bQch;FcWPxwes*e}ZIZcpqG__J znW3ezNveT`r81^vrFkWpxv4PQgHubGfR17YVvqwfpz2+U63a95()FA&OL7wnbQDm9 z$#Iy0ahhqGd77bNim5@Oabkd@3lO10|`_D1yUKJ8Dbf9fGQ+>ft*~1e1;;RL@-dQ2*^(aikJW;9l-wi4+J28 zfdCK4qk&ZS2`k8aQB-50;RcdnaY-ymWM=}|%?S!+eh|?K#7vz5e(t - - 10.0.0.0 - v10.0 - https://example.com/ignored.zip - - - """; - - using var client = new HttpClient(new StubHttpMessageHandler(xml)); - - var result = await UpdateService.GetLatestVersionAsync(client, new Uri("https://example.com/updates.xml")); - - result.Version.Should().Be(new Version(10, 0, 0, 0)); - result.DownloadUrl.Should().Be("https://github.com/icsharpcode/ILSpy/releases/tag/v10.0"); - } - - [Test] - public async Task GetLatestVersionAsync_ReturnsNullDownloadUrl_WhenReleaseTagContainsPathTraversalAttempt() - { - const string xml = """ - - - 10.0.0.0 - ../malicious - https://example.com/ignored.zip - - - """; - - using var client = new HttpClient(new StubHttpMessageHandler(xml)); - - var result = await UpdateService.GetLatestVersionAsync(client, new Uri("https://example.com/updates.xml")); - - result.Version.Should().Be(new Version(10, 0, 0, 0)); - result.DownloadUrl.Should().BeNull(); - } - - [Test] - public async Task GetLatestVersionAsync_UsesDownloadUrl_WhenReleaseTagIsMissing() - { - const string xml = """ - - - 10.0.0.0 - https://github.com/icsharpcode/ILSpy/releases/tag/v10.0 - - - """; - - using var client = new HttpClient(new StubHttpMessageHandler(xml)); - - var result = await UpdateService.GetLatestVersionAsync(client, new Uri("https://example.com/updates.xml")); - - result.Version.Should().Be(new Version(10, 0, 0, 0)); - result.DownloadUrl.Should().Be("https://github.com/icsharpcode/ILSpy/releases/tag/v10.0"); - } - - [Test] - public async Task GetLatestVersionAsync_UsesDownloadUrl_ButFailsBecauseBaseUrlDoesntMatch() - { - const string xml = """ - - - 10.0.0.0 - https://example.com/ilspy.zip - - - """; - - using var client = new HttpClient(new StubHttpMessageHandler(xml)); - - var result = await UpdateService.GetLatestVersionAsync(client, new Uri("https://example.com/updates.xml")); - - result.Version.Should().Be(new Version(10, 0, 0, 0)); - result.DownloadUrl.Should().BeNull(); - } - - sealed class StubHttpMessageHandler(string responseContent) : HttpMessageHandler - { - protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) { - Content = new StringContent(responseContent) - }); - } - } -} diff --git a/ILSpy.sln b/ILSpy.sln index cc84420d0..7b24b46b1 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -1,6 +1,7 @@ + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.4.11620.152 stable +VisualStudioVersion = 18.4.11620.152 MinimumVisualStudioVersion = 15.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E72-4000-B5AD-3A7B485A0896}" ProjectSection(SolutionItems) = preProject @@ -9,22 +10,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E7 doc\IntPtr.txt = doc\IntPtr.txt EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy", "ILSpy\ILSpy.csproj", "{1E85EFF9-E370-4683-83E4-8A3D063FF791}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler", "ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj", "{984CC812-9470-4A13-AFF9-CC44068D666C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Tests", "ICSharpCode.Decompiler.Tests\ICSharpCode.Decompiler.Tests.csproj", "{FEC0DA52-C4A6-4710-BE36-B484A20C5E22}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestPlugin", "TestPlugin\TestPlugin.csproj", "{F32EBCC8-0E53-4421-867E-05B3D6E10C70}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.BamlDecompiler", "ILSpy.BamlDecompiler\ILSpy.BamlDecompiler.csproj", "{A6BAD2BA-76BA-461C-8B6D-418607591247}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.BamlDecompiler.Tests", "ILSpy.BamlDecompiler.Tests\ILSpy.BamlDecompiler.Tests.csproj", "{1169E6D1-1899-43D4-A500-07CE4235B388}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.Tests", "ILSpy.Tests\ILSpy.Tests.csproj", "{B51C6636-B8D1-4200-9869-08F2689DE6C2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.ReadyToRun", "ILSpy.ReadyToRun\ILSpy.ReadyToRun.csproj", "{0313F581-C63B-43BB-AA9B-07615DABD8A3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.ILSpyCmd", "ICSharpCode.ILSpyCmd\ICSharpCode.ILSpyCmd.csproj", "{743B439A-E7AD-4A0A-BAB6-222E1EA83C6D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.PowerShell", "ICSharpCode.Decompiler.PowerShell\ICSharpCode.Decompiler.PowerShell.csproj", "{50060E0C-FA25-41F4-B72F-8490324EC9F0}" @@ -50,10 +39,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1E85EFF9-E370-4683-83E4-8A3D063FF791}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E85EFF9-E370-4683-83E4-8A3D063FF791}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E85EFF9-E370-4683-83E4-8A3D063FF791}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E85EFF9-E370-4683-83E4-8A3D063FF791}.Release|Any CPU.Build.0 = Release|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.Build.0 = Debug|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -62,26 +47,6 @@ Global {FEC0DA52-C4A6-4710-BE36-B484A20C5E22}.Debug|Any CPU.Build.0 = Debug|Any CPU {FEC0DA52-C4A6-4710-BE36-B484A20C5E22}.Release|Any CPU.ActiveCfg = Release|Any CPU {FEC0DA52-C4A6-4710-BE36-B484A20C5E22}.Release|Any CPU.Build.0 = Release|Any CPU - {F32EBCC8-0E53-4421-867E-05B3D6E10C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F32EBCC8-0E53-4421-867E-05B3D6E10C70}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F32EBCC8-0E53-4421-867E-05B3D6E10C70}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F32EBCC8-0E53-4421-867E-05B3D6E10C70}.Release|Any CPU.Build.0 = Release|Any CPU - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.Build.0 = Release|Any CPU - {1169E6D1-1899-43D4-A500-07CE4235B388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1169E6D1-1899-43D4-A500-07CE4235B388}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1169E6D1-1899-43D4-A500-07CE4235B388}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1169E6D1-1899-43D4-A500-07CE4235B388}.Release|Any CPU.Build.0 = Release|Any CPU - {B51C6636-B8D1-4200-9869-08F2689DE6C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B51C6636-B8D1-4200-9869-08F2689DE6C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B51C6636-B8D1-4200-9869-08F2689DE6C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B51C6636-B8D1-4200-9869-08F2689DE6C2}.Release|Any CPU.Build.0 = Release|Any CPU - {0313F581-C63B-43BB-AA9B-07615DABD8A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0313F581-C63B-43BB-AA9B-07615DABD8A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0313F581-C63B-43BB-AA9B-07615DABD8A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0313F581-C63B-43BB-AA9B-07615DABD8A3}.Release|Any CPU.Build.0 = Release|Any CPU {743B439A-E7AD-4A0A-BAB6-222E1EA83C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {743B439A-E7AD-4A0A-BAB6-222E1EA83C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU {743B439A-E7AD-4A0A-BAB6-222E1EA83C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs deleted file mode 100644 index 09b9c8496..000000000 --- a/ILSpy/AboutPage.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.IO; -using System.Text.RegularExpressions; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Input; -using System.Windows.Navigation; - -using ICSharpCode.AvalonEdit.Rendering; -using ICSharpCode.Decompiler; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.Themes; -using ICSharpCode.ILSpy.Updates; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._Help), Header = nameof(Resources._About), MenuOrder = 99999)] - [Shared] - public sealed class AboutPage : SimpleCommand - { - readonly SettingsService settingsService; - readonly IEnumerable aboutPageAdditions; - - public AboutPage(SettingsService settingsService, IEnumerable aboutPageAdditions) - { - this.settingsService = settingsService; - this.aboutPageAdditions = aboutPageAdditions; - MessageBus.Subscribers += (_, e) => ShowAboutPage(e.TabPage); - } - - public override void Execute(object parameter) - { - MessageBus.Send(this, new NavigateToEventArgs(new RequestNavigateEventArgs(new Uri("resource://aboutpage"), null), inNewTabPage: true)); - } - - private void ShowAboutPage(TabPageModel tabPage) - { - tabPage.ShowTextView(Display); - } - - private void Display(DecompilerTextView textView) - { - AvalonEditTextOutput output = new AvalonEditTextOutput() { - Title = Resources.About, - EnableHyperlinks = true - }; - output.WriteLine(Resources.ILSpyVersion + DecompilerVersionInfo.FullVersionWithCommitHash); - - string prodVersion = GetDotnetProductVersion(); - output.WriteLine(Resources.NETFrameworkVersion + prodVersion); - - output.AddUIElement( - delegate { - var stackPanel = new StackPanel { - HorizontalAlignment = HorizontalAlignment.Center, - Orientation = Orientation.Horizontal - }; - if (UpdateService.LatestAvailableVersion == null) - { - AddUpdateCheckButton(stackPanel, textView); - } - else - { - // we already retrieved the latest version sometime earlier - ShowAvailableVersion(UpdateService.LatestAvailableVersion, stackPanel); - } - var checkBox = new CheckBox { - Margin = new Thickness(4), - Content = Resources.AutomaticallyCheckUpdatesEveryWeek - }; - - var settings = settingsService.GetSettings(); - checkBox.SetBinding(ToggleButton.IsCheckedProperty, new Binding("AutomaticUpdateCheckEnabled") { Source = settings }); - return new StackPanel { - Margin = new Thickness(0, 4, 0, 0), - Cursor = Cursors.Arrow, - Children = { stackPanel, checkBox } - }; - }); - output.WriteLine(); - - foreach (var plugin in aboutPageAdditions) - plugin.Write(output); - output.WriteLine(); - output.Address = new Uri("resource://AboutPage"); - using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), Resources.ILSpyAboutPageTxt)) - { - using (StreamReader r = new StreamReader(s)) - { - while (r.ReadLine() is { } line) - { - output.WriteLine(line); - } - } - } - output.AddVisualLineElementGenerator(new MyLinkElementGenerator("MIT License", "resource:license.txt")); - output.AddVisualLineElementGenerator(new MyLinkElementGenerator("third-party notices", "resource:third-party-notices.txt")); - textView.ShowText(output); - } - - private static string GetDotnetProductVersion() - { - // In case of AOT .Location is null, we need a fallback for that - string assemblyLocation = typeof(Uri).Assembly.Location; - - if (!String.IsNullOrWhiteSpace(assemblyLocation)) - { - return System.Diagnostics.FileVersionInfo.GetVersionInfo(assemblyLocation).ProductVersion; - } - else - { - var version = typeof(Object).Assembly.GetName().Version; - if (version != null) - { - return version.ToString(); - } - } - - return "UNKNOWN"; - } - - sealed class MyLinkElementGenerator : LinkElementGenerator - { - readonly Uri uri; - - public MyLinkElementGenerator(string matchText, string url) : base(new Regex(Regex.Escape(matchText))) - { - this.uri = new Uri(url); - this.RequireControlModifierForClick = false; - } - - protected override Uri GetUriFromMatch(Match match) - { - return uri; - } - } - - static void AddUpdateCheckButton(StackPanel stackPanel, DecompilerTextView textView) - { - Button button = ThemeManager.Current.CreateButton(); - button.Content = Resources.CheckUpdates; - button.Cursor = Cursors.Arrow; - stackPanel.Children.Add(button); - - button.Click += async delegate { - button.Content = Resources.Checking; - button.IsEnabled = false; - - try - { - AvailableVersionInfo vInfo = await UpdateService.GetLatestVersionAsync(); - stackPanel.Children.Clear(); - ShowAvailableVersion(vInfo, stackPanel); - } - catch (Exception ex) - { - AvalonEditTextOutput exceptionOutput = new AvalonEditTextOutput(); - exceptionOutput.WriteLine(ex.ToString()); - textView.ShowText(exceptionOutput); - } - }; - } - - static void ShowAvailableVersion(AvailableVersionInfo availableVersion, StackPanel stackPanel) - { - if (AppUpdateService.CurrentVersion == availableVersion.Version) - { - stackPanel.Children.Add( - new Image { - Width = 16, Height = 16, -#if CROSS_PLATFORM - Source = Images.LoadImage(Images.OK), -#else - Source = Images.OK, -#endif - Margin = new Thickness(4, 0, 4, 0) - }); - stackPanel.Children.Add( - new TextBlock { - Text = Resources.UsingLatestRelease, - VerticalAlignment = VerticalAlignment.Bottom - }); - } - else if (AppUpdateService.CurrentVersion < availableVersion.Version) - { - stackPanel.Children.Add( - new TextBlock { - Text = string.Format(Resources.VersionAvailable, availableVersion.Version), - Margin = new Thickness(0, 0, 8, 0), - VerticalAlignment = VerticalAlignment.Bottom - }); - if (availableVersion.DownloadUrl != null) - { - Button button = ThemeManager.Current.CreateButton(); - button.Content = Resources.Download; - button.Cursor = Cursors.Arrow; - button.Click += delegate { - GlobalUtils.OpenLink(availableVersion.DownloadUrl); - }; - stackPanel.Children.Add(button); - } - } - else - { - stackPanel.Children.Add(new TextBlock { Text = Resources.UsingNightlyBuildNewerThanLatestRelease }); - } - } - } - - /// - /// Interface that allows plugins to extend the about page. - /// - public interface IAboutPageAddition - { - void Write(ISmartTextOutput textOutput); - } -} diff --git a/ILSpy/Analyzers/AnalyzeCommand.cs b/ILSpy/Analyzers/AnalyzeCommand.cs deleted file mode 100644 index ddd5d9219..000000000 --- a/ILSpy/Analyzers/AnalyzeCommand.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Linq; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; - -using TomsToolbox.Composition; - -namespace ICSharpCode.ILSpy.Analyzers -{ - [ExportContextMenuEntry(Header = nameof(Resources.Analyze), Icon = "Images/Search", Category = nameof(Resources.Analyze), InputGestureText = "Ctrl+R", Order = 100)] - [Shared] - internal sealed class AnalyzeContextMenuCommand(AnalyzerTreeViewModel analyzerTreeView) : IContextMenuEntry - { - public bool IsVisible(TextViewContext context) - { - if (context.TreeView is AnalyzerTreeView && context.SelectedTreeNodes != null && context.SelectedTreeNodes.All(n => n.Parent.IsRoot)) - return false; - if (context.SelectedTreeNodes == null) - return context.Reference != null && IsValidReference(context.Reference.Reference); - return context.SelectedTreeNodes.All(n => n is IMemberTreeNode); - } - - public bool IsEnabled(TextViewContext context) - { - if (context.SelectedTreeNodes == null) - { - return context.Reference is { Reference: IEntity }; - } - return context.SelectedTreeNodes - .OfType() - .All(node => IsValidReference(node.Member)); - } - - static bool IsValidReference(object reference) - { - return reference is IEntity and not IField { IsConst: true }; - } - - public void Execute(TextViewContext context) - { - if (context.SelectedTreeNodes != null) - { - foreach (var node in context.SelectedTreeNodes.OfType().ToArray()) - { - analyzerTreeView.Analyze(node.Member); - } - } - else if (context.Reference is { Reference: IEntity entity }) - { - analyzerTreeView.Analyze(entity); - } - } - } - - [Export] - [Shared] - public sealed class AnalyzeCommand(AssemblyTreeModel assemblyTreeModel, AnalyzerTreeViewModel analyzerTreeViewModel) : SimpleCommand - { - public override bool CanExecute(object parameter) - { - return assemblyTreeModel.SelectedNodes.All(n => n is IMemberTreeNode); - } - - public override void Execute(object parameter) - { - foreach (var node in assemblyTreeModel.SelectedNodes.OfType()) - { - analyzerTreeViewModel.Analyze(node.Member); - } - } - } -} diff --git a/ILSpy/Analyzers/AnalyzerEntityTreeNode.cs b/ILSpy/Analyzers/AnalyzerEntityTreeNode.cs deleted file mode 100644 index c86dc1e80..000000000 --- a/ILSpy/Analyzers/AnalyzerEntityTreeNode.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Diagnostics; -using System.Windows; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.TreeView; -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; - -#nullable enable - -namespace ICSharpCode.ILSpy.Analyzers -{ - /// - /// Base class for entity nodes. - /// - public abstract class AnalyzerEntityTreeNode : AnalyzerTreeNode, IMemberTreeNode - { - public abstract IEntity? Member { get; } - - public IEntity? SourceMember { get; protected set; } - - public override void ActivateItem(IPlatformRoutedEventArgs e) - { - e.Handled = true; - if (this.Member == null || this.Member.MetadataToken.IsNil) - { - MessageBox.Show(Properties.Resources.CannotAnalyzeMissingRef, "ILSpy"); - return; - } - - var module = this.Member.ParentModule?.MetadataFile; - - Debug.Assert(module != null); - - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(module, this.Member.MetadataToken), this.SourceMember)); - } - - public override object? ToolTip => Member?.ParentModule?.MetadataFile?.FileName; - - public override bool HandleAssemblyListChanged(ICollection removedAssemblies, ICollection addedAssemblies) - { - if (Member == null) - { - return true; - } - foreach (LoadedAssembly asm in removedAssemblies) - { - if (this.Member.ParentModule!.MetadataFile == asm.GetMetadataFileOrNull()) - return false; // remove this node - } - this.Children.RemoveAll( - delegate (SharpTreeNode n) { - return n is not AnalyzerTreeNode an || !an.HandleAssemblyListChanged(removedAssemblies, addedAssemblies); - }); - return true; - } - } -} diff --git a/ILSpy/Analyzers/AnalyzerRootNode.cs b/ILSpy/Analyzers/AnalyzerRootNode.cs deleted file mode 100644 index 3303e5c03..000000000 --- a/ILSpy/Analyzers/AnalyzerRootNode.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2024 Tom Englert for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Linq; - -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy.Analyzers; - -public sealed class AnalyzerRootNode : AnalyzerTreeNode -{ - public AnalyzerRootNode() - { - MessageBus.Subscribers += (sender, e) => CurrentAssemblyList_Changed(sender, e); - } - - void CurrentAssemblyList_Changed(object sender, NotifyCollectionChangedEventArgs e) - { - if (e.Action == NotifyCollectionChangedAction.Reset) - { - this.Children.Clear(); - } - else - { - var removedAssemblies = e.OldItems?.Cast().ToArray() ?? []; - var addedAssemblies = e.NewItems?.Cast().ToArray() ?? []; - - HandleAssemblyListChanged(removedAssemblies, addedAssemblies); - } - } - - public override bool HandleAssemblyListChanged(ICollection removedAssemblies, ICollection addedAssemblies) - { - this.Children.RemoveAll( - delegate (SharpTreeNode n) { - AnalyzerTreeNode an = n as AnalyzerTreeNode; - return an == null || !an.HandleAssemblyListChanged(removedAssemblies, addedAssemblies); - }); - return true; - } -} \ No newline at end of file diff --git a/ILSpy/Analyzers/AnalyzerSearchTreeNode.cs b/ILSpy/Analyzers/AnalyzerSearchTreeNode.cs deleted file mode 100644 index 9af81a856..000000000 --- a/ILSpy/Analyzers/AnalyzerSearchTreeNode.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.Analyzers.TreeNodes; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Analyzers; - -namespace ICSharpCode.ILSpy.Analyzers -{ - class AnalyzerSearchTreeNode : AnalyzerTreeNode - { - private readonly ThreadingSupport threading = new ThreadingSupport(); - readonly ISymbol symbol; - readonly IAnalyzer analyzer; - readonly string analyzerHeader; - - public AnalyzerSearchTreeNode(ISymbol symbol, IAnalyzer analyzer, string analyzerHeader) - { - this.symbol = symbol; - this.analyzer = analyzer ?? throw new ArgumentNullException(nameof(analyzer)); - this.LazyLoading = true; - this.analyzerHeader = analyzerHeader; - } - - public override object Text => analyzerHeader - + (Children.Count > 0 && !threading.IsRunning ? " (" + Children.Count + " in " + threading.EllapsedMilliseconds + "ms)" : ""); - - public override object Icon => Images.Search; - - protected override void LoadChildren() - { - threading.LoadChildren(this, FetchChildren); - } - - protected IEnumerable FetchChildren(CancellationToken ct) - { - if (symbol is IEntity) - { - var context = new AnalyzerContext { - CancellationToken = ct, - Language = Language, - AssemblyList = AssemblyList - }; - var results = analyzer.Analyze(symbol, context).Select(SymbolTreeNodeFactory); - if (context.SortResults) - { - results = results.OrderBy(tn => tn.Text?.ToString(), NaturalStringComparer.Instance); - } - return results; - } - else - { - throw new NotSupportedException("Currently symbols that are not entities are not supported!"); - } - } - - AnalyzerTreeNode SymbolTreeNodeFactory(ISymbol resultSymbol) - { - if (resultSymbol == null) - { - throw new ArgumentNullException(nameof(resultSymbol)); - } - - switch (resultSymbol) - { - case IModule module: - return new AnalyzedModuleTreeNode(module, (IEntity)this.symbol); - case ITypeDefinition td: - return new AnalyzedTypeTreeNode(td, (IEntity)this.symbol); - case IField fd: - return new AnalyzedFieldTreeNode(fd, (IEntity)this.symbol); - case IMethod md: - return new AnalyzedMethodTreeNode(md, (IEntity)this.symbol); - case IProperty pd: - return new AnalyzedPropertyTreeNode(pd, (IEntity)this.symbol); - case IEvent ed: - return new AnalyzedEventTreeNode(ed, (IEntity)this.symbol); - default: - throw new ArgumentOutOfRangeException(nameof(resultSymbol), $"Symbol {resultSymbol.GetType().FullName} is not supported."); - } - } - - protected override void OnIsVisibleChanged() - { - base.OnIsVisibleChanged(); - if (!this.IsVisible && threading.IsRunning) - { - this.LazyLoading = true; - threading.Cancel(); - this.Children.Clear(); - RaisePropertyChanged(nameof(Text)); - } - } - - public override bool HandleAssemblyListChanged(ICollection removedAssemblies, ICollection addedAssemblies) - { - // only cancel a running analysis if user has manually added/removed assemblies - bool manualAdd = false; - foreach (var asm in addedAssemblies) - { - if (!asm.IsAutoLoaded) - manualAdd = true; - } - if (removedAssemblies.Count > 0 || manualAdd) - { - this.LazyLoading = true; - threading.Cancel(); - this.Children.Clear(); - RaisePropertyChanged(nameof(Text)); - } - return true; - } - } -} diff --git a/ILSpy/Analyzers/AnalyzerTreeNode.cs b/ILSpy/Analyzers/AnalyzerTreeNode.cs deleted file mode 100644 index 378b4701d..000000000 --- a/ILSpy/Analyzers/AnalyzerTreeNode.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Linq; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Analyzers; -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Composition; - -namespace ICSharpCode.ILSpy.Analyzers -{ - public abstract class AnalyzerTreeNode : SharpTreeNode - { - protected static Language Language => App.ExportProvider.GetExportedValue().Language; - - protected static AssemblyList AssemblyList => App.ExportProvider.GetExportedValue(); - - public override bool CanDelete() - { - return Parent is { IsRoot: true }; - } - - public override void DeleteCore() - { - Parent.Children.Remove(this); - } - - public override void Delete() - { - DeleteCore(); - } - - public static ICollection> Analyzers => App.ExportProvider - .GetExports("Analyzer") - .OrderBy(item => item.Metadata?.Order) - .ToArray(); - - /// - /// Handles changes to the assembly list. - /// - public abstract bool HandleAssemblyListChanged(ICollection removedAssemblies, ICollection addedAssemblies); - } -} diff --git a/ILSpy/Analyzers/AnalyzerTreeView.xaml b/ILSpy/Analyzers/AnalyzerTreeView.xaml deleted file mode 100644 index a469779de..000000000 --- a/ILSpy/Analyzers/AnalyzerTreeView.xaml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/ILSpy/Analyzers/AnalyzerTreeView.xaml.cs b/ILSpy/Analyzers/AnalyzerTreeView.xaml.cs deleted file mode 100644 index 98d4e826d..000000000 --- a/ILSpy/Analyzers/AnalyzerTreeView.xaml.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Windows.Controls; - -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Wpf.Composition.AttributedModel; - -namespace ICSharpCode.ILSpy.Analyzers -{ - /// - /// Interaction logic for AnalyzerTreeView.xaml - /// - [DataTemplate(typeof(AnalyzerTreeViewModel))] - [NonShared] - [Export] - public partial class AnalyzerTreeView - { - public AnalyzerTreeView() - { - InitializeComponent(); - ContextMenuProvider.Add(this); - } - - private void AnalyzerTreeView_OnSelectionChanged(object sender, SelectionChangedEventArgs e) - { - if (SelectedItem is SharpTreeNode sharpTreeNode) - { - FocusNode(sharpTreeNode); - } - } - } -} diff --git a/ILSpy/Analyzers/AnalyzerTreeViewModel.cs b/ILSpy/Analyzers/AnalyzerTreeViewModel.cs deleted file mode 100644 index 5e8a975c2..000000000 --- a/ILSpy/Analyzers/AnalyzerTreeViewModel.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) 2024 Tom Englert for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Composition; -using System.Linq; -using System.Windows; -using System.Windows.Input; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.Analyzers.TreeNodes; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy.Analyzers -{ - [ExportToolPane] - [Shared] - [Export] - public class AnalyzerTreeViewModel : ToolPaneModel - { - public const string PaneContentId = "analyzerPane"; - - public AnalyzerTreeViewModel(AssemblyTreeModel assemblyTreeModel) - { - ContentId = PaneContentId; - Title = Properties.Resources.Analyze; - ShortcutKey = new(Key.R, ModifierKeys.Control); - AssociatedCommand = new AnalyzeCommand(assemblyTreeModel, this); - } - - public AnalyzerRootNode Root { get; } = new(); - - public ICommand AnalyzeCommand => new DelegateCommand(AnalyzeSelected); - - private SharpTreeNode[] selectedItems = []; - - public SharpTreeNode[] SelectedItems { - get => selectedItems ?? []; - set { - if (SelectedItems.SequenceEqual(value)) - return; - - selectedItems = value; - OnPropertyChanged(); - } - } - - private void AnalyzeSelected() - { - foreach (var node in SelectedItems.OfType()) - { - Analyze(node.Member); - } - } - - void AddOrSelect(AnalyzerTreeNode node) - { - Show(); - - AnalyzerTreeNode target = default; - - if (node is AnalyzerEntityTreeNode { Member: { } member }) - { - target = this.Root.Children.OfType().FirstOrDefault(item => item.Member == member); - } - - if (target == null) - { - this.Root.Children.Add(node); - target = node; - } - - target.IsExpanded = true; - this.SelectedItems = [target]; - } - - public void Analyze(IEntity entity) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - if (entity.MetadataToken.IsNil) - { - MessageBox.Show(Properties.Resources.CannotAnalyzeMissingRef, "ILSpy"); - return; - } - - switch (entity) - { - case ITypeDefinition td: - AddOrSelect(new AnalyzedTypeTreeNode(td, null)); - break; - case IField fd: - if (!fd.IsConst) - AddOrSelect(new AnalyzedFieldTreeNode(fd, null)); - break; - case IMethod md: - AddOrSelect(new AnalyzedMethodTreeNode(md, null)); - break; - case IProperty pd: - AddOrSelect(new AnalyzedPropertyTreeNode(pd, null)); - break; - case IEvent ed: - AddOrSelect(new AnalyzedEventTreeNode(ed, null)); - break; - default: - throw new ArgumentOutOfRangeException(nameof(entity), $@"Entity {entity.GetType().FullName} is not supported."); - } - } - } -} - diff --git a/ILSpy/Analyzers/CopyAnalysisResultsContextMenuEntry.cs b/ILSpy/Analyzers/CopyAnalysisResultsContextMenuEntry.cs deleted file mode 100644 index 2e9152722..000000000 --- a/ILSpy/Analyzers/CopyAnalysisResultsContextMenuEntry.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2022 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Linq; -using System.Text; -using System.Windows; - -namespace ICSharpCode.ILSpy.Analyzers -{ - [ExportContextMenuEntry(Header = "Copy results", Category = "Analyze", Order = 200)] - [Shared] - internal sealed class CopyAnalysisResultsContextMenuEntry : IContextMenuEntry - { - public bool IsVisible(TextViewContext context) - { - if (context.TreeView is AnalyzerTreeView && context.SelectedTreeNodes != null && context.SelectedTreeNodes.All(n => n is AnalyzerSearchTreeNode)) - return true; - return false; - } - - public bool IsEnabled(TextViewContext context) - { - return true; - } - - public void Execute(TextViewContext context) - { - StringBuilder sb = new StringBuilder(); - if (context.SelectedTreeNodes != null) - { - foreach (var node in context.SelectedTreeNodes) - { - foreach (var item in node.Children) - { - sb.AppendLine(item.Text.ToString()); - } - } - } - Clipboard.SetText(sb.ToString()); - } - } -} diff --git a/ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs b/ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs deleted file mode 100644 index 6969c605e..000000000 --- a/ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2013 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Linq; - -namespace ICSharpCode.ILSpy.Analyzers -{ - [ExportContextMenuEntry(Header = "Remove", Icon = "images/Delete", Category = "Analyze", Order = 200)] - [Shared] - internal sealed class RemoveAnalyzeContextMenuEntry : IContextMenuEntry - { - public bool IsVisible(TextViewContext context) - { - if (context.TreeView is AnalyzerTreeView && context.SelectedTreeNodes != null && context.SelectedTreeNodes.All(n => n.Parent.IsRoot)) - return true; - return false; - } - - public bool IsEnabled(TextViewContext context) - { - return true; - } - - public void Execute(TextViewContext context) - { - if (context.SelectedTreeNodes != null) - { - foreach (var node in context.SelectedTreeNodes) - { - node.Parent.Children.Remove(node); - } - } - } - } -} diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedAccessorTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedAccessorTreeNode.cs deleted file mode 100644 index 08b44dabe..000000000 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedAccessorTreeNode.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using ICSharpCode.Decompiler.TypeSystem; - -namespace ICSharpCode.ILSpy.Analyzers.TreeNodes -{ - class AnalyzedAccessorTreeNode : AnalyzedMethodTreeNode - { - readonly string name; - - public AnalyzedAccessorTreeNode(IMethod analyzedMethod, IEntity source, string name) - : base(analyzedMethod, source) - { - if (string.IsNullOrWhiteSpace(name)) - { - throw new System.ArgumentException("name must be a non-empty string", nameof(name)); - } - - this.name = name; - } - - public override object Text => name; - } -} diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs deleted file mode 100644 index 9df55a061..000000000 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; - -using ICSharpCode.Decompiler.Output; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -#nullable enable - -namespace ICSharpCode.ILSpy.Analyzers.TreeNodes -{ - internal sealed class AnalyzedEventTreeNode : AnalyzerEntityTreeNode - { - readonly IEvent analyzedEvent; - readonly string prefix; - - public AnalyzedEventTreeNode(IEvent analyzedEvent, IEntity? source, string prefix = "") - { - this.analyzedEvent = analyzedEvent ?? throw new ArgumentNullException(nameof(analyzedEvent)); - this.prefix = prefix; - this.LazyLoading = true; - this.SourceMember = source; - } - - public override IEntity Member => analyzedEvent; - - public override object Icon => EventTreeNode.GetIcon(analyzedEvent); - - // TODO: This way of formatting is not suitable for events which explicitly implement interfaces. - public override object Text => prefix + Language.EntityToString(analyzedEvent, ConversionFlags.ShowDeclaringType | ConversionFlags.UseFullyQualifiedEntityNames); - - protected override void LoadChildren() - { - if (analyzedEvent.CanAdd) - this.Children.Add(new AnalyzedAccessorTreeNode(analyzedEvent.AddAccessor, this.SourceMember, "add")); - if (analyzedEvent.CanRemove) - this.Children.Add(new AnalyzedAccessorTreeNode(analyzedEvent.RemoveAccessor, this.SourceMember, "remove")); - if (TryFindBackingField(analyzedEvent, out var backingField)) - this.Children.Add(new AnalyzedFieldTreeNode(backingField, this.SourceMember)); - - foreach (var lazy in Analyzers) - { - var analyzer = lazy.Value; - Debug.Assert(analyzer != null); - if (analyzer.Show(analyzedEvent)) - { - this.Children.Add(new AnalyzerSearchTreeNode(analyzedEvent, analyzer, lazy.Metadata?.Header)); - } - } - } - - bool TryFindBackingField(IEvent analyzedEvent, [NotNullWhen(true)] out IField? backingField) - { - backingField = null; - foreach (var field in analyzedEvent.DeclaringTypeDefinition?.GetFields(options: GetMemberOptions.IgnoreInheritedMembers) ?? []) - { - if (field.Name == analyzedEvent.Name && field.Accessibility == Decompiler.TypeSystem.Accessibility.Private) - { - backingField = field; - return true; - } - } - return false; - } - } -} diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs deleted file mode 100644 index 64a508c57..000000000 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Diagnostics; - -using ICSharpCode.Decompiler.Output; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -#nullable enable - -namespace ICSharpCode.ILSpy.Analyzers.TreeNodes -{ - class AnalyzedFieldTreeNode : AnalyzerEntityTreeNode - { - readonly IField analyzedField; - - public AnalyzedFieldTreeNode(IField analyzedField, IEntity? source) - { - this.analyzedField = analyzedField ?? throw new ArgumentNullException(nameof(analyzedField)); - this.SourceMember = source; - this.LazyLoading = true; - } - - public override object Icon => FieldTreeNode.GetIcon(analyzedField); - - public override object Text => Language.EntityToString(analyzedField, ConversionFlags.ShowDeclaringType | ConversionFlags.UseFullyQualifiedEntityNames); - - protected override void LoadChildren() - { - foreach (var lazy in Analyzers) - { - var analyzer = lazy.Value; - Debug.Assert(analyzer != null); - if (analyzer.Show(analyzedField)) - { - this.Children.Add(new AnalyzerSearchTreeNode(analyzedField, analyzer, lazy.Metadata?.Header)); - } - } - } - - public override IEntity Member => analyzedField; - } -} diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs deleted file mode 100644 index 2ce76fe51..000000000 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Diagnostics; - -using ICSharpCode.Decompiler.Output; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -#nullable enable - -namespace ICSharpCode.ILSpy.Analyzers.TreeNodes -{ - internal class AnalyzedMethodTreeNode : AnalyzerEntityTreeNode - { - readonly IMethod analyzedMethod; - readonly string prefix; - - public AnalyzedMethodTreeNode(IMethod analyzedMethod, IEntity? source, string prefix = "") - { - this.analyzedMethod = analyzedMethod ?? throw new ArgumentNullException(nameof(analyzedMethod)); - this.SourceMember = source; - this.prefix = prefix; - this.LazyLoading = true; - } - - public override object Icon => MethodTreeNode.GetIcon(analyzedMethod); - - public override object Text => prefix + Language.EntityToString(analyzedMethod, ConversionFlags.ShowDeclaringType | ConversionFlags.UseFullyQualifiedEntityNames); - - protected override void LoadChildren() - { - foreach (var lazy in Analyzers) - { - var analyzer = lazy.Value; - Debug.Assert(analyzer != null); - if (analyzer.Show(analyzedMethod)) - { - this.Children.Add(new AnalyzerSearchTreeNode(analyzedMethod, analyzer, lazy.Metadata!.Header)); - } - } - } - - public override IEntity Member => analyzedMethod; - } -} diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs deleted file mode 100644 index 7695b625f..000000000 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Windows; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.TreeView; -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; - -#nullable enable - -namespace ICSharpCode.ILSpy.Analyzers.TreeNodes -{ - internal class AnalyzedModuleTreeNode : AnalyzerEntityTreeNode - { - readonly IModule analyzedModule; - - public AnalyzedModuleTreeNode(IModule analyzedModule, IEntity? source) - { - this.analyzedModule = analyzedModule ?? throw new ArgumentNullException(nameof(analyzedModule)); - this.SourceMember = source; - this.LazyLoading = true; - } - - public override object Icon => Images.Assembly; - - public override object Text => analyzedModule.AssemblyName; - - public override object? ToolTip => analyzedModule.MetadataFile?.FileName; - - protected override void LoadChildren() - { - foreach (var lazy in Analyzers) - { - var analyzer = lazy.Value; - Debug.Assert(analyzer != null); - if (analyzer.Show(analyzedModule)) - { - this.Children.Add(new AnalyzerSearchTreeNode(analyzedModule, analyzer, lazy.Metadata!.Header)); - } - } - } - - public override void ActivateItem(IPlatformRoutedEventArgs e) - { - e.Handled = true; - if (analyzedModule.MetadataFile == null) - { - MessageBox.Show(Properties.Resources.CannotAnalyzeMissingRef, "ILSpy"); - return; - } - MessageBus.Send(this, new NavigateToReferenceEventArgs(analyzedModule.MetadataFile)); - } - - public override IEntity? Member => null; - - public override bool HandleAssemblyListChanged(ICollection removedAssemblies, ICollection addedAssemblies) - { - if (analyzedModule == null) - { - return true; - } - foreach (LoadedAssembly asm in removedAssemblies) - { - if (this.analyzedModule.MetadataFile == asm.GetMetadataFileOrNull()) - return false; // remove this node - } - this.Children.RemoveAll( - delegate (SharpTreeNode n) { - return n is not AnalyzerTreeNode an || !an.HandleAssemblyListChanged(removedAssemblies, addedAssemblies); - }); - return true; - } - } -} diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs deleted file mode 100644 index d6cb1df5e..000000000 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Diagnostics; - -using ICSharpCode.Decompiler.Output; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -#nullable enable - -namespace ICSharpCode.ILSpy.Analyzers.TreeNodes -{ - sealed class AnalyzedPropertyTreeNode : AnalyzerEntityTreeNode - { - readonly IProperty analyzedProperty; - readonly string prefix; - - public AnalyzedPropertyTreeNode(IProperty analyzedProperty, IEntity? source, string prefix = "") - { - this.analyzedProperty = analyzedProperty ?? throw new ArgumentNullException(nameof(analyzedProperty)); - this.prefix = prefix; - this.LazyLoading = true; - this.SourceMember = source; - } - - public override object Icon => PropertyTreeNode.GetIcon(analyzedProperty); - - // TODO: This way of formatting is not suitable for properties which explicitly implement interfaces. - public override object Text => prefix + Language.EntityToString(analyzedProperty, ConversionFlags.ShowDeclaringType | ConversionFlags.UseFullyQualifiedEntityNames); - - protected override void LoadChildren() - { - if (analyzedProperty.CanGet) - this.Children.Add(new AnalyzedAccessorTreeNode(analyzedProperty.Getter, this.SourceMember, "get")); - if (analyzedProperty.CanSet) - this.Children.Add(new AnalyzedAccessorTreeNode(analyzedProperty.Setter, this.SourceMember, "set")); - - foreach (var lazy in Analyzers) - { - var analyzer = lazy.Value; - Debug.Assert(analyzer != null); - if (analyzer.Show(analyzedProperty)) - { - this.Children.Add(new AnalyzerSearchTreeNode(analyzedProperty, analyzer, lazy.Metadata!.Header)); - } - } - } - - public override IEntity Member => analyzedProperty; - } -} diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs deleted file mode 100644 index 67f37d6f9..000000000 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Diagnostics; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -#nullable enable - -namespace ICSharpCode.ILSpy.Analyzers.TreeNodes -{ - internal class AnalyzedTypeTreeNode : AnalyzerEntityTreeNode - { - readonly ITypeDefinition analyzedType; - - public AnalyzedTypeTreeNode(ITypeDefinition analyzedType, IEntity? source) - { - this.analyzedType = analyzedType ?? throw new ArgumentNullException(nameof(analyzedType)); - this.SourceMember = source; - this.LazyLoading = true; - } - - public override object Icon => TypeTreeNode.GetIcon(analyzedType); - - public override object Text => Language.TypeToString(analyzedType); - - protected override void LoadChildren() - { - foreach (var lazy in Analyzers) - { - var analyzer = lazy.Value; - Debug.Assert(analyzer != null); - if (analyzer.Show(analyzedType)) - { - this.Children.Add(new AnalyzerSearchTreeNode(analyzedType, analyzer, lazy.Metadata!.Header)); - } - } - } - - public override IEntity Member => analyzedType; - } -} diff --git a/ILSpy/App.xaml b/ILSpy/App.xaml deleted file mode 100644 index 1e24beebf..000000000 --- a/ILSpy/App.xaml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/App.xaml.cs b/ILSpy/App.xaml.cs deleted file mode 100644 index 66f81e7a4..000000000 --- a/ILSpy/App.xaml.cs +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.Loader; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Threading; - -using ICSharpCode.ILSpy.AppEnv; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpyX.Analyzers; - -using Medo.Application; - -using TomsToolbox.Wpf.Styles; -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Composition; -using TomsToolbox.Wpf.Composition; -using ICSharpCode.ILSpy.Themes; -using System.Globalization; -using System.Threading; - -using Microsoft.Extensions.DependencyInjection; - -using TomsToolbox.Composition.MicrosoftExtensions; -using TomsToolbox.Essentials; - -namespace ICSharpCode.ILSpy -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - internal static CommandLineArguments CommandLineArguments; - internal static readonly IList StartupExceptions = new List(); - - public static IExportProvider ExportProvider { get; private set; } - - internal record ExceptionData(Exception Exception) - { - public string PluginName { get; init; } - } - - public App() - { - var cmdArgs = Environment.GetCommandLineArgs().Skip(1); - CommandLineArguments = CommandLineArguments.Create(cmdArgs); - - // This is only a temporary, read only handle to the settings service to access the AllowMultipleInstances setting before DI is initialized. - // At runtime, you must use the service via DI! - var settingsService = new SettingsService(); - - bool forceSingleInstance = (CommandLineArguments.SingleInstance ?? true) - && !settingsService.MiscSettings.AllowMultipleInstances; - if (forceSingleInstance) - { - SingleInstance.Attach(); // will auto-exit for second instance - SingleInstance.NewInstanceDetected += SingleInstance_NewInstanceDetected; - } - - InitializeComponent(); - - if (!InitializeDependencyInjection(settingsService)) - { - // There is something completely wrong with DI, probably some service registration is missing => nothing we can do to recover, so stop and shut down. - Exit += (_, _) => MessageBox.Show(StartupExceptions.FormatExceptions(), "Sorry we crashed!", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly); - Shutdown(1); - return; - } - - if (!Debugger.IsAttached) - { - AppDomain.CurrentDomain.UnhandledException += ShowErrorBox; - Dispatcher.CurrentDispatcher.UnhandledException += Dispatcher_UnhandledException; - } - - TaskScheduler.UnobservedTaskException += DotNet40_UnobservedTaskException; - - SharpTreeNode.SetImagesProvider(new WpfWindowsTreeNodeImagesProvider()); - - Resources.RegisterDefaultStyles(); - - // Register the export provider so that it can be accessed from WPF/XAML components. - ExportProviderLocator.Register(ExportProvider); - // Add data templates registered via MEF. - Resources.MergedDictionaries.Add(DataTemplateManager.CreateDynamicDataTemplates(ExportProvider)); - - var sessionSettings = settingsService.SessionSettings; - ThemeManager.Current.Theme = sessionSettings.Theme; - if (!string.IsNullOrEmpty(sessionSettings.CurrentCulture)) - { - Thread.CurrentThread.CurrentUICulture = CultureInfo.DefaultThreadCurrentUICulture = new(sessionSettings.CurrentCulture); - } - - ILSpyTraceListener.Install(); - - if (CommandLineArguments.ArgumentsParser.IsShowingInformation) - { - MessageBox.Show(CommandLineArguments.ArgumentsParser.GetHelpText(), "ILSpy Command Line Arguments"); - } - - if (CommandLineArguments.ArgumentsParser.RemainingArguments.Any()) - { - string unknownArguments = string.Join(", ", CommandLineArguments.ArgumentsParser.RemainingArguments); - MessageBox.Show(unknownArguments, "ILSpy Unknown Command Line Arguments Passed"); - } - - settingsService.AssemblyListManager.CreateDefaultAssemblyLists(); - } - - public new static App Current => (App)Application.Current; - - public new MainWindow MainWindow { - get => (MainWindow)base.MainWindow; - private set => base.MainWindow = value; - } - - private static void SingleInstance_NewInstanceDetected(object sender, NewInstanceEventArgs e) => ExportProvider.GetExportedValue().HandleSingleInstanceCommandLineArguments(e.Args).HandleExceptions(); - - static Assembly ResolvePluginDependencies(AssemblyLoadContext context, AssemblyName assemblyName) - { - var rootPath = Path.GetDirectoryName(typeof(App).Assembly.Location); - var assemblyFileName = Path.Combine(rootPath, assemblyName.Name + ".dll"); - if (!File.Exists(assemblyFileName)) - return null; - return context.LoadFromAssemblyPath(assemblyFileName); - } - - private bool InitializeDependencyInjection(SettingsService settingsService) - { - // Add custom logic for resolution of dependencies. - // This necessary because the AssemblyLoadContext.LoadFromAssemblyPath and related methods, - // do not automatically load dependencies. - AssemblyLoadContext.Default.Resolving += ResolvePluginDependencies; - try - { - var services = new ServiceCollection(); - - var pluginDir = Path.GetDirectoryName(typeof(App).Module.FullyQualifiedName); - if (pluginDir != null) - { - foreach (var plugin in Directory.GetFiles(pluginDir, "*.Plugin.dll")) - { - var name = Path.GetFileNameWithoutExtension(plugin); - try - { - var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(plugin); - services.BindExports(assembly); - } - catch (Exception ex) - { - // Cannot show MessageBox here, because WPF would crash with a XamlParseException - // Remember and show exceptions in text output, once MainWindow is properly initialized - StartupExceptions.Add(new(ex) { PluginName = name }); - } - } - } - - // Add the built-in parts: First, from ILSpyX - services.BindExports(typeof(IAnalyzer).Assembly); - // Then from ILSpy itself - services.BindExports(Assembly.GetExecutingAssembly()); - // Add the settings service - services.AddSingleton(settingsService); - // Add the export provider - services.AddSingleton(_ => ExportProvider); - // Add the docking manager - services.AddSingleton(serviceProvider => serviceProvider.GetService().DockManager); - services.AddTransient(serviceProvider => serviceProvider.GetService().AssemblyList); - - var serviceProvider = services.BuildServiceProvider(new ServiceProviderOptions { ValidateOnBuild = true }); - - ExportProvider = new ExportProviderAdapter(serviceProvider); - - Exit += (_, _) => serviceProvider.Dispose(); - - return true; - } - catch (Exception ex) - { - if (ex is AggregateException aggregate) - StartupExceptions.AddRange(aggregate.InnerExceptions.Select(item => new ExceptionData(ex))); - else - StartupExceptions.Add(new(ex)); - - return false; - } - } - - protected override void OnStartup(StartupEventArgs e) - { - base.OnStartup(e); - - MainWindow = ExportProvider.GetExportedValue(); - MainWindow.Show(); - } - - void DotNet40_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) - { - // On .NET 4.0, an unobserved exception in a task terminates the process unless we mark it as observed - e.SetObserved(); - } - - #region Exception Handling - static void Dispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) - { - UnhandledException(e.Exception); - e.Handled = true; - } - - static void ShowErrorBox(object sender, UnhandledExceptionEventArgs e) - { - Exception ex = e.ExceptionObject as Exception; - if (ex != null) - { - UnhandledException(ex); - } - } - - [ThreadStatic] - static bool showingError; - - internal static void UnhandledException(Exception exception) - { - Debug.WriteLine(exception.ToString()); - for (Exception ex = exception; ex != null; ex = ex.InnerException) - { - ReflectionTypeLoadException rtle = ex as ReflectionTypeLoadException; - if (rtle != null && rtle.LoaderExceptions.Length > 0) - { - exception = rtle.LoaderExceptions[0]; - Debug.WriteLine(exception.ToString()); - break; - } - } - if (showingError) - { - // Ignore re-entrant calls - // We run the risk of opening an infinite number of exception dialogs. - return; - } - showingError = true; - try - { - MessageBox.Show(exception.ToString(), "Sorry, we crashed"); - } - finally - { - showingError = false; - } - } - #endregion - } -} \ No newline at end of file diff --git a/ILSpy/AppEnv/AppEnvironment.cs b/ILSpy/AppEnv/AppEnvironment.cs deleted file mode 100644 index 2916f855b..000000000 --- a/ILSpy/AppEnv/AppEnvironment.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.InteropServices; - -namespace ICSharpCode.ILSpy.AppEnv -{ - public static class AppEnvironment - { - public static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - } -} diff --git a/ILSpy/AppEnv/CommandLineArguments.cs b/ILSpy/AppEnv/CommandLineArguments.cs deleted file mode 100644 index 2f54879e7..000000000 --- a/ILSpy/AppEnv/CommandLineArguments.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using McMaster.Extensions.CommandLineUtils; - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace ICSharpCode.ILSpy.AppEnv -{ - public sealed class CommandLineArguments - { - // see /doc/Command Line.txt for details - public List AssembliesToLoad = new List(); - public bool? SingleInstance; - public string NavigateTo; - public string Search; - public string Language; - public bool NoActivate; - public string ConfigFile; - - public CommandLineApplication ArgumentsParser { get; } - - private CommandLineArguments(CommandLineApplication app) - { - ArgumentsParser = app; - } - - public static CommandLineArguments Create(IEnumerable arguments) - { - var app = new CommandLineApplication() { - // https://natemcmaster.github.io/CommandLineUtils/docs/response-file-parsing.html?tabs=using-attributes - ResponseFileHandling = ResponseFileHandling.ParseArgsAsLineSeparated, - - // Note: options are case-sensitive (!), and, default behavior would be UnrecognizedArgumentHandling.Throw on Parse() - UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.CollectAndContinue - }; - - app.HelpOption(); - var instance = new CommandLineArguments(app); - - try - { - var oForceNewInstance = app.Option("--newinstance", - "Start a new instance of ILSpy even if the user configuration is set to single-instance", - CommandOptionType.NoValue); - - var oNavigateTo = app.Option("-n|--navigateto ", - "Navigates to the member specified by the given ID string.\r\nThe member is searched for only in the assemblies specified on the command line.\r\nExample: 'ILSpy ILSpy.exe --navigateto T:ICSharpCode.ILSpy.CommandLineArguments'", - CommandOptionType.SingleValue); - oNavigateTo.DefaultValue = null; - - var oSearch = app.Option("-s|--search ", - "Search for t:TypeName, m:Member or c:Constant; use exact match (=term), 'should not contain' (-term) or 'must contain' (+term); use /reg(ular)?Ex(pressions)?/ or both - t:/Type(Name)?/...", - CommandOptionType.SingleValue); - oSearch.DefaultValue = null; - - var oLanguage = app.Option("-l|--language ", - "Selects the specified language.\r\nExample: 'ILSpy --language:C#' or 'ILSpy --language IL'", - CommandOptionType.SingleValue); - oLanguage.DefaultValue = null; - - var oConfig = app.Option("-c|--config ", - "Provide a specific configuration file.\r\nExample: 'ILSpy --config myconfig.xml'", - CommandOptionType.SingleValue); - oConfig.DefaultValue = null; - - var oNoActivate = app.Option("--noactivate", - "Do not activate the existing ILSpy instance. This option has no effect if a new ILSpy instance is being started.", - CommandOptionType.NoValue); - - // https://natemcmaster.github.io/CommandLineUtils/docs/arguments.html#variable-numbers-of-arguments - // To enable this, MultipleValues must be set to true, and the argument must be the last one specified. - var files = app.Argument("Assemblies", "Assemblies to load", multipleValues: true); - - app.Parse(arguments.ToArray()); - - if (oForceNewInstance.HasValue()) - instance.SingleInstance = false; - - instance.NavigateTo = oNavigateTo.ParsedValue; - instance.Search = oSearch.ParsedValue; - instance.Language = oLanguage.ParsedValue; - instance.ConfigFile = oConfig.ParsedValue; - - if (oNoActivate.HasValue()) - instance.NoActivate = true; - - foreach (var assembly in files.Values) - { - if (!string.IsNullOrWhiteSpace(assembly)) - instance.AssembliesToLoad.Add(assembly); - } - } - catch (Exception) - { - // Intentionally ignore exceptions if any, this is only added to always have an exception-free startup - } - - return instance; - } - } -} diff --git a/ILSpy/AppEnv/CommandLineTools.cs b/ILSpy/AppEnv/CommandLineTools.cs deleted file mode 100644 index 898f56c36..000000000 --- a/ILSpy/AppEnv/CommandLineTools.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) 2024 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace ICSharpCode.ILSpy.AppEnv -{ - public class CommandLineTools - { - /// - /// Decodes a command line into an array of arguments according to the CommandLineToArgvW rules. - /// - /// - /// Command line parsing rules: - /// - 2n backslashes followed by a quotation mark produce n backslashes, and the quotation mark is considered to be the end of the argument. - /// - (2n) + 1 backslashes followed by a quotation mark again produce n backslashes followed by a quotation mark. - /// - n backslashes not followed by a quotation mark simply produce n backslashes. - /// - public static string[] CommandLineToArgumentArray(string commandLine) - { - if (string.IsNullOrEmpty(commandLine)) - return Array.Empty(); - - var results = new List(); - ParseArgv.ParseArgumentsIntoList(commandLine, results); - - return results.ToArray(); - } - - static readonly char[] charsNeedingQuoting = { ' ', '\t', '\n', '\v', '"' }; - - /// - /// Escapes a set of arguments according to the CommandLineToArgvW rules. - /// - /// - /// Command line parsing rules: - /// - 2n backslashes followed by a quotation mark produce n backslashes, and the quotation mark is considered to be the end of the argument. - /// - (2n) + 1 backslashes followed by a quotation mark again produce n backslashes followed by a quotation mark. - /// - n backslashes not followed by a quotation mark simply produce n backslashes. - /// - public static string ArgumentArrayToCommandLine(params string[] arguments) - { - if (arguments == null) - return null; - StringBuilder b = new StringBuilder(); - for (int i = 0; i < arguments.Length; i++) - { - if (i > 0) - b.Append(' '); - AppendArgument(b, arguments[i]); - } - return b.ToString(); - } - - static void AppendArgument(StringBuilder b, string arg) - { - if (arg == null) - { - return; - } - - if (arg.Length > 0 && arg.IndexOfAny(charsNeedingQuoting) < 0) - { - b.Append(arg); - } - else - { - b.Append('"'); - for (int j = 0; ; j++) - { - int backslashCount = 0; - while (j < arg.Length && arg[j] == '\\') - { - backslashCount++; - j++; - } - if (j == arg.Length) - { - b.Append('\\', backslashCount * 2); - break; - } - else if (arg[j] == '"') - { - b.Append('\\', backslashCount * 2 + 1); - b.Append('"'); - } - else - { - b.Append('\\', backslashCount); - b.Append(arg[j]); - } - } - b.Append('"'); - } - } - - public static string FullyQualifyPath(string argument) - { - // Fully qualify the paths before passing them to another process, - // because that process might use a different current directory. - if (string.IsNullOrEmpty(argument) || argument[0] == '-') - return argument; - try - { - if (argument.StartsWith("@")) - { - return "@" + FullyQualifyPath(argument.Substring(1)); - } - return Path.Combine(Environment.CurrentDirectory, argument); - } - catch (ArgumentException) - { - return argument; - } - } - } - - // Source: https://github.com/dotnet/runtime/blob/bc9fc5a774d96f95abe0ea5c90fac48b38ed2e67/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs#L574-L606 - // Minor adaptations in GetNextArgument (ValueStringBuilder replaced), otherwise kept as identical as possible - public static class ParseArgv - { - /// Parses a command-line argument string into a list of arguments. - /// The argument string. - /// The list into which the component arguments should be stored. - /// - /// This follows the rules outlined in "Parsing C++ Command-Line Arguments" at - /// https://msdn.microsoft.com/en-us/library/17w5ykft.aspx. - /// - public static void ParseArgumentsIntoList(string arguments, List results) - { - // Iterate through all of the characters in the argument string. - for (int i = 0; i < arguments.Length; i++) - { - while (i < arguments.Length && (arguments[i] == ' ' || arguments[i] == '\t')) - i++; - - if (i == arguments.Length) - break; - - results.Add(GetNextArgument(arguments, ref i)); - } - } - - private static string GetNextArgument(string arguments, ref int i) - { - var currentArgument = new StringBuilder(); - bool inQuotes = false; - - while (i < arguments.Length) - { - // From the current position, iterate through contiguous backslashes. - int backslashCount = 0; - while (i < arguments.Length && arguments[i] == '\\') - { - i++; - backslashCount++; - } - - if (backslashCount > 0) - { - if (i >= arguments.Length || arguments[i] != '"') - { - // Backslashes not followed by a double quote: - // they should all be treated as literal backslashes. - currentArgument.Append('\\', backslashCount); - } - else - { - // Backslashes followed by a double quote: - // - Output a literal slash for each complete pair of slashes - // - If one remains, use it to make the subsequent quote a literal. - currentArgument.Append('\\', backslashCount / 2); - if (backslashCount % 2 != 0) - { - currentArgument.Append('"'); - i++; - } - } - - continue; - } - - char c = arguments[i]; - - // If this is a double quote, track whether we're inside of quotes or not. - // Anything within quotes will be treated as a single argument, even if - // it contains spaces. - if (c == '"') - { - if (inQuotes && i < arguments.Length - 1 && arguments[i + 1] == '"') - { - // Two consecutive double quotes inside an inQuotes region should result in a literal double quote - // (the parser is left in the inQuotes region). - // This behavior is not part of the spec of code:ParseArgumentsIntoList, but is compatible with CRT - // and .NET Framework. - currentArgument.Append('"'); - i++; - } - else - { - inQuotes = !inQuotes; - } - - i++; - continue; - } - - // If this is a space/tab and we're not in quotes, we're done with the current - // argument, it should be added to the results and then reset for the next one. - if ((c == ' ' || c == '\t') && !inQuotes) - { - break; - } - - // Nothing special; add the character to the current argument. - currentArgument.Append(c); - i++; - } - - return currentArgument.ToString(); - } - } -} diff --git a/ILSpy/AppEnv/SingleInstance.cs b/ILSpy/AppEnv/SingleInstance.cs deleted file mode 100644 index 8fa6e2ce4..000000000 --- a/ILSpy/AppEnv/SingleInstance.cs +++ /dev/null @@ -1,286 +0,0 @@ -// Source: https://github.com/medo64/Medo/blob/main/src/Medo/Application/SingleInstance.cs - -/* Josip Medved * www.medo64.com * MIT License */ - -//2022-12-01: Compatible with .NET 6 and 7 -//2012-11-24: Suppressing bogus CA5122 warning (http://connect.microsoft.com/VisualStudio/feedback/details/729254/bogus-ca5122-warning-about-p-invoke-declarations-should-not-be-safe-critical) -//2010-10-07: Added IsOtherInstanceRunning method -//2008-11-14: Reworked code to use SafeHandle -//2008-04-11: Cleaned code to match FxCop 1.36 beta 2 (SpecifyMarshalingForPInvokeStringArguments, NestedTypesShouldNotBeVisible) -//2008-04-10: NewInstanceEventArgs is not nested class anymore -//2008-01-26: AutoExit parameter changed to NoAutoExit -//2008-01-08: Main method is now called Attach -//2008-01-06: System.Environment.Exit returns E_ABORT (0x80004004) -//2008-01-03: Added Resources -//2007-12-29: New version - -#nullable enable - -namespace Medo.Application; - -using System; -using System.Diagnostics; -using System.IO.Pipes; -using System.Linq; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security.Cryptography; -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Threading; - -using ICSharpCode.ILSpy.AppEnv; - -/// -/// Handles detection and communication of programs multiple instances. -/// This class is thread safe. -/// -public static class SingleInstance -{ - - private static Mutex? _mtxFirstInstance; - private static Thread? _thread; - private static readonly object _syncRoot = new(); - - /// - /// Returns true if this application is not already started. - /// Another instance is contacted via named pipe. - /// - /// API call failed. - public static bool Attach() - { - return Attach(false); - } - - private static string[] GetILSpyCommandLineArgs() - { - // Note: NO Skip(1) here because .Args property on SingleInstanceArguments does this for us - return Environment.GetCommandLineArgs().AsEnumerable() - .Select(CommandLineTools.FullyQualifyPath) - .ToArray(); - } - - /// - /// Returns true if this application is not already started. - /// Another instance is contacted via named pipe. - /// - /// If true, application will exit after informing another instance. - /// API call failed. - public static bool Attach(bool noAutoExit) - { - lock (_syncRoot) - { - var isFirstInstance = false; - try - { - _mtxFirstInstance = new Mutex(initiallyOwned: true, @"Global\" + MutexName, out isFirstInstance); - if (isFirstInstance == false) - { //we need to contact previous instance - var contentObject = new SingleInstanceArguments() { - CommandLine = Environment.CommandLine, - CommandLineArgs = GetILSpyCommandLineArgs(), - }; - var contentBytes = JsonSerializer.SerializeToUtf8Bytes(contentObject); - using var clientPipe = new NamedPipeClientStream(".", - MutexName, - PipeDirection.Out, - PipeOptions.CurrentUserOnly | PipeOptions.WriteThrough); - clientPipe.Connect(); - clientPipe.Write(contentBytes, 0, contentBytes.Length); - } - else - { //there is no application already running. - _thread = new Thread(Run) { - Name = typeof(SingleInstance).FullName, - IsBackground = true - }; - _thread.Start(); - } - } - catch (Exception ex) - { - Trace.TraceWarning(ex.Message + " {Medo.Application.SingleInstance}"); - } - - if ((isFirstInstance == false) && (noAutoExit == false)) - { - Trace.TraceInformation("Exit due to another instance running." + " [" + nameof(SingleInstance) + "]"); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - Environment.Exit(unchecked((int)0x80004004)); // E_ABORT(0x80004004) - } - else - { - Environment.Exit(114); // EALREADY(114) - } - } - - return isFirstInstance; - } - } - - private static string? _mutexName; - private static string MutexName { - get { - lock (_syncRoot) - { - if (_mutexName == null) - { - var assembly = Assembly.GetEntryAssembly(); - - var sbMutextName = new StringBuilder(); - var assName = assembly?.GetName().Name; - if (assName != null) - { - sbMutextName.Append(assName, 0, Math.Min(assName.Length, 31)); - sbMutextName.Append('.'); - } - - var sbHash = new StringBuilder(); - sbHash.AppendLine(Environment.MachineName); - sbHash.AppendLine(Environment.UserName); - if (assembly != null) - { - sbHash.AppendLine(assembly.FullName); - sbHash.AppendLine(assembly.Location); - } - else - { - var args = Environment.GetCommandLineArgs(); - if (args.Length > 0) - { sbHash.AppendLine(args[0]); } - } - foreach (var b in SHA256.HashData(Encoding.UTF8.GetBytes(sbHash.ToString()))) - { - if (sbMutextName.Length == 63) - { sbMutextName.AppendFormat("{0:X1}", b >> 4); } // just take the first nubble - if (sbMutextName.Length == 64) - { break; } - sbMutextName.AppendFormat("{0:X2}", b); - } - _mutexName = sbMutextName.ToString(); - } - return _mutexName; - } - } - } - - /// - /// Gets whether there is another instance running. - /// It temporary creates mutex. - /// - public static bool IsOtherInstanceRunning { - get { - lock (_syncRoot) - { - if (_mtxFirstInstance != null) - { - return false; //no other instance is running - } - else - { - var tempInstance = new Mutex(true, MutexName, out var isFirstInstance); - tempInstance.Close(); - return (isFirstInstance == false); - } - } - } - } - - /// - /// Occurs in first instance when new instance is detected. - /// - public static event EventHandler? NewInstanceDetected; - - /// - /// Thread function. - /// - private static void Run() - { - using var serverPipe = new NamedPipeServerStream(MutexName, - PipeDirection.In, - maxNumberOfServerInstances: 1, - PipeTransmissionMode.Byte, - PipeOptions.CurrentUserOnly | PipeOptions.WriteThrough); - while (_mtxFirstInstance != null) - { - try - { - if (!serverPipe.IsConnected) - { serverPipe.WaitForConnection(); } - var contentObject = JsonSerializer.Deserialize(serverPipe); - serverPipe.Disconnect(); - if (contentObject != null) - { - NewInstanceDetected?.Invoke(null, - new NewInstanceEventArgs( - contentObject.CommandLine, - contentObject.CommandLineArgs)); - } - } - catch (Exception ex) - { - Trace.TraceWarning(ex.Message + " [" + nameof(SingleInstance) + "]"); - Thread.Sleep(100); - } - } - } - - [Serializable] - private sealed record SingleInstanceArguments - { // just a storage - [JsonInclude] - public required string CommandLine; - - [JsonInclude] - public required string[] CommandLineArgs; - } - -} - -/// -/// Arguments for newly detected application instance. -/// -public sealed class NewInstanceEventArgs : EventArgs -{ - /// - /// Creates new instance. - /// - /// Command line. - /// String array containing the command line arguments in the same format as Environment.GetCommandLineArgs. - internal NewInstanceEventArgs(string commandLine, string[] commandLineArgs) - { - CommandLine = commandLine; - _commandLineArgs = new string[commandLineArgs.Length]; - Array.Copy(commandLineArgs, _commandLineArgs, _commandLineArgs.Length); - } - - /// - /// Gets the command line. - /// - public string CommandLine { get; } - - private readonly string[] _commandLineArgs; - /// - /// Returns a string array containing the command line arguments. - /// - public string[] GetCommandLineArgs() - { - var argCopy = new string[_commandLineArgs.Length]; - Array.Copy(_commandLineArgs, argCopy, argCopy.Length); - return argCopy; - } - - /// - /// Gets a string array containing the command line arguments without the name of exectuable. - /// - public string[] Args { - get { - var argCopy = new string[_commandLineArgs.Length - 1]; - Array.Copy(_commandLineArgs, 1, argCopy, 0, argCopy.Length); - return argCopy; - } - } - -} diff --git a/ILSpy/AssemblyTree/AssemblyListPane.xaml b/ILSpy/AssemblyTree/AssemblyListPane.xaml deleted file mode 100644 index 0fbc2050d..000000000 --- a/ILSpy/AssemblyTree/AssemblyListPane.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - \ No newline at end of file diff --git a/ILSpy/AssemblyTree/AssemblyListPane.xaml.cs b/ILSpy/AssemblyTree/AssemblyListPane.xaml.cs deleted file mode 100644 index e6ea4d3a1..000000000 --- a/ILSpy/AssemblyTree/AssemblyListPane.xaml.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2024 Tom Englert for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Windows; -using System.Windows.Threading; - -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Wpf; -using TomsToolbox.Wpf.Composition.AttributedModel; - -namespace ICSharpCode.ILSpy.AssemblyTree -{ - /// - /// Interaction logic for AssemblyListPane.xaml - /// - [DataTemplate(typeof(AssemblyTreeModel))] - [NonShared] - public partial class AssemblyListPane - { - public AssemblyListPane() - { - InitializeComponent(); - - ContextMenuProvider.Add(this); - } - - protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) - { - base.OnPropertyChanged(e); - - if (e.Property == DataContextProperty) - { - if (e.NewValue is not AssemblyTreeModel model) - return; - - model.SetActiveView(this); - - // If there is already a selected item in the model, we need to scroll it into view, so it can be selected in the UI. - var selected = model.SelectedItem; - if (selected != null) - { - this.BeginInvoke(DispatcherPriority.Background, () => { - ScrollIntoView(selected); - this.SelectedItem = selected; - }); - } - } - else if (e.Property == Pane.IsActiveProperty) - { - if (!true.Equals(e.NewValue)) - return; - - if (SelectedItem is SharpTreeNode selectedItem) - { - // defer focusing, so it does not interfere with selection via mouse click - this.BeginInvoke(() => { - if (this.SelectedItem == selectedItem) - FocusNode(selectedItem); - }); - } - else - { - Focus(); - } - } - } - } -} diff --git a/ILSpy/AssemblyTree/AssemblyTreeModel.cs b/ILSpy/AssemblyTree/AssemblyTreeModel.cs deleted file mode 100644 index cdcb8dac7..000000000 --- a/ILSpy/AssemblyTree/AssemblyTreeModel.cs +++ /dev/null @@ -1,1111 +0,0 @@ -// Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Composition; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Linq; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Input; -using System.Windows.Navigation; -using System.Windows.Threading; - -using ICSharpCode.Decompiler.Documentation; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.Decompiler.TypeSystem.Implementation; -using ICSharpCode.ILSpy.AppEnv; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.Updates; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Composition; -using TomsToolbox.Essentials; -using TomsToolbox.Wpf; - -#nullable enable - -namespace ICSharpCode.ILSpy.AssemblyTree -{ - [ExportToolPane] - [Shared] - public partial class AssemblyTreeModel : ToolPaneModel - { - public const string PaneContentId = "assemblyListPane"; - - private AssemblyListPane? activeView; - private AssemblyListTreeNode? assemblyListTreeNode; - private readonly DispatcherThrottle refreshThrottle; - - private readonly NavigationHistory history = new(); - private NavigationState? navigatingToState; - private object? sourceOfReference; - private readonly SettingsService settingsService; - private readonly LanguageService languageService; - private readonly IExportProvider exportProvider; - - private static Dispatcher UIThreadDispatcher => Application.Current.Dispatcher; - - private void Settings_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - if (sender is SessionSettings sessionSettings) - { - switch (e.PropertyName) - { - case nameof(SessionSettings.ActiveAssemblyList): - ShowAssemblyList(sessionSettings.ActiveAssemblyList); - RefreshDecompiledView(); - break; - case nameof(SessionSettings.Theme): - // update syntax highlighting and force reload (AvalonEdit does not automatically refresh on highlighting change) - DecompilerTextView.RegisterHighlighting(); - RefreshDecompiledView(); - break; - case nameof(SessionSettings.CurrentCulture): - MessageBox.Show(Resources.SettingsChangeRestartRequired, "ILSpy"); - break; - } - } - else if (sender is LanguageSettings) - { - switch (e.PropertyName) - { - case nameof(LanguageSettings.LanguageId) or nameof(LanguageSettings.LanguageVersionId): - RefreshDecompiledView(); - break; - default: - Refresh(); - break; - } - } - } - - public AssemblyList AssemblyList { get; private set; } - - private SharpTreeNode? root; - public SharpTreeNode? Root { - get => root; - set => SetProperty(ref root, value); - } - - public SharpTreeNode? SelectedItem { - get => SelectedItems.FirstOrDefault(); - set => SelectedItems = value is null ? [] : [value]; - } - - private SharpTreeNode[] selectedItems = []; - public SharpTreeNode[] SelectedItems { - get => selectedItems; - set { - if (selectedItems.SequenceEqual(value)) - return; - - var oldSelection = selectedItems; - selectedItems = value; - OnPropertyChanged(); -#if CROSS_PLATFORM - OnPropertyChanged(nameof(SelectedItem)); -#endif - TreeView_SelectionChanged(oldSelection, selectedItems); - } - } - - public string[]? SelectedPath => GetPathForNode(SelectedItem); - - private readonly List commandLineLoadedAssemblies = []; - - private bool HandleCommandLineArguments(CommandLineArguments args) - { - LoadAssemblies(args.AssembliesToLoad, commandLineLoadedAssemblies, focusNode: false); - if (args.Language != null) - languageService.Language = languageService.GetLanguage(args.Language); - return true; - } - - /// - /// Called on startup or when passed arguments via WndProc from a second instance. - /// In the format case, updateSettings is non-null; in the latter it is null. - /// - private async Task HandleCommandLineArgumentsAfterShowList(CommandLineArguments args, UpdateSettings? updateSettings = null) - { - var sessionSettings = settingsService.SessionSettings; - - var relevantAssemblies = commandLineLoadedAssemblies.ToList(); - commandLineLoadedAssemblies.Clear(); // clear references once we don't need them anymore - - await NavigateOnLaunch(args.NavigateTo, sessionSettings.ActiveTreeViewPath, updateSettings, relevantAssemblies); - - if (args.Search != null) - { - MessageBus.Send(this, new ShowSearchPageEventArgs(args.Search)); - } - } - - public async Task HandleSingleInstanceCommandLineArguments(string[] args) - { - var cmdArgs = CommandLineArguments.Create(args); - - await UIThreadDispatcher.InvokeAsync(async () => { - - if (!HandleCommandLineArguments(cmdArgs)) - return; - - var window = Application.Current.MainWindow; - - if (!cmdArgs.NoActivate && window is { WindowState: WindowState.Minimized }) - { - window.WindowState = WindowState.Normal; - } - - await HandleCommandLineArgumentsAfterShowList(cmdArgs); - }); - } - - private async Task NavigateOnLaunch(string? navigateTo, string[]? activeTreeViewPath, UpdateSettings? updateSettings, List relevantAssemblies) - { - var initialSelection = SelectedItem; - if (navigateTo != null) - { - bool found = false; - if (navigateTo.StartsWith("N:", StringComparison.Ordinal)) - { - string namespaceName = navigateTo.Substring(2); - foreach (LoadedAssembly asm in relevantAssemblies) - { - var asmNode = assemblyListTreeNode?.FindAssemblyNode(asm); - if (asmNode != null) - { - // FindNamespaceNode() blocks the UI if the assembly is not yet loaded, - // so use an async wait instead. - await asm.GetMetadataFileAsync().Catch(_ => { }); - NamespaceTreeNode nsNode = asmNode.FindNamespaceNode(namespaceName); - if (nsNode != null) - { - found = true; - if (SelectedItem == initialSelection) - { - SelectNode(nsNode); - } - break; - } - } - } - } - else if (navigateTo == "none") - { - // Don't navigate anywhere; start empty. - // Used by ILSpy VS addin, it'll send us the real location to navigate to via IPC. - found = true; - } - else - { - IEntity? mr = await Task.Run(() => FindEntityInRelevantAssemblies(navigateTo, relevantAssemblies)); - - // Make sure we wait for assemblies being loaded... - // BeginInvoke in LoadedAssembly.LookupReferencedAssemblyInternal - await UIThreadDispatcher.InvokeAsync(delegate { }, DispatcherPriority.Normal); - - if (mr is { ParentModule.MetadataFile: not null }) - { - found = true; - if (SelectedItem == initialSelection) - { - await JumpToReferenceAsync(mr, null); - } - } - } - if (!found && SelectedItem == initialSelection) - { - AvalonEditTextOutput output = new AvalonEditTextOutput(); - output.Write($"Cannot find '{navigateTo}' in command line specified assemblies."); - DockWorkspace.ShowText(output); - } - } - else if (relevantAssemblies.Count == 1) - { - // NavigateTo == null and an assembly was given on the command-line: - // Select the newly loaded assembly - var asmNode = assemblyListTreeNode?.FindAssemblyNode(relevantAssemblies[0]); - if (asmNode != null && SelectedItem == initialSelection) - { - SelectNode(asmNode); - } - } - else if (updateSettings != null) - { - SharpTreeNode? node = null; - if (activeTreeViewPath?.Length > 0) - { - foreach (var asm in AssemblyList.GetAssemblies()) - { - if (asm.FileName == activeTreeViewPath[0]) - { - // FindNodeByPath() blocks the UI if the assembly is not yet loaded, - // so use an async wait instead. - await asm.GetMetadataFileAsync().Catch(_ => { }); - } - } - node = FindNodeByPath(activeTreeViewPath, true); - } - if (SelectedItem == initialSelection) - { - if (node != null) - { - SelectNode(node); - - // only if not showing the about page, perform the update check: - MessageBus.Send(this, new CheckIfUpdateAvailableEventArgs()); - } - else - { - MessageBus.Send(this, new ShowAboutPageEventArgs(DockWorkspace.ActiveTabPage)); - } - } - } - } - - public static IEntity? FindEntityInRelevantAssemblies(string navigateTo, IEnumerable relevantAssemblies) - { - ITypeReference typeRef; - IMemberReference? memberRef = null; - if (navigateTo.StartsWith("T:", StringComparison.Ordinal)) - { - typeRef = IdStringProvider.ParseTypeName(navigateTo); - } - else - { - memberRef = IdStringProvider.ParseMemberIdString(navigateTo); - typeRef = memberRef.DeclaringTypeReference; - } - foreach (LoadedAssembly asm in relevantAssemblies.ToList()) - { - var module = asm.GetMetadataFileOrNull(); - if (module != null && CanResolveTypeInPEFile(module, typeRef, out var typeHandle)) - { - ICompilation compilation = typeHandle.Kind == HandleKind.ExportedType - ? new DecompilerTypeSystem(module, module.GetAssemblyResolver()) - : new SimpleCompilation((PEFile)module, MinimalCorlib.Instance); - return memberRef == null - ? typeRef.Resolve(new SimpleTypeResolveContext(compilation)) as ITypeDefinition - : memberRef.Resolve(new SimpleTypeResolveContext(compilation)); - } - } - return null; - } - - private static bool CanResolveTypeInPEFile(MetadataFile module, ITypeReference typeRef, out EntityHandle typeHandle) - { - // We intentionally ignore reference assemblies, so that the loop continues looking for another assembly that might have a usable definition. - if (module.IsReferenceAssembly()) - { - typeHandle = default; - return false; - } - - switch (typeRef) - { - case GetPotentiallyNestedClassTypeReference topLevelType: - typeHandle = topLevelType.ResolveInPEFile(module); - return !typeHandle.IsNil; - case NestedTypeReference nestedType: - if (!CanResolveTypeInPEFile(module, nestedType.DeclaringTypeReference, out typeHandle)) - return false; - if (typeHandle.Kind == HandleKind.ExportedType) - return true; - var typeDef = module.Metadata.GetTypeDefinition((TypeDefinitionHandle)typeHandle); - typeHandle = typeDef.GetNestedTypes().FirstOrDefault(t => { - var td = module.Metadata.GetTypeDefinition(t); - var typeName = ReflectionHelper.SplitTypeParameterCountFromReflectionName(module.Metadata.GetString(td.Name), out int typeParameterCount); - return nestedType.AdditionalTypeParameterCount == typeParameterCount && nestedType.Name == typeName; - }); - return !typeHandle.IsNil; - default: - typeHandle = default; - return false; - } - } - - public void Initialize() - { - AssemblyList = settingsService.LoadInitialAssemblyList(); - - HandleCommandLineArguments(App.CommandLineArguments); - - var loadPreviousAssemblies = settingsService.MiscSettings.LoadPreviousAssemblies; - if (AssemblyList.GetAssemblies().Length == 0 - && AssemblyList.ListName == AssemblyListManager.DefaultListName - && loadPreviousAssemblies) - { - LoadInitialAssemblies(AssemblyList); - } - - ShowAssemblyList(AssemblyList); - - var sessionSettings = settingsService.SessionSettings; - if (sessionSettings.ActiveAutoLoadedAssembly != null - && File.Exists(sessionSettings.ActiveAutoLoadedAssembly)) - { - AssemblyList.Open(sessionSettings.ActiveAutoLoadedAssembly, true); - } - - UIThreadDispatcher.BeginInvoke(DispatcherPriority.Loaded, OpenAssemblies); - } - - private async Task OpenAssemblies() - { - await HandleCommandLineArgumentsAfterShowList(App.CommandLineArguments, settingsService.GetSettings()); - - if (FormatExceptions(App.StartupExceptions.ToArray(), out var output)) - { - output.Title = "Startup errors"; - - DockWorkspace.AddTabPage(); - DockWorkspace.ShowText(output); - } - } - - private static bool FormatExceptions(App.ExceptionData[] exceptions, [NotNullWhen(true)] out AvalonEditTextOutput? output) - { - output = null; - - var result = exceptions.FormatExceptions(); - if (result.IsNullOrEmpty()) - return false; - - output = new(); - output.Write(result); - return true; - - } - - private void ShowAssemblyList(string name) - { - AssemblyList list = settingsService.AssemblyListManager.LoadList(name); - //Only load a new list when it is a different one - if (list.ListName != AssemblyList.ListName) - { - ShowAssemblyList(list); - SelectNode(Root?.Children.FirstOrDefault()); - } - } - - private void ShowAssemblyList(AssemblyList assemblyList) - { - history.Clear(); - - AssemblyList.CollectionChanged -= assemblyList_CollectionChanged; - AssemblyList = assemblyList; - assemblyList.CollectionChanged += assemblyList_CollectionChanged; - - assemblyListTreeNode = new(assemblyList) { - Select = x => SelectNode(x) - }; - - Root = assemblyListTreeNode; - - var mainWindow = Application.Current?.MainWindow; - - if (mainWindow == null) - return; - - if (assemblyList.ListName == AssemblyListManager.DefaultListName) -#if DEBUG - mainWindow.Title = $"ILSpy {DecompilerVersionInfo.FullVersion}"; -#else - mainWindow.Title = "ILSpy"; -#endif - else -#if DEBUG - mainWindow.Title = string.Format(settingsService.MiscSettings.AllowMultipleInstances ? "{1} - {0}" : "{0} - {1}", $"ILSpy {DecompilerVersionInfo.FullVersion}", assemblyList.ListName); -#else - mainWindow.Title = string.Format(settingsService.MiscSettings.AllowMultipleInstances ? "{1} - {0}" : "{0} - {1}", "ILSpy", assemblyList.ListName); -#endif - } - - private void assemblyList_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) - { - if (e.Action == NotifyCollectionChangedAction.Reset) - { - history.RemoveAll(_ => true); - } - if (e.OldItems != null) - { - var oldAssemblies = new HashSet(e.OldItems.Cast()); - history.RemoveAll(n => n.TreeNodes.Any( - nd => nd.AncestorsAndSelf().OfType().Any( - a => oldAssemblies.Contains(a.LoadedAssembly)))); - } - - MessageBus.Send(this, new CurrentAssemblyListChangedEventArgs(e)); - } - - public AssemblyTreeNode? FindAssemblyNode(LoadedAssembly asm) - { - return assemblyListTreeNode?.FindAssemblyNode(asm); - } - - #region Node Selection - - public void SelectNode(SharpTreeNode? node, bool inNewTabPage = false) - { - if (node == null) - return; - - if (node.AncestorsAndSelf().Any(item => item.IsHidden)) - { - MessageBox.Show(Resources.NavigationFailed, "ILSpy", MessageBoxButton.OK, MessageBoxImage.Exclamation); - return; - } - - if (inNewTabPage) - { - DockWorkspace.AddTabPage(); - SelectedItem = null; - } - - if (SelectedItem == node) - { - UIThreadDispatcher.BeginInvoke(RefreshDecompiledView); - } - else - { -#if CROSS_PLATFORM - ExpandAncestors(node); -#endif - activeView?.ScrollIntoView(node); - SelectedItem = node; - - UIThreadDispatcher.BeginInvoke(DispatcherPriority.Background, () => { -#if CROSS_PLATFORM - SelectedItem = node; -#endif - activeView?.ScrollIntoView(node); - }); - } - } - - public void SelectNodes(IEnumerable nodes) - { - // Ensure nodes exist - var nodesList = nodes.Select(n => FindNodeByPath(GetPathForNode(n), true)) - .ExceptNullItems() - .ToArray(); - - if (!nodesList.Any() || nodesList.Any(n => n.AncestorsAndSelf().Any(a => a.IsHidden))) - { - return; - } - - foreach (var node in nodesList) - { - activeView?.ScrollIntoView(node); - } - - SelectedItems = nodesList.ToArray(); - } - - /// - /// Retrieves a node using the .ToString() representations of its ancestors. - /// - public SharpTreeNode? FindNodeByPath(string[]? path, bool returnBestMatch) - { - if (path == null) - return null; - var node = Root; - var bestMatch = node; - foreach (var element in path) - { - if (node == null) - break; - bestMatch = node; - node.EnsureLazyChildren(); - if (node is ILSpyTreeNode ilSpyTreeNode) - ilSpyTreeNode.EnsureChildrenFiltered(); - node = node.Children.FirstOrDefault(c => c.ToString() == element); - } - - return returnBestMatch ? node ?? bestMatch : node; - } - - /// - /// Gets the .ToString() representation of the node's ancestors. - /// - public static string[]? GetPathForNode(SharpTreeNode? node) - { - if (node == null) - return null; - List path = new List(); - while (node.Parent != null) - { - path.Add(node.ToString()!); - node = node.Parent; - } - path.Reverse(); - return path.ToArray(); - } - - public ILSpyTreeNode? FindTreeNode(object? reference) - { - if (assemblyListTreeNode == null) - return null; - - switch (reference) - { - case LoadedAssembly lasm: - return assemblyListTreeNode.FindAssemblyNode(lasm); - case MetadataFile asm: - return assemblyListTreeNode.FindAssemblyNode(asm); - case Resource res: - return assemblyListTreeNode.FindResourceNode(res); - case ValueTuple resName: - return assemblyListTreeNode.FindResourceNode(resName.Item1, resName.Item2); - case ITypeDefinition type: - return assemblyListTreeNode.FindTypeNode(type); - case IField fd: - return assemblyListTreeNode.FindFieldNode(fd); - case IMethod md: - return assemblyListTreeNode.FindMethodNode(md); - case IProperty pd: - return assemblyListTreeNode.FindPropertyNode(pd); - case IEvent ed: - return assemblyListTreeNode.FindEventNode(ed); - case INamespace nd: - return assemblyListTreeNode.FindNamespaceNode(nd); - default: - return null; - } - } - - private void JumpToReference(object? sender, NavigateToReferenceEventArgs e) - { - JumpToReferenceAsync(e.Reference, e.Source, e.InNewTabPage).HandleExceptions(); - IsActive = true; - } - - /// - /// Jumps to the specified reference. - /// - /// - /// Returns a task that will signal completion when the decompilation of the jump target has finished. - /// The task will be marked as canceled if the decompilation is canceled. - /// - private Task JumpToReferenceAsync(object? reference, object? source, bool inNewTabPage = false) - { - this.sourceOfReference = source; - var decompilationTask = Task.CompletedTask; - - switch (reference) - { - case Decompiler.Disassembler.OpCodeInfo opCode: - GlobalUtils.OpenLink(opCode.Link); - break; - case EntityReference unresolvedEntity: - string protocol = unresolvedEntity.Protocol; - var file = unresolvedEntity.ResolveAssembly(AssemblyList); - if (file == null) - { - break; - } - if (protocol != "decompile") - { - foreach (var handler in exportProvider.GetExportedValues()) - { - var node = handler.Resolve(protocol, file, unresolvedEntity.Handle, out bool newTabPage); - if (node != null) - { - SelectNode(node, newTabPage || inNewTabPage); - return decompilationTask; - } - } - } - var possibleToken = MetadataTokenHelpers.TryAsEntityHandle(MetadataTokens.GetToken(unresolvedEntity.Handle)); - if (possibleToken != null) - { - var typeSystem = new DecompilerTypeSystem(file, file.GetAssemblyResolver(), TypeSystemOptions.Default | TypeSystemOptions.Uncached); - reference = typeSystem.MainModule.ResolveEntity(possibleToken.Value); - goto default; - } - break; - default: - var treeNode = FindTreeNode(reference); - if (treeNode != null) - SelectNode(treeNode, inNewTabPage); - break; - } - return decompilationTask; - } - - #endregion - - private void LoadAssemblies(IEnumerable fileNames, List? loadedAssemblies = null, bool focusNode = true) - { - using (Keyboard.FocusedElement.PreserveFocus(!focusNode)) - { - AssemblyTreeNode? lastNode = null; - - var assemblyList = AssemblyList; - - foreach (string file in fileNames) - { - var assembly = assemblyList.OpenAssembly(file); - - if (loadedAssemblies != null) - { - loadedAssemblies.Add(assembly); - } - else - { - var node = assemblyListTreeNode?.FindAssemblyNode(assembly); - if (node != null && focusNode) - { - lastNode = node; - activeView?.ScrollIntoView(node); - SelectedItems = [.. SelectedItems, node]; - } - } - } - if (focusNode && lastNode != null) - { - activeView?.FocusNode(lastNode); - } - } - } - - #region Decompile (TreeView_SelectionChanged) - - private void TreeView_SelectionChanged(SharpTreeNode[] oldSelection, SharpTreeNode[] newSelection) - { - var activeTabPage = DockWorkspace.ActiveTabPage; - ViewState? oldState = activeTabPage.GetState(); - ViewState? newState; - - if (navigatingToState == null) - { - if (oldState != null) - { - history.UpdateCurrent(new NavigationState(activeTabPage, oldState)); - } - - newState = new ViewState { DecompiledNodes = [.. newSelection.Cast()] }; - } - else - { - newState = navigatingToState.ViewState; - } - - if (newSelection.Length == 0) - { - // To cancel any pending decompilation requests and show an empty tab - DecompileSelectedNodes(newState); - } - else - { - var delayDecompilationRequestDueToContextMenu = Mouse.RightButton == MouseButtonState.Pressed; - - if (!delayDecompilationRequestDueToContextMenu) - { - var previousNodes = oldState?.DecompiledNodes - ?.Select(n => FindNodeByPath(GetPathForNode(n), true)) - .ExceptNullItems() - .ToArray() ?? []; - - if (!previousNodes.SequenceEqual(SelectedItems)) - { - DecompileSelectedNodes(newState); - } - } - else - { - // ensure that we are only connected once to the event, else we might get multiple notifications - ContextMenuProvider.ContextMenuClosed -= ContextMenuClosed; - ContextMenuProvider.ContextMenuClosed += ContextMenuClosed; - } - } - - MessageBus.Send(this, new AssemblyTreeSelectionChangedEventArgs()); - - return; - - void ContextMenuClosed(object? sender, EventArgs e) - { - ContextMenuProvider.ContextMenuClosed -= ContextMenuClosed; - - UIThreadDispatcher.BeginInvoke(DispatcherPriority.Background, () => { - if (Mouse.RightButton != MouseButtonState.Pressed) - { - RefreshDecompiledView(); - } - }); - } - } - - public void DecompileSelectedNodes(ViewState? newState = null) - { - object? source = this.sourceOfReference; - this.sourceOfReference = null; - var activeTabPage = DockWorkspace.ActiveTabPage; - - if (activeTabPage.FrozenContent) - { - activeTabPage = DockWorkspace.AddTabPage(); - } - - activeTabPage.SupportsLanguageSwitching = true; - - if (newState != null && navigatingToState == null) - { - history.Record(new NavigationState(activeTabPage, newState)); - } - - if (SelectedItems.Length == 1) - { - if (SelectedItem is ILSpyTreeNode node && node.View(activeTabPage)) - return; - } - if (newState?.ViewedUri != null) - { - NavigateTo(new(newState.ViewedUri, null)); - return; - } - - var options = activeTabPage.CreateDecompilationOptions(); - options.TextViewState = newState as DecompilerTextViewState; - activeTabPage.ShowTextViewAsync(textView => { - return textView.DecompileAsync(this.CurrentLanguage, this.SelectedNodes, source, options); - }); - } - - public void RefreshDecompiledView() - { - DecompileSelectedNodes(DockWorkspace.ActiveTabPage.GetState() as DecompilerTextViewState); - } - - public Language CurrentLanguage => languageService.Language; - - public LanguageVersion? CurrentLanguageVersion => languageService.LanguageVersion; - - public IEnumerable SelectedNodes => GetTopLevelSelection().OfType(); - - #endregion - - public void NavigateHistory(bool forward, NavigationState? toState = null) - { - try - { - TabPageModel tabPage = DockWorkspace.ActiveTabPage; - var currentState = tabPage.GetState(); - if (currentState != null) - history.UpdateCurrent(new NavigationState(tabPage, currentState)); - - NavigationState newState; - do - { - newState = forward ? history.GoForward() : history.GoBack(); - } while (newState != null && toState != null && toState != newState); - - if (newState == null) - return; - - navigatingToState = newState; - - TabPageModel activeTabPage = newState.TabPage; - - Debug.Assert(DockWorkspace.TabPages.Contains(activeTabPage)); - DockWorkspace.ActiveTabPage = activeTabPage; - - if (newState.TreeNodes.Any()) - { - SelectNodes(newState.TreeNodes); - } - else if (newState.ViewState.ViewedUri != null) - { - NavigateTo(new(newState.ViewState.ViewedUri, null)); - } - } - finally - { - navigatingToState = null; - } - } - - public NavigationState[] GetNavigateHistory(bool forward) => forward ? history.ForwardList : history.BackList; - - public bool CanNavigateBack => history.CanNavigateBack; - - public bool CanNavigateForward => history.CanNavigateForward; - - private void NavigateTo(RequestNavigateEventArgs e, bool inNewTabPage = false) - { - if (e.Uri.Scheme != "resource") - { - return; - } - - TabPageModel tabPage = DockWorkspace.ActiveTabPage; - ViewState? oldState = tabPage.GetState(); - ViewState? newState; - - if (navigatingToState == null) - { - if (oldState != null) - { - history.UpdateCurrent(new NavigationState(tabPage, oldState)); - } - - newState = new ViewState { ViewedUri = e.Uri }; - - if (inNewTabPage) - { - tabPage = DockWorkspace.AddTabPage(); - } - } - else - { - newState = navigatingToState.ViewState; - tabPage = DockWorkspace.ActiveTabPage = navigatingToState.TabPage; - } - - bool needsNewNavigationEntry = !inNewTabPage && selectedItems?.Length == 0; - - UnselectAll(); - - if (e.Uri.Host == "aboutpage") - { - MessageBus.Send(this, new ShowAboutPageEventArgs(DockWorkspace.ActiveTabPage)); - e.Handled = true; - } - else - { - AvalonEditTextOutput output = new AvalonEditTextOutput { - Address = e.Uri, - Title = e.Uri.AbsolutePath, - EnableHyperlinks = true - }; - using (Stream? s = typeof(App).Assembly.GetManifestResourceStream(typeof(App), e.Uri.AbsolutePath)) - { - if (s != null) - { - using StreamReader r = new StreamReader(s); - string? line; - while ((line = r.ReadLine()) != null) - { - output.Write(line); - output.WriteLine(); - } - } - } - DockWorkspace.ShowText(output); - e.Handled = true; - } - - if (navigatingToState == null) - { - // the call to UnselectAll() above already creates a new navigation entry, - // we just need to make sure it contains something useful. - if (!needsNewNavigationEntry) - { - history.UpdateCurrent(new NavigationState(tabPage, tabPage.GetState())); - } - else - { - history.Record(new NavigationState(tabPage, tabPage.GetState())); - } - } - } - - public void Refresh() - { - refreshThrottle.Tick(); - } - - private void RefreshInternal() - { - RefreshInternalAsync().HandleExceptions(); - } - - private async Task RefreshInternalAsync() - { - using (Keyboard.FocusedElement.PreserveFocus()) - { - var path = GetPathForNode(SelectedItem); - - ShowAssemblyList(settingsService.AssemblyListManager.LoadList(AssemblyList.ListName)); - - // Ensure the assembly is loaded before FindNodeByPath, so lazy-loaded - // resource nodes (e.g. .baml entries) are present in the tree. - if (path?.Length > 0) - { - var rootAssembly = AssemblyList.FindAssembly(path[0]); - if (rootAssembly != null) - { - // FindNodeByPath() blocks the UI if the assembly is not yet loaded, - // so use an async wait instead. - var preAwaitSelection = SelectedItem; - await rootAssembly.GetMetadataFileAsync().Catch(_ => { }); - - // If the user navigated to a different node while the assembly - // was loading, respect that — don't restore the pre-refresh path. - // A change to null counts too (e.g. user cleared the selection). - if (!ReferenceEquals(SelectedItem, preAwaitSelection)) - { - RefreshDecompiledView(); - return; - } - } - } - - SelectNode(FindNodeByPath(path, true), inNewTabPage: false); - - RefreshDecompiledView(); - } - } - - private void UnselectAll() - { - SelectedItems = []; - } - - private IEnumerable GetTopLevelSelection() - { - var selection = this.SelectedItems; - var selectionHash = new HashSet(selection); - - return selection.Where(item => item.Ancestors().All(a => !selectionHash.Contains(a))); - } - - void ExpandAncestors(SharpTreeNode node) - { - foreach (var ancestor in node.Ancestors().Reverse()) - { - ancestor.EnsureLazyChildren(); - ancestor.IsExpanded = true; - } - } - - public void SetActiveView(AssemblyListPane activeView) - { - this.activeView = activeView; - } - - public void SortAssemblyList() - { - using (activeView?.LockUpdates()) - { - AssemblyList.Sort(AssemblyComparer.Instance); - } - } - - private class AssemblyComparer : IComparer - { - public static readonly AssemblyComparer Instance = new(); - int IComparer.Compare(LoadedAssembly? x, LoadedAssembly? y) - { - return string.Compare(x?.ShortName, y?.ShortName, StringComparison.CurrentCulture); - } - } - - public void CollapseAll() - { - using (activeView?.LockUpdates()) - { - CollapseChildren(Root); - } - } - - private static void CollapseChildren(SharpTreeNode? node) - { - if (node is null) - return; - - foreach (var child in node.Children) - { - if (!child.IsExpanded) - continue; - - CollapseChildren(child); - child.IsExpanded = false; - } - } - - public void OpenFiles(string[] fileNames, bool focusNode = true) - { - if (fileNames == null) - throw new ArgumentNullException(nameof(fileNames)); - - if (focusNode) - UnselectAll(); - - LoadAssemblies(fileNames, focusNode: focusNode); - } - - private void ApplySessionSettings(object? sender, ApplySessionSettingsEventArgs e) - { - var settings = e.SessionSettings; - - settings.ActiveAssemblyList = AssemblyList.ListName; - settings.ActiveTreeViewPath = SelectedPath; - settings.ActiveAutoLoadedAssembly = GetAutoLoadedAssemblyNode(SelectedItem); - } - - private static string? GetAutoLoadedAssemblyNode(SharpTreeNode? node) - { - var assemblyTreeNode = node? - .AncestorsAndSelf() - .OfType() - .FirstOrDefault(); - - var loadedAssembly = assemblyTreeNode?.LoadedAssembly; - - return loadedAssembly is not { IsLoaded: true, IsAutoLoaded: true } - ? null - : loadedAssembly.FileName; - } - - private void ActiveTabPageChanged(object? sender, ActiveTabPageChangedEventArgs e) - { - if (e.ViewState is not { } state) - return; - - if (state.DecompiledNodes != null) - { - SelectNodes(state.DecompiledNodes); - } - else - { - NavigateTo(new(state.ViewedUri, null)); - } - } - - private void ResetLayout(object? sender, ResetLayoutEventArgs e) - { - RefreshDecompiledView(); - } - } -} diff --git a/ILSpy/AssemblyTree/AssemblyTreeModel.wpf.cs b/ILSpy/AssemblyTree/AssemblyTreeModel.wpf.cs deleted file mode 100644 index 9c3f49cb1..000000000 --- a/ILSpy/AssemblyTree/AssemblyTreeModel.wpf.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Navigation; -using System.Windows.Threading; - -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpyX; - -using TomsToolbox.Composition; - -namespace ICSharpCode.ILSpy.AssemblyTree -{ - public partial class AssemblyTreeModel - { - public AssemblyTreeModel(SettingsService settingsService, LanguageService languageService, IExportProvider exportProvider) - { - this.settingsService = settingsService; - this.languageService = languageService; - this.exportProvider = exportProvider; - - Title = Resources.Assemblies; - ContentId = PaneContentId; - IsCloseable = false; - ShortcutKey = new KeyGesture(Key.F6); - - MessageBus.Subscribers += JumpToReference; - MessageBus.Subscribers += (sender, e) => Settings_PropertyChanged(sender, e); - MessageBus.Subscribers += ApplySessionSettings; - MessageBus.Subscribers += ActiveTabPageChanged; - MessageBus.Subscribers += (_, e) => history.RemoveAll(s => !DockWorkspace.TabPages.Contains(s.TabPage)); - MessageBus.Subscribers += ResetLayout; - MessageBus.Subscribers += (_, e) => NavigateTo(e.Request, e.InNewTabPage); - MessageBus.Subscribers += (_, _) => { - Initialize(); - Show(); - }; - - EventManager.RegisterClassHandler(typeof(Window), Hyperlink.RequestNavigateEvent, new RequestNavigateEventHandler((_, e) => NavigateTo(e))); - - refreshThrottle = new(DispatcherPriority.Background, RefreshInternal); - - AssemblyList = settingsService.CreateEmptyAssemblyList(); - } - - private static void LoadInitialAssemblies(AssemblyList assemblyList) - { - // Called when loading an empty assembly list; so that - // the user can see something initially. - System.Reflection.Assembly[] initialAssemblies = { - typeof(object).Assembly, - typeof(Uri).Assembly, - typeof(System.Linq.Enumerable).Assembly, - typeof(System.Xml.XmlDocument).Assembly, - typeof(System.Windows.Markup.MarkupExtension).Assembly, - typeof(System.Windows.Rect).Assembly, - typeof(System.Windows.UIElement).Assembly, - typeof(System.Windows.FrameworkElement).Assembly - }; - foreach (System.Reflection.Assembly asm in initialAssemblies) - assemblyList.OpenAssembly(asm.Location); - } - } -} \ No newline at end of file diff --git a/ILSpy/AvalonEdit/ITextMarker.cs b/ILSpy/AvalonEdit/ITextMarker.cs deleted file mode 100644 index ec7c5c93b..000000000 --- a/ILSpy/AvalonEdit/ITextMarker.cs +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Media; - -namespace ICSharpCode.ILSpy.AvalonEdit -{ - /// - /// Represents a text marker. - /// - public interface ITextMarker - { - /// - /// Gets the start offset of the marked text region. - /// - int StartOffset { get; } - - /// - /// Gets the end offset of the marked text region. - /// - int EndOffset { get; } - - /// - /// Gets the length of the marked region. - /// - int Length { get; } - - /// - /// Deletes the text marker. - /// - void Delete(); - - /// - /// Gets whether the text marker was deleted. - /// - bool IsDeleted { get; } - - /// - /// Event that occurs when the text marker is deleted. - /// - event EventHandler Deleted; - - /// - /// Gets/Sets the background color. - /// - Color? BackgroundColor { get; set; } - - /// - /// Gets/Sets the foreground color. - /// - Color? ForegroundColor { get; set; } - - /// - /// Gets/Sets the font weight. - /// - FontWeight? FontWeight { get; set; } - - /// - /// Gets/Sets the font style. - /// - FontStyle? FontStyle { get; set; } - - /// - /// Gets/Sets the type of the marker. Use TextMarkerType.None for normal markers. - /// - TextMarkerTypes MarkerTypes { get; set; } - - /// - /// Gets/Sets the color of the marker. - /// - Color MarkerColor { get; set; } - - /// - /// Gets/Sets an object with additional data for this text marker. - /// - object Tag { get; set; } - - /// - /// Gets/Sets an object that will be displayed as tooltip in the text editor. - /// - object ToolTip { get; set; } - } - - [Flags] - public enum TextMarkerTypes - { - /// - /// Use no marker - /// - None = 0x0000, - /// - /// Use squiggly underline marker - /// - SquigglyUnderline = 0x001, - /// - /// Normal underline. - /// - NormalUnderline = 0x002, - /// - /// Dotted underline. - /// - DottedUnderline = 0x004, - - /// - /// Horizontal line in the scroll bar. - /// - LineInScrollBar = 0x0100, - /// - /// Small triangle in the scroll bar, pointing to the right. - /// - ScrollBarRightTriangle = 0x0400, - /// - /// Small triangle in the scroll bar, pointing to the left. - /// - ScrollBarLeftTriangle = 0x0800, - /// - /// Small circle in the scroll bar. - /// - CircleInScrollBar = 0x1000 - } - - public interface ITextMarkerService - { - /// - /// Creates a new text marker. The text marker will be invisible at first, - /// you need to set one of the Color properties to make it visible. - /// - ITextMarker Create(int startOffset, int length); - - /// - /// Gets the list of text markers. - /// - IEnumerable TextMarkers { get; } - - /// - /// Removes the specified text marker. - /// - void Remove(ITextMarker marker); - - /// - /// Removes all text markers that match the condition. - /// - void RemoveAll(Predicate predicate); - - /// - /// Finds all text markers at the specified offset. - /// - IEnumerable GetMarkersAtOffset(int offset); - } -} diff --git a/ILSpy/AvalonEdit/TextMarkerService.cs b/ILSpy/AvalonEdit/TextMarkerService.cs deleted file mode 100644 index bffac5f54..000000000 --- a/ILSpy/AvalonEdit/TextMarkerService.cs +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows; -using System.Windows.Media; -using System.Windows.Threading; - -using ICSharpCode.AvalonEdit.Document; -using ICSharpCode.AvalonEdit.Rendering; - -namespace ICSharpCode.ILSpy.AvalonEdit -{ - using TextView = ICSharpCode.AvalonEdit.Rendering.TextView; - /// - /// Handles the text markers for a code editor. - /// - sealed class TextMarkerService : DocumentColorizingTransformer, IBackgroundRenderer, ITextMarkerService - { - TextSegmentCollection markers; - TextView textView; - - public TextMarkerService(TextView textView) - { - if (textView == null) - throw new ArgumentNullException(nameof(textView)); - this.textView = textView; - textView.DocumentChanged += OnDocumentChanged; - OnDocumentChanged(null, null); - } - - void OnDocumentChanged(object sender, EventArgs e) - { - if (textView.Document != null) - markers = new TextSegmentCollection(textView.Document); - else - markers = null; - } - - #region ITextMarkerService - public ITextMarker Create(int startOffset, int length) - { - if (markers == null) - throw new InvalidOperationException("Cannot create a marker when not attached to a document"); - - int textLength = textView.Document.TextLength; - if (startOffset < 0 || startOffset > textLength) - throw new ArgumentOutOfRangeException(nameof(startOffset), startOffset, "Value must be between 0 and " + textLength); - if (length < 0 || startOffset + length > textLength) - throw new ArgumentOutOfRangeException(nameof(length), length, "length must not be negative and startOffset+length must not be after the end of the document"); - - TextMarker m = new TextMarker(this, startOffset, length); - markers.Add(m); - // no need to mark segment for redraw: the text marker is invisible until a property is set - return m; - } - - public IEnumerable GetMarkersAtOffset(int offset) - { - if (markers == null) - return Enumerable.Empty(); - else - return markers.FindSegmentsContaining(offset); - } - - public IEnumerable TextMarkers { - get { return markers ?? Enumerable.Empty(); } - } - - public void RemoveAll(Predicate predicate) - { - if (predicate == null) - throw new ArgumentNullException(nameof(predicate)); - if (markers != null) - { - foreach (TextMarker m in markers.ToArray()) - { - if (predicate(m)) - Remove(m); - } - } - } - - public void Remove(ITextMarker marker) - { - if (marker == null) - throw new ArgumentNullException(nameof(marker)); - TextMarker m = marker as TextMarker; - if (markers != null && markers.Remove(m)) - { - Redraw(m); - m.OnDeleted(); - } - } - - /// - /// Redraws the specified text segment. - /// - internal void Redraw(ISegment segment) - { - textView.Redraw(segment, DispatcherPriority.Normal); - RedrawRequested?.Invoke(this, EventArgs.Empty); - } - - public event EventHandler RedrawRequested; - #endregion - - #region DocumentColorizingTransformer - protected override void ColorizeLine(DocumentLine line) - { - if (markers == null) - return; - int lineStart = line.Offset; - int lineEnd = lineStart + line.Length; - foreach (TextMarker marker in markers.FindOverlappingSegments(lineStart, line.Length)) - { - Brush foregroundBrush = null; - if (marker.ForegroundColor != null) - { - foregroundBrush = new SolidColorBrush(marker.ForegroundColor.Value); - foregroundBrush.Freeze(); - } - ChangeLinePart( - Math.Max(marker.StartOffset, lineStart), - Math.Min(marker.EndOffset, lineEnd), - element => { - if (foregroundBrush != null) - { - element.TextRunProperties.SetForegroundBrush(foregroundBrush); - } - Typeface tf = element.TextRunProperties.Typeface; - element.TextRunProperties.SetTypeface(new Typeface( - tf.FontFamily, - marker.FontStyle ?? tf.Style, - marker.FontWeight ?? tf.Weight, - tf.Stretch - )); - } - ); - } - } - #endregion - - #region IBackgroundRenderer - public KnownLayer Layer { - get { - // draw behind selection - return KnownLayer.Selection; - } - } - - public void Draw(ICSharpCode.AvalonEdit.Rendering.TextView textView, DrawingContext drawingContext) - { - if (textView == null) - throw new ArgumentNullException(nameof(textView)); - if (drawingContext == null) - throw new ArgumentNullException(nameof(drawingContext)); - if (markers == null || !textView.VisualLinesValid) - return; - var visualLines = textView.VisualLines; - if (visualLines.Count == 0) - return; - int viewStart = visualLines.First().FirstDocumentLine.Offset; - int viewEnd = visualLines.Last().LastDocumentLine.EndOffset; - foreach (TextMarker marker in markers.FindOverlappingSegments(viewStart, viewEnd - viewStart)) - { - if (marker.BackgroundColor != null) - { - BackgroundGeometryBuilder geoBuilder = new BackgroundGeometryBuilder(); - geoBuilder.AlignToWholePixels = true; - geoBuilder.CornerRadius = 3; - geoBuilder.AddSegment(textView, marker); - Geometry geometry = geoBuilder.CreateGeometry(); - if (geometry != null) - { - Color color = marker.BackgroundColor.Value; - SolidColorBrush brush = new SolidColorBrush(color); - brush.Freeze(); - drawingContext.DrawGeometry(brush, null, geometry); - } - } - var underlineMarkerTypes = TextMarkerTypes.SquigglyUnderline | TextMarkerTypes.NormalUnderline | TextMarkerTypes.DottedUnderline; - if ((marker.MarkerTypes & underlineMarkerTypes) != 0) - { - foreach (Rect r in BackgroundGeometryBuilder.GetRectsForSegment(textView, marker)) - { - Point startPoint = r.BottomLeft; - Point endPoint = r.BottomRight; - - Brush usedBrush = new SolidColorBrush(marker.MarkerColor); - usedBrush.Freeze(); - if ((marker.MarkerTypes & TextMarkerTypes.SquigglyUnderline) != 0) - { - double offset = 2.5; - - int count = Math.Max((int)((endPoint.X - startPoint.X) / offset) + 1, 4); - - StreamGeometry geometry = new StreamGeometry(); - - using (StreamGeometryContext ctx = geometry.Open()) - { - ctx.BeginFigure(startPoint, false, false); - ctx.PolyLineTo(CreatePoints(startPoint, endPoint, offset, count).ToArray(), true, false); - } - - geometry.Freeze(); - - Pen usedPen = new Pen(usedBrush, 1); - usedPen.Freeze(); - drawingContext.DrawGeometry(Brushes.Transparent, usedPen, geometry); - } - if ((marker.MarkerTypes & TextMarkerTypes.NormalUnderline) != 0) - { - Pen usedPen = new Pen(usedBrush, 1); - usedPen.Freeze(); - drawingContext.DrawLine(usedPen, startPoint, endPoint); - } - if ((marker.MarkerTypes & TextMarkerTypes.DottedUnderline) != 0) - { - Pen usedPen = new Pen(usedBrush, 1); - usedPen.DashStyle = DashStyles.Dot; - usedPen.Freeze(); - drawingContext.DrawLine(usedPen, startPoint, endPoint); - } - } - } - } - } - - IEnumerable CreatePoints(Point start, Point end, double offset, int count) - { - for (int i = 0; i < count; i++) - yield return new Point(start.X + i * offset, start.Y - ((i + 1) % 2 == 0 ? offset : 0)); - } - #endregion - } - - sealed class TextMarker : TextSegment, ITextMarker - { - readonly TextMarkerService service; - - public TextMarker(TextMarkerService service, int startOffset, int length) - { - if (service == null) - throw new ArgumentNullException(nameof(service)); - this.service = service; - this.StartOffset = startOffset; - this.Length = length; - this.markerTypes = TextMarkerTypes.None; - } - - public event EventHandler Deleted; - - public bool IsDeleted { - get { return !this.IsConnectedToCollection; } - } - - public void Delete() - { - service.Remove(this); - } - - internal void OnDeleted() - { - Deleted?.Invoke(this, EventArgs.Empty); - } - - void Redraw() - { - service.Redraw(this); - } - - Color? backgroundColor; - - public Color? BackgroundColor { - get { return backgroundColor; } - set { - if (backgroundColor != value) - { - backgroundColor = value; - Redraw(); - } - } - } - - Color? foregroundColor; - - public Color? ForegroundColor { - get { return foregroundColor; } - set { - if (foregroundColor != value) - { - foregroundColor = value; - Redraw(); - } - } - } - - FontWeight? fontWeight; - - public FontWeight? FontWeight { - get { return fontWeight; } - set { - if (fontWeight != value) - { - fontWeight = value; - Redraw(); - } - } - } - - FontStyle? fontStyle; - - public FontStyle? FontStyle { - get { return fontStyle; } - set { - if (fontStyle != value) - { - fontStyle = value; - Redraw(); - } - } - } - - public object Tag { get; set; } - - TextMarkerTypes markerTypes; - - public TextMarkerTypes MarkerTypes { - get { return markerTypes; } - set { - if (markerTypes != value) - { - markerTypes = value; - Redraw(); - } - } - } - - Color markerColor; - - public Color MarkerColor { - get { return markerColor; } - set { - if (markerColor != value) - { - markerColor = value; - Redraw(); - } - } - } - - public object ToolTip { get; set; } - } -} diff --git a/ILSpy/Commands/BrowseBackCommand.cs b/ILSpy/Commands/BrowseBackCommand.cs deleted file mode 100644 index 2db604b65..000000000 --- a/ILSpy/Commands/BrowseBackCommand.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections; -using System.Composition; -using System.Linq; -using System.Windows.Input; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportToolbarCommand(ToolTip = nameof(Resources.Back), ToolbarIcon = "Images/Back", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 0)] - [Shared] - sealed class BrowseBackCommand : CommandWrapper, IProvideParameterList - { - readonly AssemblyTreeModel assemblyTreeModel; - - public BrowseBackCommand(AssemblyTreeModel assemblyTreeModel) - : base(NavigationCommands.BrowseBack) - { - this.assemblyTreeModel = assemblyTreeModel; - } - - protected override void OnCanExecute(object sender, CanExecuteRoutedEventArgs e) - { - base.OnCanExecute(sender, e); - - e.Handled = true; - e.CanExecute = assemblyTreeModel.CanNavigateBack; - } - - protected override void OnExecute(object sender, ExecutedRoutedEventArgs e) - { - if (assemblyTreeModel.CanNavigateBack) - { - e.Handled = true; - assemblyTreeModel.NavigateHistory(false, e.Parameter as NavigationState); - } - } - - public IEnumerable ParameterList => assemblyTreeModel.GetNavigateHistory(false).Reverse(); - - public object GetParameterText(object parameter) - { - return (parameter as NavigationState)?.NavigationText; - } - } -} diff --git a/ILSpy/Commands/BrowseForwardCommand.cs b/ILSpy/Commands/BrowseForwardCommand.cs deleted file mode 100644 index 022c74936..000000000 --- a/ILSpy/Commands/BrowseForwardCommand.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections; -using System.Composition; -using System.Linq; -using System.Windows.Input; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportToolbarCommand(ToolTip = nameof(Resources.Forward), ToolbarIcon = "Images/Forward", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 1)] - [Shared] - sealed class BrowseForwardCommand : CommandWrapper, IProvideParameterList - { - private readonly AssemblyTreeModel assemblyTreeModel; - - public BrowseForwardCommand(AssemblyTreeModel assemblyTreeModel) - : base(NavigationCommands.BrowseForward) - { - this.assemblyTreeModel = assemblyTreeModel; - } - - protected override void OnCanExecute(object sender, CanExecuteRoutedEventArgs e) - { - base.OnCanExecute(sender, e); - - e.Handled = true; - e.CanExecute = assemblyTreeModel.CanNavigateForward; - } - - protected override void OnExecute(object sender, ExecutedRoutedEventArgs e) - { - if (assemblyTreeModel.CanNavigateForward) - { - e.Handled = true; - assemblyTreeModel.NavigateHistory(true, e.Parameter as NavigationState); - } - } - - public IEnumerable ParameterList => assemblyTreeModel.GetNavigateHistory(true).Reverse(); - - public object GetParameterText(object parameter) - { - return (parameter as NavigationState)?.NavigationText; - } - } -} diff --git a/ILSpy/Commands/CheckForUpdatesCommand.cs b/ILSpy/Commands/CheckForUpdatesCommand.cs deleted file mode 100644 index ed5744106..000000000 --- a/ILSpy/Commands/CheckForUpdatesCommand.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; - -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._Help), Header = nameof(Resources._CheckUpdates), MenuOrder = 5000)] - [Shared] - sealed class CheckForUpdatesCommand : SimpleCommand - { - public override void Execute(object parameter) - { - MessageBus.Send(this, new CheckIfUpdateAvailableEventArgs(notify: true)); - } - } -} diff --git a/ILSpy/Commands/CommandWrapper.cs b/ILSpy/Commands/CommandWrapper.cs deleted file mode 100644 index 809184391..000000000 --- a/ILSpy/Commands/CommandWrapper.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows; -using System.Windows.Input; - -namespace ICSharpCode.ILSpy -{ - abstract class CommandWrapper : ICommand - { - private readonly ICommand wrappedCommand; - - protected CommandWrapper(ICommand wrappedCommand) - { - this.wrappedCommand = wrappedCommand; - - Application.Current.MainWindow?.CommandBindings.Add(new CommandBinding(wrappedCommand, OnExecute, OnCanExecute)); - } - - public static ICommand Unwrap(ICommand command) - { - if (command is CommandWrapper w) - return w.wrappedCommand; - - return command; - } - - public event EventHandler CanExecuteChanged { - add { wrappedCommand.CanExecuteChanged += value; } - remove { wrappedCommand.CanExecuteChanged -= value; } - } - - public void Execute(object parameter) - { - wrappedCommand.Execute(parameter); - } - - public bool CanExecute(object parameter) - { - return wrappedCommand.CanExecute(parameter); - } - - protected abstract void OnExecute(object sender, ExecutedRoutedEventArgs e); - - protected virtual void OnCanExecute(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = true; - } - } -} diff --git a/ILSpy/Commands/CompareContextMenuEntry.cs b/ILSpy/Commands/CompareContextMenuEntry.cs deleted file mode 100644 index 0d5e10630..000000000 --- a/ILSpy/Commands/CompareContextMenuEntry.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2025 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Threading.Tasks; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpy.Views; - -namespace ICSharpCode.ILSpy -{ - [ExportContextMenuEntry(Header = "Compare...", Order = 9999)] - [Shared] - internal sealed class CompareContextMenuEntry(AssemblyTreeModel assemblyTreeModel, DockWorkspace dockWorkspace) : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - var left = ((AssemblyTreeNode)context.SelectedTreeNodes[0]).LoadedAssembly; - var right = ((AssemblyTreeNode)context.SelectedTreeNodes[1]).LoadedAssembly; - - var tabPage = dockWorkspace.AddTabPage(); - CompareViewModel.Show(tabPage, left, right, assemblyTreeModel); - } - - public bool IsEnabled(TextViewContext context) - { - return true; - } - - public bool IsVisible(TextViewContext context) - { - return context.SelectedTreeNodes is [AssemblyTreeNode { LoadedAssembly.IsLoadedAsValidAssembly: true }, AssemblyTreeNode { LoadedAssembly.IsLoadedAsValidAssembly: true }]; - } - } -} \ No newline at end of file diff --git a/ILSpy/Commands/CopyFullyQualifiedNameContextMenuEntry.cs b/ILSpy/Commands/CopyFullyQualifiedNameContextMenuEntry.cs deleted file mode 100644 index 682d2cd75..000000000 --- a/ILSpy/Commands/CopyFullyQualifiedNameContextMenuEntry.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -using System.Composition; -using System.Windows; - -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy -{ - [ExportContextMenuEntry(Header = nameof(Resources.CopyName), Icon = "images/Copy", Order = 9999)] - [Shared] - public class CopyFullyQualifiedNameContextMenuEntry : IContextMenuEntry - { - public bool IsVisible(TextViewContext context) - { - return GetMemberNodeFromContext(context) != null; - } - - public bool IsEnabled(TextViewContext context) => true; - - public void Execute(TextViewContext context) - { - var member = GetMemberNodeFromContext(context)?.Member; - if (member == null) - return; - Clipboard.SetText(member.ReflectionName); - } - - private IMemberTreeNode GetMemberNodeFromContext(TextViewContext context) - { - return context.SelectedTreeNodes?.Length == 1 ? context.SelectedTreeNodes[0] as IMemberTreeNode : null; - } - } -} \ No newline at end of file diff --git a/ILSpy/Commands/CreateDiagramContextMenuEntry.cs b/ILSpy/Commands/CreateDiagramContextMenuEntry.cs deleted file mode 100644 index 1e2240a0e..000000000 --- a/ILSpy/Commands/CreateDiagramContextMenuEntry.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2024 Christoph Wille for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Composition; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -using ICSharpCode.Decompiler; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX.MermaidDiagrammer; - -using Microsoft.Win32; - -namespace ICSharpCode.ILSpy.TextView -{ - [ExportContextMenuEntry(Header = nameof(Resources._CreateDiagram), Category = nameof(Resources.Save), Icon = "Images/Save")] - [Shared] - sealed class CreateDiagramContextMenuEntry(DockWorkspace dockWorkspace) : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - var assembly = (context.SelectedTreeNodes?.FirstOrDefault() as AssemblyTreeNode)?.LoadedAssembly; - if (assembly == null) - return; - - var selectedPath = SelectDestinationFolder(); - if (string.IsNullOrEmpty(selectedPath)) - return; - - dockWorkspace.RunWithCancellation(ct => Task.Factory.StartNew(() => { - AvalonEditTextOutput output = new() { - EnableHyperlinks = true - }; - Stopwatch stopwatch = Stopwatch.StartNew(); - try - { - var command = new GenerateHtmlDiagrammer { - Assembly = assembly.FileName, - OutputFolder = selectedPath - }; - - command.Run(); - } - catch (OperationCanceledException) - { - output.WriteLine(); - output.WriteLine(Resources.GenerationWasCancelled); - throw; - } - stopwatch.Stop(); - output.WriteLine(Resources.GenerationCompleteInSeconds, stopwatch.Elapsed.TotalSeconds.ToString("F1")); - output.WriteLine(); - output.WriteLine("Learn more: " + "https://github.com/icsharpcode/ILSpy/wiki/Diagramming#tips-for-using-the-html-diagrammer"); - output.WriteLine(); - - var diagramHtml = Path.Combine(selectedPath, "index.html"); - output.AddButton(null, Resources.OpenExplorer, delegate { ShellHelper.OpenFolderAndSelectItem(diagramHtml); }); - output.WriteLine(); - return output; - }, ct), Properties.Resources.CreatingDiagram).Then(dockWorkspace.ShowText).HandleExceptions(); - - return; - } - - public bool IsEnabled(TextViewContext context) => true; - - public bool IsVisible(TextViewContext context) - { - return context.SelectedTreeNodes?.Length == 1 - && context.SelectedTreeNodes?.FirstOrDefault() is AssemblyTreeNode tn - && tn.LoadedAssembly.IsLoadedAsValidAssembly; - } - - static string SelectDestinationFolder() - { - OpenFolderDialog dialog = new(); - dialog.Multiselect = false; - dialog.Title = "Select target folder"; - - if (dialog.ShowDialog() != true) - { - return null; - } - - string selectedPath = Path.GetDirectoryName(dialog.FolderName); - bool directoryNotEmpty; - try - { - directoryNotEmpty = Directory.EnumerateFileSystemEntries(selectedPath).Any(); - } - catch (Exception e) when (e is IOException || e is UnauthorizedAccessException || e is System.Security.SecurityException) - { - MessageBox.Show( - "The directory cannot be accessed. Please ensure it exists and you have sufficient rights to access it.", - "Target directory not accessible", - MessageBoxButton.OK, MessageBoxImage.Error); - return null; - } - - return dialog.FolderName; - } - } -} diff --git a/ILSpy/Commands/DecompileAllCommand.cs b/ILSpy/Commands/DecompileAllCommand.cs deleted file mode 100644 index 7a9bebf18..000000000 --- a/ILSpy/Commands/DecompileAllCommand.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#if DEBUG - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Composition; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; - -using ICSharpCode.Decompiler; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDecompile), MenuCategory = nameof(Resources.Open), MenuOrder = 2.5)] - [Shared] - sealed class DecompileAllCommand(AssemblyTreeModel assemblyTreeModel, DockWorkspace dockWorkspace) : SimpleCommand - { - public override bool CanExecute(object parameter) - { - return System.IO.Directory.Exists("c:\\temp\\decompiled"); - } - - public override void Execute(object parameter) - { - dockWorkspace.RunWithCancellation(ct => Task.Factory.StartNew(() => { - AvalonEditTextOutput output = new AvalonEditTextOutput(); - Parallel.ForEach( - Partitioner.Create(assemblyTreeModel.AssemblyList.GetAssemblies(), loadBalance: true), - new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount, CancellationToken = ct }, - delegate (LoadedAssembly asm) { - if (!asm.HasLoadError) - { - Stopwatch w = Stopwatch.StartNew(); - Exception exception = null; - using (var writer = new System.IO.StreamWriter("c:\\temp\\decompiled\\" + asm.ShortName + ".cs")) - { - try - { - var options = dockWorkspace.ActiveTabPage.CreateDecompilationOptions(); - options.CancellationToken = ct; - options.FullDecompilation = true; - new CSharpLanguage().DecompileAssembly(asm, new PlainTextOutput(writer), options); - } - catch (Exception ex) - { - writer.WriteLine(ex.ToString()); - exception = ex; - } - } - lock (output) - { - output.Write(asm.ShortName + " - " + w.Elapsed); - if (exception != null) - { - output.Write(" - "); - output.Write(exception.GetType().Name); - } - output.WriteLine(); - } - } - }); - return output; - }, ct)).Then(dockWorkspace.ShowText).HandleExceptions(); - } - } - - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDecompile100x), MenuCategory = nameof(Resources.Open), MenuOrder = 2.6)] - [Shared] - sealed class Decompile100TimesCommand(AssemblyTreeModel assemblyTreeModel, LanguageService languageService, DockWorkspace dockWorkspace) : SimpleCommand - { - public override void Execute(object parameter) - { - const int numRuns = 100; - var language = languageService.Language; - var nodes = assemblyTreeModel.SelectedNodes.ToArray(); - var options = dockWorkspace.ActiveTabPage.CreateDecompilationOptions(); - dockWorkspace.RunWithCancellation(ct => Task.Factory.StartNew(() => { - options.CancellationToken = ct; - Stopwatch w = Stopwatch.StartNew(); - for (int i = 0; i < numRuns; ++i) - { - foreach (var node in nodes) - { - node.Decompile(language, new PlainTextOutput(), options); - } - } - w.Stop(); - AvalonEditTextOutput output = new AvalonEditTextOutput(); - double msPerRun = w.Elapsed.TotalMilliseconds / numRuns; - output.Write($"Average time: {msPerRun.ToString("f1")}ms\n"); - return output; - }, ct)).Then(output => dockWorkspace.ShowText(output)).HandleExceptions(); - } - } -} - -#endif \ No newline at end of file diff --git a/ILSpy/Commands/DecompileCommand.cs b/ILSpy/Commands/DecompileCommand.cs deleted file mode 100644 index 6a909569e..000000000 --- a/ILSpy/Commands/DecompileCommand.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Linq; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Commands -{ - [ExportContextMenuEntry(Header = nameof(Resources.Decompile), Order = 10)] - [Shared] - class DecompileCommand : IContextMenuEntry - { - public bool IsVisible(TextViewContext context) - { - if (context.SelectedTreeNodes == null) - return context.Reference?.Reference is IEntity; - return context.SelectedTreeNodes.Length == 1 && context.SelectedTreeNodes.All(n => n is IMemberTreeNode); - } - - public bool IsEnabled(TextViewContext context) - { - if (context.SelectedTreeNodes == null) - return context.Reference?.Reference is IEntity; - foreach (IMemberTreeNode node in context.SelectedTreeNodes) - { - if (!IsValidReference(node.Member)) - return false; - } - - return true; - } - - bool IsValidReference(object reference) - { - return reference is IEntity; - } - - public void Execute(TextViewContext context) - { - IEntity selection = null; - if (context.SelectedTreeNodes?[0] is IMemberTreeNode node) - { - selection = node.Member; - } - else if (context.Reference?.Reference is IEntity entity) - { - selection = entity; - } - if (selection != null) - MessageBus.Send(this, new NavigateToReferenceEventArgs(selection)); - } - } -} diff --git a/ILSpy/Commands/DecompileInNewViewCommand.cs b/ILSpy/Commands/DecompileInNewViewCommand.cs deleted file mode 100644 index c6728be7e..000000000 --- a/ILSpy/Commands/DecompileInNewViewCommand.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Linq; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; - -using TomsToolbox.Essentials; - -namespace ICSharpCode.ILSpy.Commands -{ - [ExportContextMenuEntry(Header = nameof(Resources.DecompileToNewPanel), InputGestureText = "MMB", Icon = "images/Search", Category = nameof(Resources.Analyze), Order = 90)] - [Shared] - internal sealed class DecompileInNewViewCommand(AssemblyTreeModel assemblyTreeModel, DockWorkspace dockWorkspace) : IContextMenuEntry - { - public bool IsVisible(TextViewContext context) - { - return context.SelectedTreeNodes != null || context.Reference?.Reference is IEntity; - } - - public bool IsEnabled(TextViewContext context) - { - return GetNodes(context).Any(); - } - - public void Execute(TextViewContext context) - { - DecompileNodes(GetNodes(context).ToArray()); - } - - IEnumerable GetNodes(TextViewContext context) - { - if (context.SelectedTreeNodes != null) - { - if (context.TreeView.DataContext != assemblyTreeModel) - { - return context.SelectedTreeNodes.OfType().Select(FindTreeNode).ExceptNullItems(); - } - else - { - return context.SelectedTreeNodes.OfType(); - } - } - else if (context.Reference?.Reference is IEntity entity) - { - if (assemblyTreeModel.FindTreeNode(entity) is { } node) - { - return new[] { node }; - } - } - return Array.Empty(); - - ILSpyTreeNode FindTreeNode(IMemberTreeNode node) - { - if (node is ILSpyTreeNode ilspyNode) - return ilspyNode; - return assemblyTreeModel.FindTreeNode(node.Member); - } - } - - void DecompileNodes(ILSpyTreeNode[] nodes) - { - if (nodes.Length == 0) - return; - - dockWorkspace.ActiveTabPage = dockWorkspace.AddTabPage(); - - if (assemblyTreeModel.SelectedItems.SequenceEqual(nodes)) - assemblyTreeModel.DecompileSelectedNodes(); - else - assemblyTreeModel.SelectNodes(nodes); - } - } -} diff --git a/ILSpy/Commands/DelegateCommand.cs b/ILSpy/Commands/DelegateCommand.cs deleted file mode 100644 index 2c351730b..000000000 --- a/ILSpy/Commands/DelegateCommand.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; - -namespace ICSharpCode.ILSpy.Commands -{ - public class DelegateCommand : ICommand - { - private readonly Action action; - private readonly Func canExecute; - - public event EventHandler CanExecuteChanged { - add { CommandManager.RequerySuggested += value; } - remove { CommandManager.RequerySuggested -= value; } - } - - public DelegateCommand(Action action) - : this(action, () => true) - { - } - - public DelegateCommand(Action action, Func canExecute) - { - this.action = action; - this.canExecute = canExecute; - } - - public bool CanExecute(object parameter) - { - return canExecute(); - } - - public void Execute(object parameter) - { - action(); - } - } - - public class DelegateCommand : ICommand - { - private readonly Action action; - private readonly Func canExecute; - - public event EventHandler CanExecuteChanged { - add { CommandManager.RequerySuggested += value; } - remove { CommandManager.RequerySuggested -= value; } - } - - public DelegateCommand(Action action) - : this(action, _ => true) - { - } - - public DelegateCommand(Action action, Func canExecute) - { - this.action = action; - this.canExecute = canExecute; - } - - public bool CanExecute(object parameter) - { - return canExecute((T)parameter); - } - - public void Execute(object parameter) - { - action((T)parameter); - } - } -} diff --git a/ILSpy/Commands/DisassembleAllCommand.cs b/ILSpy/Commands/DisassembleAllCommand.cs deleted file mode 100644 index a43d00520..000000000 --- a/ILSpy/Commands/DisassembleAllCommand.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#if DEBUG - -using System; -using System.Collections.Concurrent; -using System.Composition; -using System.Diagnostics; -using System.Threading.Tasks; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDisassemble), MenuCategory = nameof(Resources.Open), MenuOrder = 2.5)] - [Shared] - sealed class DisassembleAllCommand(AssemblyTreeModel assemblyTreeModel, DockWorkspace dockWorkspace) : SimpleCommand - { - public override bool CanExecute(object parameter) - { - return System.IO.Directory.Exists("c:\\temp\\disassembled"); - } - - public override void Execute(object parameter) - { - dockWorkspace.RunWithCancellation(ct => Task.Factory.StartNew(() => { - AvalonEditTextOutput output = new(); - Parallel.ForEach( - Partitioner.Create(assemblyTreeModel.AssemblyList.GetAssemblies(), loadBalance: true), - new() { MaxDegreeOfParallelism = Environment.ProcessorCount, CancellationToken = ct }, - asm => { - if (!asm.HasLoadError) - { - Stopwatch w = Stopwatch.StartNew(); - Exception exception = null; - using (var writer = new System.IO.StreamWriter("c:\\temp\\disassembled\\" + asm.Text.Replace("(", "").Replace(")", "").Replace(' ', '_') + ".il")) - { - try - { - var options = dockWorkspace.ActiveTabPage.CreateDecompilationOptions(); - options.FullDecompilation = true; - options.CancellationToken = ct; - new ILLanguage(dockWorkspace).DecompileAssembly(asm, new Decompiler.PlainTextOutput(writer), options); - } - catch (Exception ex) - { - writer.WriteLine(ex.ToString()); - exception = ex; - } - } - lock (output) - { - output.Write(asm.ShortName + " - " + w.Elapsed); - if (exception != null) - { - output.Write(" - "); - output.Write(exception.GetType().Name); - } - output.WriteLine(); - } - } - }); - return output; - }, ct)).Then(dockWorkspace.ShowText).HandleExceptions(); - } - } -} - -#endif \ No newline at end of file diff --git a/ILSpy/Commands/ExitCommand.cs b/ILSpy/Commands/ExitCommand.cs deleted file mode 100644 index b676c7ef9..000000000 --- a/ILSpy/Commands/ExitCommand.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -using System.Composition; - -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.E_xit), MenuOrder = 99999, MenuCategory = nameof(Resources.Exit))] - [Shared] - sealed class ExitCommand(MainWindow mainWindow) : SimpleCommand - { - public override void Execute(object parameter) - { - mainWindow.Close(); - } - } -} \ No newline at end of file diff --git a/ILSpy/Commands/ExportCommandAttribute.cs b/ILSpy/Commands/ExportCommandAttribute.cs deleted file mode 100644 index 7b9709ff3..000000000 --- a/ILSpy/Commands/ExportCommandAttribute.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Composition; -using System.Windows.Input; - -namespace ICSharpCode.ILSpy -{ - #region Toolbar - public interface IToolbarCommandMetadata - { - string ToolbarIcon { get; } - string ToolTip { get; } - string ToolbarCategory { get; } - object Tag { get; } - double ToolbarOrder { get; } - } - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class ExportToolbarCommandAttribute : ExportAttribute, IToolbarCommandMetadata - { - public ExportToolbarCommandAttribute() - : base("ToolbarCommand", typeof(ICommand)) - { - } - - public string ToolTip { get; set; } - public string ToolbarIcon { get; set; } - public string ToolbarCategory { get; set; } - public double ToolbarOrder { get; set; } - public object Tag { get; set; } - } - #endregion - - #region Main Menu - public interface IMainMenuCommandMetadata - { - string MenuID { get; } - string MenuIcon { get; } - string Header { get; } - string ParentMenuID { get; } - string MenuCategory { get; } - string InputGestureText { get; } - bool IsEnabled { get; } - double MenuOrder { get; } - } - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class ExportMainMenuCommandAttribute : ExportAttribute, IMainMenuCommandMetadata - { - public ExportMainMenuCommandAttribute() - : base("MainMenuCommand", typeof(ICommand)) - { - } - /// - /// Gets/Sets the ID of this menu item. Menu entries are not required to have an ID, - /// however, setting it allows to declare nested menu structures. - /// The built-in menus have the IDs "_File", "_View", "_Window" and "_Help". - /// Plugin authors are advised to use GUIDs as identifiers to prevent conflicts. - /// - /// NOTE: Defining cycles (for example by accidentally setting equal to ) - /// will lead to a stack-overflow and crash of ILSpy at startup. - /// - public string MenuID { get; set; } - public string MenuIcon { get; set; } - public string Header { get; set; } - /// - /// Gets/Sets the parent of this menu item. All menu items sharing the same parent will be displayed as sub-menu items. - /// If this property is set to , the menu item is displayed in the top-level menu. - /// The built-in menus have the IDs "_File", "_View", "_Window" and "_Help". - /// - /// NOTE: Defining cycles (for example by accidentally setting equal to ) - /// will lead to a stack-overflow and crash of ILSpy at startup. - /// - public string ParentMenuID { get; set; } - public string MenuCategory { get; set; } - public string InputGestureText { get; set; } - public bool IsEnabled { get; set; } = true; - public double MenuOrder { get; set; } - } - #endregion - - #region Tool Panes - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class)] - public class ExportToolPaneAttribute : ExportAttribute - { - public ExportToolPaneAttribute() - : base("ToolPane", typeof(ViewModels.ToolPaneModel)) - { - } - } - #endregion -} diff --git a/ILSpy/Commands/ExtractPackageEntryContextMenuEntry.cs b/ILSpy/Commands/ExtractPackageEntryContextMenuEntry.cs deleted file mode 100644 index 85a1be6f2..000000000 --- a/ILSpy/Commands/ExtractPackageEntryContextMenuEntry.cs +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) 2021 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp.ProjectDecompiler; -using ICSharpCode.Decompiler.Util; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.TreeView; - -using Microsoft.Win32; - -using static ICSharpCode.ILSpyX.LoadedPackage; - -namespace ICSharpCode.ILSpy -{ - [ExportContextMenuEntry(Header = nameof(Resources.ExtractPackageEntry), Category = nameof(Resources.Save), Icon = "Images/Save")] - [Shared] - sealed class ExtractPackageEntryContextMenuEntry(DockWorkspace dockWorkspace) : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - var selectedNodes = Array.FindAll(context.SelectedTreeNodes, IsBundleItem); - // Get root assembly to infer the initial directory for the save dialog. - var bundleNode = selectedNodes.FirstOrDefault()?.Ancestors().OfType() - .FirstOrDefault(asm => asm.PackageEntry == null); - if (bundleNode == null) - return; - if (selectedNodes is [AssemblyTreeNode { PackageEntry: { } assembly }]) - { - SaveFileDialog dlg = new SaveFileDialog(); - dlg.FileName = Path.GetFileName(WholeProjectDecompiler.SanitizeFileName(assembly.Name)); - dlg.Filter = ".NET assemblies|*.dll;*.exe;*.winmd" + Resources.AllFiles; - dlg.InitialDirectory = Path.GetDirectoryName(bundleNode.LoadedAssembly.FileName); - if (dlg.ShowDialog() == true) - Save(dockWorkspace, selectedNodes, dlg.FileName, true); - } - else if (selectedNodes is [ResourceTreeNode { Resource: { } resource }]) - { - SaveFileDialog dlg = new SaveFileDialog(); - dlg.FileName = Path.GetFileName(WholeProjectDecompiler.SanitizeFileName(resource.Name)); - dlg.Filter = Resources.AllFiles[1..]; - dlg.InitialDirectory = Path.GetDirectoryName(bundleNode.LoadedAssembly.FileName); - if (dlg.ShowDialog() == true) - Save(dockWorkspace, selectedNodes, dlg.FileName, true); - } - else - { - OpenFolderDialog dlg = new OpenFolderDialog(); - dlg.InitialDirectory = Path.GetDirectoryName(bundleNode.LoadedAssembly.FileName); - if (dlg.ShowDialog() != true) - return; - - string folderName = dlg.FolderName; - if (Directory.EnumerateFileSystemEntries(folderName).Any()) - { - var result = MessageBox.Show( - Resources.AssemblySaveCodeDirectoryNotEmpty, - Resources.AssemblySaveCodeDirectoryNotEmptyTitle, - MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No); - if (result == MessageBoxResult.No) - return; - } - - Save(dockWorkspace, selectedNodes, folderName, false); - } - } - - internal static void Save(DockWorkspace dockWorkspace, ICollection nodes, string path, bool isFile) - { - dockWorkspace.RunWithCancellation(ct => Task.Factory.StartNew(() => { - AvalonEditTextOutput output = new AvalonEditTextOutput(); - Stopwatch stopwatch = Stopwatch.StartNew(); - Dictionary fileNameCounts = new Dictionary(Platform.FileNameComparer); - foreach (var (entry, fileName) in CollectAllFiles(nodes)) - { - string actualFileName = WholeProjectDecompiler.SanitizeFileName(fileName); - while (fileNameCounts.TryGetValue(actualFileName, out int index)) - { - index++; - fileNameCounts[actualFileName] = index; - actualFileName = Path.ChangeExtension(actualFileName, index + Path.GetExtension(actualFileName)); - } - if (!fileNameCounts.ContainsKey(actualFileName)) - { - fileNameCounts[actualFileName] = 1; - } - SaveEntry(output, entry, Path.Combine(path, actualFileName)); - } - stopwatch.Stop(); - output.WriteLine(Resources.GenerationCompleteInSeconds, stopwatch.Elapsed.TotalSeconds.ToString("F1")); - output.WriteLine(); - // If we have written files, open explorer and select them grouped by folder; otherwise fall back to opening containing folder. - if (isFile && File.Exists(path)) - output.AddButton(null, Resources.OpenExplorer, delegate { ShellHelper.OpenFolderAndSelectItem(path); }); - else - output.AddButton(null, Resources.OpenExplorer, delegate { ShellHelper.OpenFolder(path); }); - output.WriteLine(); - return output; - }, ct)).Then(dockWorkspace.ShowText).HandleExceptions(); - - static IEnumerable<(PackageEntry Entry, string TargetFileName)> CollectAllFiles(ICollection nodes) - { - foreach (var node in nodes) - { - if (node is AssemblyTreeNode { PackageEntry: { } assembly }) - { - yield return (assembly, Path.GetFileName(assembly.FullName)); - } - else if (node is ResourceTreeNode { Resource: PackageEntry { } resource }) - { - yield return (resource, Path.GetFileName(resource.FullName)); - } - else if (node is AssemblyTreeNode { PackageKind: not null } asm) - { - var package = asm.LoadedAssembly.GetLoadResultAsync().GetAwaiter().GetResult().Package; - foreach (var entry in package.Entries) - { - yield return (entry, entry.FullName); - } - } - else if (node is PackageFolderTreeNode folder) - { - int prefixLength = 0; - PackageFolder current = folder.Folder; - if (nodes.Count > 1) - current = current.Parent; - while (current != null) - { - prefixLength += current.Name.Length + 1; - current = current.Parent; - } - if (prefixLength > 0) - prefixLength--; - foreach (var item in TreeTraversal.PreOrder(folder.Folder, f => f.Folders).SelectMany(f => f.Entries)) - { - yield return (item, item.FullName.Substring(prefixLength)); - } - } - } - } - } - - static void SaveEntry(ITextOutput output, PackageEntry entry, string targetFileName) - { - output.Write(entry.Name + ": "); - using Stream stream = entry.TryOpenStream(); - if (stream == null) - { - output.WriteLine("Could not open stream!"); - return; - } - - Directory.CreateDirectory(Path.GetDirectoryName(targetFileName)); - - stream.Position = 0; - using FileStream fileStream = new FileStream(targetFileName, FileMode.OpenOrCreate); - stream.CopyTo(fileStream); - output.WriteLine("Written to " + targetFileName); - } - - public bool IsEnabled(TextViewContext context) => true; - - public bool IsVisible(TextViewContext context) => context.SelectedTreeNodes?.Any(IsBundleItem) == true; - - static bool IsBundleItem(SharpTreeNode node) - { - if (node is AssemblyTreeNode { PackageEntry: { } } or PackageFolderTreeNode) - return true; - if (node is ResourceTreeNode { Resource: PackageEntry { } resource } && resource.PackageQualifiedFileName.StartsWith("bundle://")) - return true; - return false; - } - } - - [ExportContextMenuEntry(Header = nameof(Resources.ExtractAllPackageEntries), Category = nameof(Resources.Save), Icon = "Images/Save")] - [Shared] - sealed class ExtractAllPackageEntriesContextMenuEntry(DockWorkspace dockWorkspace) : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - if (context.SelectedTreeNodes is not [AssemblyTreeNode { PackageEntry: null } asm]) - return; - OpenFolderDialog dlg = new OpenFolderDialog(); - dlg.InitialDirectory = Path.GetDirectoryName(asm.LoadedAssembly.FileName); - if (dlg.ShowDialog() != true) - return; - - string folderName = dlg.FolderName; - if (Directory.EnumerateFileSystemEntries(folderName).Any()) - { - var result = MessageBox.Show( - Resources.AssemblySaveCodeDirectoryNotEmpty, - Resources.AssemblySaveCodeDirectoryNotEmptyTitle, - MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No); - if (result == MessageBoxResult.No) - return; - } - - ExtractPackageEntryContextMenuEntry.Save(dockWorkspace, [asm], folderName, false); - } - - public bool IsEnabled(TextViewContext context) => true; - - public bool IsVisible(TextViewContext context) - { - return context.SelectedTreeNodes is [AssemblyTreeNode { PackageEntry: null, PackageKind: PackageKind.Bundle }]; - } - } -} diff --git a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs deleted file mode 100644 index 41b7018d4..000000000 --- a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) 2018 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp; -using ICSharpCode.Decompiler.CSharp.ProjectDecompiler; -using ICSharpCode.Decompiler.DebugInfo; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX; - -using Microsoft.Win32; - -namespace ICSharpCode.ILSpy -{ - [ExportContextMenuEntry(Header = nameof(Resources.GeneratePortable))] - [Shared] - class GeneratePdbContextMenuEntry(LanguageService languageService, DockWorkspace dockWorkspace) : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - var selectedNodes = context.SelectedTreeNodes?.OfType().ToArray(); - if (selectedNodes == null || selectedNodes.Length == 0) - return; - - GeneratePdbForAssemblies(selectedNodes.Select(n => n.LoadedAssembly), languageService, dockWorkspace); - } - - public bool IsEnabled(TextViewContext context) => true; - - public bool IsVisible(TextViewContext context) - { - var selectedNodes = context.SelectedTreeNodes; - return selectedNodes?.Any() == true - && selectedNodes.All(n => n is AssemblyTreeNode asm && asm.LoadedAssembly.IsLoadedAsValidAssembly); - } - - internal static void GeneratePdbForAssemblies(IEnumerable assemblies, LanguageService languageService, DockWorkspace dockWorkspace) - { - var assemblyArray = assemblies?.Where(a => a != null).ToArray() ?? []; - if (assemblyArray == null || assemblyArray.Length == 0) - return; - - // Ensure at least one assembly supports PDB generation - var supported = new Dictionary(); - var unsupported = new List(); - foreach (var a in assemblyArray) - { - try - { - var file = a.GetMetadataFileOrNull() as PEFile; - if (PortablePdbWriter.HasCodeViewDebugDirectoryEntry(file)) - supported.Add(a, file); - else - unsupported.Add(a); - } - catch - { - unsupported.Add(a); - } - } - if (supported.Count == 0) - { - // none can be generated - string msg = string.Format(Resources.CannotCreatePDBFile, ":" + Environment.NewLine + - string.Join(Environment.NewLine, unsupported.Select(u => Path.GetFileName(u.FileName))) - + Environment.NewLine); - MessageBox.Show(msg); - return; - } - - // Ask for target folder - var dlg = new OpenFolderDialog(); - dlg.Title = Resources.SelectPDBOutputFolder; - if (dlg.ShowDialog() != true || string.IsNullOrWhiteSpace(dlg.FolderName)) - return; - - string targetFolder = dlg.FolderName; - DecompilationOptions options = dockWorkspace.ActiveTabPage.CreateDecompilationOptions(); - - dockWorkspace.RunWithCancellation(ct => Task.Factory.StartNew(() => { - AvalonEditTextOutput output = new AvalonEditTextOutput(); - Stopwatch totalWatch = Stopwatch.StartNew(); - options.CancellationToken = ct; - - int total = assemblyArray.Length; - int processed = 0; - foreach (var assembly in assemblyArray) - { - // only process supported assemblies - if (!supported.TryGetValue(assembly, out var file)) - { - output.WriteLine(string.Format(Resources.CannotCreatePDBFile, Path.GetFileName(assembly.FileName))); - processed++; - if (options.Progress != null) - { - options.Progress.Report(new DecompilationProgress { - Title = string.Format(Resources.GeneratingPortablePDB, Path.GetFileName(assembly.FileName)), - TotalUnits = total, - UnitsCompleted = processed - }); - } - continue; - } - - string fileName = Path.Combine(targetFolder, WholeProjectDecompiler.CleanUpFileName(assembly.ShortName, ".pdb")); - - try - { - using (FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write)) - { - var decompiler = new CSharpDecompiler(file, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings); - decompiler.CancellationToken = ct; - PortablePdbWriter.WritePdb(file, decompiler, options.DecompilerSettings, stream, progress: options.Progress, currentProgressTitle: string.Format(Resources.GeneratingPortablePDB, Path.GetFileName(assembly.FileName))); - } - output.WriteLine(string.Format(Resources.GeneratedPDBFile, fileName)); - } - catch (OperationCanceledException) - { - output.WriteLine(); - output.WriteLine(Resources.GenerationWasCancelled); - throw; - } - catch (Exception ex) - { - output.WriteLine(string.Format(Resources.GenerationFailedForAssembly, assembly.FileName, ex.Message)); - } - processed++; - if (options.Progress != null) - { - options.Progress.Report(new DecompilationProgress { - Title = string.Format(Resources.GeneratingPortablePDB, Path.GetFileName(assembly.FileName)), - TotalUnits = total, - UnitsCompleted = processed - }); - } - } - - totalWatch.Stop(); - output.WriteLine(); - output.WriteLine(Resources.GenerationCompleteInSeconds, totalWatch.Elapsed.TotalSeconds.ToString("F1")); - output.WriteLine(); - // Select all generated pdb files in explorer - var generatedFiles = assemblyArray - .Select(a => Path.Combine(targetFolder, WholeProjectDecompiler.CleanUpFileName(a.ShortName, ".pdb"))) - .Where(File.Exists) - .ToList(); - if (generatedFiles.Any()) - { - output.AddButton(null, Resources.OpenExplorer, delegate { ShellHelper.OpenFolderAndSelectItems(generatedFiles); }); - } - else - { - output.AddButton(null, Resources.OpenExplorer, delegate { ShellHelper.OpenFolder(targetFolder); }); - } - output.WriteLine(); - return output; - }, ct)).Then(dockWorkspace.ShowText).HandleExceptions(); - } - } - - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.GeneratePortable), MenuCategory = nameof(Resources.Save))] - [Shared] - class GeneratePdbMainMenuEntry(AssemblyTreeModel assemblyTreeModel, LanguageService languageService, DockWorkspace dockWorkspace) : SimpleCommand - { - public override bool CanExecute(object parameter) - { - return assemblyTreeModel.SelectedNodes?.Any() == true - && assemblyTreeModel.SelectedNodes?.All(n => n is AssemblyTreeNode tn && !tn.LoadedAssembly.HasLoadError) == true; - } - - public override void Execute(object parameter) - { - var selectedNodes = assemblyTreeModel.SelectedNodes?.OfType().ToArray(); - if (selectedNodes == null || selectedNodes.Length == 0) - return; - - GeneratePdbContextMenuEntry.GeneratePdbForAssemblies(selectedNodes.Select(n => n.LoadedAssembly), languageService, dockWorkspace); - } - } -} diff --git a/ILSpy/Commands/IProtocolHandler.cs b/ILSpy/Commands/IProtocolHandler.cs deleted file mode 100644 index b9e675bfc..000000000 --- a/ILSpy/Commands/IProtocolHandler.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2018 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Reflection.Metadata; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy -{ - public interface IProtocolHandler - { - ILSpyTreeNode Resolve(string protocol, MetadataFile module, Handle handle, out bool newTabPage); - } -} diff --git a/ILSpy/Commands/ManageAssemblyListsCommand.cs b/ILSpy/Commands/ManageAssemblyListsCommand.cs deleted file mode 100644 index 8e66c9a9d..000000000 --- a/ILSpy/Commands/ManageAssemblyListsCommand.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Windows; -using System.Windows.Data; - -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.ManageAssembly_Lists), MenuIcon = "Images/AssemblyList", MenuCategory = nameof(Resources.Open), MenuOrder = 1.7)] - [Shared] - sealed class ManageAssemblyListsCommand(SettingsService settingsService) : SimpleCommand, IProvideParameterBinding - { - public override void Execute(object parameter) - { - ManageAssemblyListsDialog dlg = new(settingsService) { - Owner = parameter as Window - }; - - dlg.ShowDialog(); - } - - public Binding ParameterBinding => new() { - RelativeSource = new(RelativeSourceMode.FindAncestor) { - AncestorType = typeof(Window) - } - }; - } -} diff --git a/ILSpy/Commands/OpenCommand.cs b/ILSpy/Commands/OpenCommand.cs deleted file mode 100644 index 2ea160889..000000000 --- a/ILSpy/Commands/OpenCommand.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Windows.Input; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; - -using Microsoft.Win32; - -namespace ICSharpCode.ILSpy -{ - [ExportToolbarCommand(ToolTip = nameof(Resources.Open), ToolbarIcon = "Images/Open", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 0)] - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources._Open), MenuIcon = "Images/Open", MenuCategory = nameof(Resources.Open), MenuOrder = 0)] - [Shared] - sealed class OpenCommand : CommandWrapper - { - private readonly AssemblyTreeModel assemblyTreeModel; - - public OpenCommand(AssemblyTreeModel assemblyTreeModel) - : base(ApplicationCommands.Open) - { - this.assemblyTreeModel = assemblyTreeModel; - } - - protected override void OnExecute(object sender, ExecutedRoutedEventArgs e) - { - e.Handled = true; - OpenFileDialog dlg = new OpenFileDialog { - Filter = ".NET assemblies|*.dll;*.exe;*.winmd;*.wasm|Nuget Packages (*.nupkg)|*.nupkg|Portable Program Database (*.pdb)|*.pdb|All files|*.*", - Multiselect = true, - RestoreDirectory = true - }; - - if (dlg.ShowDialog() == true) - { - assemblyTreeModel.OpenFiles(dlg.FileNames); - } - } - } -} diff --git a/ILSpy/Commands/OpenFromGacCommand.cs b/ILSpy/Commands/OpenFromGacCommand.cs deleted file mode 100644 index b66e1c644..000000000 --- a/ILSpy/Commands/OpenFromGacCommand.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; - -using ICSharpCode.ILSpy.AppEnv; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.OpenFrom_GAC), MenuIcon = "Images/AssemblyListGAC", MenuCategory = nameof(Resources.Open), MenuOrder = 1)] - [Shared] - sealed class OpenFromGacCommand(AssemblyTreeModel assemblyTreeModel, MainWindow mainWindow) : SimpleCommand - { - public override bool CanExecute(object parameter) - { - return AppEnvironment.IsWindows; - } - - public override void Execute(object parameter) - { - OpenFromGacDialog dlg = new() { - Owner = mainWindow - }; - - if (dlg.ShowDialog() == true) - { - assemblyTreeModel.OpenFiles(dlg.SelectedFileNames); - } - } - } -} diff --git a/ILSpy/Commands/Pdb2XmlCommand.cs b/ILSpy/Commands/Pdb2XmlCommand.cs deleted file mode 100644 index fb554c321..000000000 --- a/ILSpy/Commands/Pdb2XmlCommand.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#if DEBUG && WINDOWS - -using System.Collections.Generic; -using System.Composition; -using System.IO; -using System.Linq; -using System.Threading.Tasks; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.Decompiler; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; - -using Microsoft.DiaSymReader.Tools; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDumpPDBAsXML), MenuCategory = nameof(Resources.Open), MenuOrder = 2.6)] - [Shared] - sealed class Pdb2XmlCommand(AssemblyTreeModel assemblyTreeModel, DockWorkspace dockWorkspace) : SimpleCommand - { - public override bool CanExecute(object parameter) - { - var selectedNodes = assemblyTreeModel.SelectedNodes; - return selectedNodes?.Any() == true - && selectedNodes.All(n => n is AssemblyTreeNode asm && !asm.LoadedAssembly.HasLoadError); - } - - public override void Execute(object parameter) - { - Execute(assemblyTreeModel.SelectedNodes.OfType(), dockWorkspace); - } - - internal static void Execute(IEnumerable nodes, DockWorkspace dockWorkspace) - { - var highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml"); - var options = PdbToXmlOptions.IncludeEmbeddedSources | PdbToXmlOptions.IncludeMethodSpans | PdbToXmlOptions.IncludeTokens; - dockWorkspace.RunWithCancellation(ct => Task.Factory.StartNew(() => { - AvalonEditTextOutput output = new AvalonEditTextOutput(); - var writer = new TextOutputWriter(output); - foreach (var node in nodes) - { - string pdbFileName = Path.ChangeExtension(node.LoadedAssembly.FileName, ".pdb"); - if (!File.Exists(pdbFileName)) - continue; - using (var pdbStream = File.OpenRead(pdbFileName)) - using (var peStream = File.OpenRead(node.LoadedAssembly.FileName)) - PdbToXmlConverter.ToXml(writer, pdbStream, peStream, options); - } - return output; - }, ct)).Then(output => dockWorkspace.ShowNodes(output, null, highlighting)).HandleExceptions(); - } - } - - [ExportContextMenuEntry(Header = nameof(Resources.DEBUGDumpPDBAsXML))] - [Shared] - class Pdb2XmlCommandContextMenuEntry(DockWorkspace dockWorkspace) : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - Pdb2XmlCommand.Execute(context.SelectedTreeNodes.OfType(), dockWorkspace); - } - - public bool IsEnabled(TextViewContext context) => true; - - public bool IsVisible(TextViewContext context) - { - var selectedNodes = context.SelectedTreeNodes; - return selectedNodes?.Any() == true - && selectedNodes.All(n => n is AssemblyTreeNode asm && asm.LoadedAssembly.IsLoadedAsValidAssembly); - } - } - -} - -#endif diff --git a/ILSpy/Commands/RefreshCommand.cs b/ILSpy/Commands/RefreshCommand.cs deleted file mode 100644 index d82ac11ab..000000000 --- a/ILSpy/Commands/RefreshCommand.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Windows.Input; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportToolbarCommand(ToolTip = nameof(Resources.RefreshCommand_ReloadAssemblies), ToolbarIcon = "Images/Refresh", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 2)] - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources._Reload), MenuIcon = "Images/Refresh", MenuCategory = nameof(Resources.Open), MenuOrder = 2)] - [Shared] - sealed class RefreshCommand : CommandWrapper - { - private readonly AssemblyTreeModel assemblyTreeModel; - - public RefreshCommand(AssemblyTreeModel assemblyTreeModel) - : base(NavigationCommands.Refresh) - { - this.assemblyTreeModel = assemblyTreeModel; - } - - protected override void OnExecute(object sender, ExecutedRoutedEventArgs e) - { - assemblyTreeModel.Refresh(); - } - } -} diff --git a/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs b/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs deleted file mode 100644 index 00531a5b9..000000000 --- a/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2018 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Linq; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources._RemoveAssembliesWithLoadErrors), MenuCategory = nameof(Resources.Remove), MenuOrder = 2.6)] - [Shared] - class RemoveAssembliesWithLoadErrors(AssemblyTreeModel assemblyTreeModel) : SimpleCommand - { - public override bool CanExecute(object parameter) - { - return assemblyTreeModel.AssemblyList.GetAssemblies().Any(l => l.HasLoadError); - } - - public override void Execute(object parameter) - { - foreach (var assembly in assemblyTreeModel.AssemblyList.GetAssemblies()) - { - if (!assembly.HasLoadError) - continue; - var node = assemblyTreeModel.FindAssemblyNode(assembly); - if (node != null && node.CanDelete()) - node.Delete(); - } - } - } - - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.ClearAssemblyList), MenuCategory = nameof(Resources.Remove), MenuOrder = 2.6)] - [Shared] - class ClearAssemblyList : SimpleCommand - { - private readonly AssemblyTreeModel assemblyTreeModel; - - public ClearAssemblyList(AssemblyTreeModel assemblyTreeModel) - { - this.assemblyTreeModel = assemblyTreeModel; - } - - public override bool CanExecute(object parameter) - { - return assemblyTreeModel.AssemblyList.Count > 0; - } - - public override void Execute(object parameter) - { - assemblyTreeModel.AssemblyList.Clear(); - } - } -} diff --git a/ILSpy/Commands/SaveCodeContextMenuEntry.cs b/ILSpy/Commands/SaveCodeContextMenuEntry.cs deleted file mode 100644 index 75a35b208..000000000 --- a/ILSpy/Commands/SaveCodeContextMenuEntry.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.IO; -using System.Linq; -using System.Windows; - -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX.TreeView; - -using Microsoft.Win32; - -namespace ICSharpCode.ILSpy.TextView -{ - [ExportContextMenuEntry(Header = nameof(Resources._SaveCode), Category = nameof(Resources.Save), Icon = "Images/Save")] - [Shared] - sealed class SaveCodeContextMenuEntry(LanguageService languageService, DockWorkspace dockWorkspace) : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - Execute(context.SelectedTreeNodes, languageService, dockWorkspace); - } - - public bool IsEnabled(TextViewContext context) => true; - - public bool IsVisible(TextViewContext context) - { - return CanExecute(context.SelectedTreeNodes); - } - - public static bool CanExecute(IReadOnlyList selectedNodes) - { - if (selectedNodes == null || selectedNodes.Any(n => !(n is ILSpyTreeNode))) - return false; - return selectedNodes.Count == 1 - || (selectedNodes.Count > 1 && (selectedNodes.All(n => n is AssemblyTreeNode) || selectedNodes.All(n => n is IMemberTreeNode))); - } - - public static void Execute(IReadOnlyList selectedNodes, LanguageService languageService, DockWorkspace dockWorkspace) - { - var currentLanguage = languageService.Language; - var tabPage = dockWorkspace.ActiveTabPage; - tabPage.ShowTextView(textView => { - if (selectedNodes.Count == 1 && selectedNodes[0] is ILSpyTreeNode singleSelection) - { - // if there's only one treenode selected - // we will invoke the custom Save logic - if (singleSelection.Save(tabPage)) - return; - } - else if (selectedNodes.Count > 1 && selectedNodes.All(n => n is AssemblyTreeNode { LoadedAssembly.IsLoadedAsValidAssembly: true })) - { - var selectedPath = SelectSolutionFile(); - - if (!string.IsNullOrEmpty(selectedPath)) - { - var assemblies = selectedNodes.OfType() - .Select(n => n.LoadedAssembly) - .Where(a => a.IsLoadedAsValidAssembly).ToList(); - SolutionWriter.CreateSolution(tabPage, textView, selectedPath, currentLanguage, assemblies); - } - return; - } - - // Fallback: if nobody was able to handle the request, use default behavior. - // try to save all nodes to disk. - var options = dockWorkspace.ActiveTabPage.CreateDecompilationOptions(); - options.FullDecompilation = true; - textView.SaveToDisk(currentLanguage, selectedNodes.OfType(), options); - }); - } - - /// - /// Shows a File Selection dialog where the user can select the target file for the solution. - /// - /// The initial path to show in the dialog. If not specified, the 'Documents' directory - /// will be used. - /// - /// The full path of the selected target file, or null if the user canceled. - static string SelectSolutionFile() - { - SaveFileDialog dlg = new SaveFileDialog(); - dlg.FileName = "Solution.sln"; - dlg.Filter = Resources.VisualStudioSolutionFileSlnAllFiles; - - if (dlg.ShowDialog() != true) - { - return null; - } - - string selectedPath = Path.GetDirectoryName(dlg.FileName); - bool directoryNotEmpty; - try - { - directoryNotEmpty = Directory.EnumerateFileSystemEntries(selectedPath).Any(); - } - catch (Exception e) when (e is IOException || e is UnauthorizedAccessException || e is System.Security.SecurityException) - { - MessageBox.Show( - "The directory cannot be accessed. Please ensure it exists and you have sufficient rights to access it.", - "Solution directory not accessible", - MessageBoxButton.OK, MessageBoxImage.Error); - return null; - } - - if (directoryNotEmpty) - { - var result = MessageBox.Show( - Resources.AssemblySaveCodeDirectoryNotEmpty, - Resources.AssemblySaveCodeDirectoryNotEmptyTitle, - MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No); - if (result == MessageBoxResult.No) - return null; // -> abort - } - - return dlg.FileName; - } - } -} diff --git a/ILSpy/Commands/SaveCommand.cs b/ILSpy/Commands/SaveCommand.cs deleted file mode 100644 index ae5ca6505..000000000 --- a/ILSpy/Commands/SaveCommand.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Linq; -using System.Windows.Input; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TextView; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources._SaveCode), MenuIcon = "Images/Save", MenuCategory = nameof(Resources.Save), MenuOrder = 0)] - [Shared] - sealed class SaveCommand(AssemblyTreeModel assemblyTreeModel, LanguageService languageService, DockWorkspace dockWorkspace) : CommandWrapper(ApplicationCommands.Save) - { - protected override void OnCanExecute(object sender, CanExecuteRoutedEventArgs e) - { - e.Handled = true; - e.CanExecute = SaveCodeContextMenuEntry.CanExecute(assemblyTreeModel.SelectedNodes.ToList()); - } - - protected override void OnExecute(object sender, ExecutedRoutedEventArgs e) - { - SaveCodeContextMenuEntry.Execute(assemblyTreeModel.SelectedNodes.ToList(), languageService, dockWorkspace); - } - } -} diff --git a/ILSpy/Commands/ScopeSearchToAssembly.cs b/ILSpy/Commands/ScopeSearchToAssembly.cs deleted file mode 100644 index e839ebeb3..000000000 --- a/ILSpy/Commands/ScopeSearchToAssembly.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2021 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -#nullable enable - -using System; -using System.Composition; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.AppEnv; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.Search; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy -{ - [ExportContextMenuEntry(Header = nameof(Resources.ScopeSearchToThisAssembly), Category = nameof(Resources.Analyze), Order = 9999)] - [Shared] - public class ScopeSearchToAssembly : IContextMenuEntry - { - private readonly SearchPaneModel searchPane; - - public ScopeSearchToAssembly(SearchPaneModel searchPane) - { - this.searchPane = searchPane; - } - - public void Execute(TextViewContext context) - { - // asmName cannot be null here, because Execute is only called if IsEnabled/IsVisible return true. - string asmName = GetAssembly(context)!; - string searchTerm = searchPane.SearchTerm; - string[] args = CommandLineTools.CommandLineToArgumentArray(searchTerm); - bool replaced = false; - for (int i = 0; i < args.Length; i++) - { - if (args[i].StartsWith("inassembly:", StringComparison.OrdinalIgnoreCase)) - { - args[i] = "inassembly:" + asmName; - replaced = true; - break; - } - } - if (!replaced) - { - searchTerm += " inassembly:" + asmName; - } - else - { - searchTerm = CommandLineTools.ArgumentArrayToCommandLine(args); - } - searchPane.SearchTerm = searchTerm; - } - - public bool IsEnabled(TextViewContext context) - { - return GetAssembly(context) != null; - } - - public bool IsVisible(TextViewContext context) - { - return GetAssembly(context) != null; - } - - string? GetAssembly(TextViewContext context) - { - if (context.Reference?.Reference is IEntity entity) - return entity.ParentModule?.AssemblyName; - if (context.SelectedTreeNodes?.Length != 1) - return null; - switch (context.SelectedTreeNodes[0]) - { - case AssemblyTreeNode tn: - return tn.LoadedAssembly.ShortName; - case IMemberTreeNode member: - return member.Member?.ParentModule?.AssemblyName; - default: - return null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Commands/ScopeSearchToNamespace.cs b/ILSpy/Commands/ScopeSearchToNamespace.cs deleted file mode 100644 index ae0914440..000000000 --- a/ILSpy/Commands/ScopeSearchToNamespace.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2021 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -using System; -using System.Composition; - -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.AppEnv; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.Search; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy -{ - [ExportContextMenuEntry(Header = nameof(Resources.ScopeSearchToThisNamespace), Category = nameof(Resources.Analyze), Order = 9999)] - [Shared] - public class ScopeSearchToNamespace : IContextMenuEntry - { - private readonly SearchPaneModel searchPane; - - public ScopeSearchToNamespace(SearchPaneModel searchPane) - { - this.searchPane = searchPane; - } - - public void Execute(TextViewContext context) - { - string ns = GetNamespace(context); - string searchTerm = searchPane.SearchTerm; - string[] args = CommandLineTools.CommandLineToArgumentArray(searchTerm); - bool replaced = false; - for (int i = 0; i < args.Length; i++) - { - if (args[i].StartsWith("innamespace:", StringComparison.OrdinalIgnoreCase)) - { - args[i] = "innamespace:" + ns; - replaced = true; - break; - } - } - if (!replaced) - { - searchTerm += " innamespace:" + ns; - } - else - { - searchTerm = CommandLineTools.ArgumentArrayToCommandLine(args); - } - - searchPane.SearchTerm = searchTerm; - } - - public bool IsEnabled(TextViewContext context) - { - return GetNamespace(context) != null; - } - - public bool IsVisible(TextViewContext context) - { - return GetNamespace(context) != null; - } - - string GetNamespace(TextViewContext context) - { - if (context.Reference?.Reference is IEntity entity) - return entity.Namespace; - if (context.SelectedTreeNodes?.Length != 1) - return null; - switch (context.SelectedTreeNodes[0]) - { - case NamespaceTreeNode tn: - return tn.Name; - case IMemberTreeNode member: - return member.Member.Namespace; - default: - return null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Commands/SearchMsdnContextMenuEntry.cs b/ILSpy/Commands/SearchMsdnContextMenuEntry.cs deleted file mode 100644 index b1dce4c22..000000000 --- a/ILSpy/Commands/SearchMsdnContextMenuEntry.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Linq; - -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; -namespace ICSharpCode.ILSpy -{ - using System.Composition; - - using ICSharpCode.Decompiler.TypeSystem; - - [ExportContextMenuEntry(Header = nameof(Resources.SearchMSDN), Icon = "images/SearchMsdn", Order = 9999)] - [Shared] - internal sealed class SearchMsdnContextMenuEntry : IContextMenuEntry - { - private static string msdnAddress = "https://docs.microsoft.com/dotnet/api/{0}"; - - public bool IsVisible(TextViewContext context) - { - if (context.SelectedTreeNodes == null) - return false; - - return context.SelectedTreeNodes.All( - n => n is NamespaceTreeNode - || n is TypeTreeNode - || n is EventTreeNode - || n is FieldTreeNode - || n is PropertyTreeNode - || n is MethodTreeNode); - } - - public bool IsEnabled(TextViewContext context) - { - if (context.SelectedTreeNodes == null) - return false; - - foreach (var node in context.SelectedTreeNodes) - { - if (node is TypeTreeNode typeNode && !typeNode.IsPublicAPI) - return false; - - if (node is EventTreeNode eventNode && (!eventNode.IsPublicAPI || !IsAccessible(eventNode.EventDefinition))) - return false; - - if (node is FieldTreeNode fieldNode && (!fieldNode.IsPublicAPI || !IsAccessible(fieldNode.FieldDefinition) || IsDelegateOrEnumMember(fieldNode.FieldDefinition))) - return false; - - if (node is PropertyTreeNode propertyNode && (!propertyNode.IsPublicAPI || !IsAccessible(propertyNode.PropertyDefinition))) - return false; - - if (node is MethodTreeNode methodNode && (!methodNode.IsPublicAPI || !IsAccessible(methodNode.MethodDefinition) || IsDelegateOrEnumMember(methodNode.MethodDefinition))) - return false; - - if (node is NamespaceTreeNode namespaceNode && string.IsNullOrEmpty(namespaceNode.Name)) - return false; - } - - return true; - } - - bool IsAccessible(IEntity entity) - { - if (entity.DeclaringTypeDefinition == null) - return false; - switch (entity.DeclaringTypeDefinition.Accessibility) - { - case Accessibility.Public: - case Accessibility.Protected: - case Accessibility.ProtectedOrInternal: - return true; - default: - return false; - } - } - - bool IsDelegateOrEnumMember(IMember member) - { - if (member.DeclaringTypeDefinition == null) - return false; - switch (member.DeclaringTypeDefinition.Kind) - { - case TypeKind.Delegate: - case TypeKind.Enum: - return true; - default: - return false; - } - } - - public void Execute(TextViewContext context) - { - if (context.SelectedTreeNodes != null) - { - foreach (ILSpyTreeNode node in context.SelectedTreeNodes) - { - SearchMsdn(node); - } - } - } - - public static void SearchMsdn(ILSpyTreeNode node) - { - var address = string.Empty; - - if (node is NamespaceTreeNode namespaceNode) - { - address = string.Format(msdnAddress, namespaceNode.Name); - } - else if (node is IMemberTreeNode memberNode) - { - var member = memberNode.Member; - var memberName = member.ReflectionName.Replace('`', '-').Replace('+', '.'); - if (memberName.EndsWith("..ctor", System.StringComparison.Ordinal)) - memberName = memberName.Substring(0, memberName.Length - 5) + "-ctor"; - - address = string.Format(msdnAddress, memberName); - } - - address = address.ToLower(); - if (!string.IsNullOrEmpty(address)) - GlobalUtils.OpenLink(address); - } - } -} \ No newline at end of file diff --git a/ILSpy/Commands/SelectPdbContextMenuEntry.cs b/ILSpy/Commands/SelectPdbContextMenuEntry.cs deleted file mode 100644 index f0ac31244..000000000 --- a/ILSpy/Commands/SelectPdbContextMenuEntry.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2018 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.IO; -using System.Linq; - -using ICSharpCode.Decompiler.CSharp.ProjectDecompiler; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; - -using Microsoft.Win32; -namespace ICSharpCode.ILSpy -{ - [ExportContextMenuEntry(Header = nameof(Resources.SelectPDB))] - [Shared] - class SelectPdbContextMenuEntry(AssemblyTreeModel assemblyTreeModel) : IContextMenuEntry - { - public async void Execute(TextViewContext context) - { - var assembly = (context.SelectedTreeNodes?.FirstOrDefault() as AssemblyTreeNode)?.LoadedAssembly; - if (assembly == null) - return; - OpenFileDialog dlg = new OpenFileDialog(); - dlg.FileName = WholeProjectDecompiler.CleanUpFileName(assembly.ShortName, ".pdb"); - dlg.Filter = Resources.PortablePDBPdbAllFiles; - dlg.InitialDirectory = Path.GetDirectoryName(assembly.FileName); - if (dlg.ShowDialog() != true) - return; - - using (context.TreeView.LockUpdates()) - { - await assembly.LoadDebugInfo(dlg.FileName); - } - - var node = (AssemblyTreeNode)assemblyTreeModel.FindNodeByPath(new[] { assembly.FileName }, true); - node.UpdateToolTip(); - assemblyTreeModel.SelectNode(node); - assemblyTreeModel.RefreshDecompiledView(); - } - - public bool IsEnabled(TextViewContext context) => true; - - public bool IsVisible(TextViewContext context) - { - return context.SelectedTreeNodes?.Length == 1 - && context.SelectedTreeNodes?.FirstOrDefault() is AssemblyTreeNode asm - && asm.LoadedAssembly.IsLoadedAsValidAssembly; - } - } -} diff --git a/ILSpy/Commands/SetThemeCommand.cs b/ILSpy/Commands/SetThemeCommand.cs deleted file mode 100644 index aa1e7d46a..000000000 --- a/ILSpy/Commands/SetThemeCommand.cs +++ /dev/null @@ -1,18 +0,0 @@ - -using System.Composition; - -namespace ICSharpCode.ILSpy.Commands -{ - [Export] - [Shared] - public class SetThemeCommand(SettingsService settingsService) : SimpleCommand - { - public override void Execute(object parameter) - { - if (parameter is string theme) - { - settingsService.SessionSettings.Theme = theme; - } - } - } -} diff --git a/ILSpy/Commands/ShowCFGContextMenuEntry.cs b/ILSpy/Commands/ShowCFGContextMenuEntry.cs deleted file mode 100644 index c936c74d4..000000000 --- a/ILSpy/Commands/ShowCFGContextMenuEntry.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Composition; -using System.Windows; - -using ICSharpCode.Decompiler.FlowAnalysis; -using ICSharpCode.Decompiler.IL; -using ICSharpCode.Decompiler.IL.ControlFlow; - -namespace ICSharpCode.ILSpy.Commands -{ -#if DEBUG - [ExportContextMenuEntry(Header = "DEBUG -- Show CFG")] - [Shared] - internal class ShowCFGContextMenuEntry : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - try - { - var container = (BlockContainer)context.Reference.Reference; - var cfg = new ControlFlowGraph(container); - ExportGraph(cfg.Nodes).Show(); - } - catch (Exception ex) - { - MessageBox.Show("Error generating CFG - requires GraphViz dot.exe in PATH" + Environment.NewLine + Environment.NewLine + ex.ToString()); - } - } - - public bool IsEnabled(TextViewContext context) - { - return context.Reference?.Reference is BlockContainer; - } - - public bool IsVisible(TextViewContext context) - { - return context.Reference?.Reference is BlockContainer; - } - - internal static GraphVizGraph ExportGraph(IReadOnlyList nodes, Func labelFunc = null) - { - if (labelFunc == null) - { - labelFunc = node => { - var block = node.UserData as Block; - return block != null ? block.Label : node.UserData?.ToString(); - }; - } - GraphVizGraph g = new GraphVizGraph(); - GraphVizNode[] n = new GraphVizNode[nodes.Count]; - for (int i = 0; i < n.Length; i++) - { - n[i] = new GraphVizNode(nodes[i].UserIndex); - n[i].shape = "box"; - n[i].label = labelFunc(nodes[i]); - g.AddNode(n[i]); - } - foreach (var source in nodes) - { - foreach (var target in source.Successors) - { - g.AddEdge(new GraphVizEdge(source.UserIndex, target.UserIndex)); - } - if (source.ImmediateDominator != null) - { - g.AddEdge( - new GraphVizEdge(source.ImmediateDominator.UserIndex, source.UserIndex) { - color = "green" - }); - } - } - return g; - } - } -#endif -} diff --git a/ILSpy/Commands/ShowPane.cs b/ILSpy/Commands/ShowPane.cs deleted file mode 100644 index c82356b74..000000000 --- a/ILSpy/Commands/ShowPane.cs +++ /dev/null @@ -1,25 +0,0 @@ -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Commands -{ - class ToolPaneCommand(string contentId, DockWorkspace dockWorkspace) : SimpleCommand - { - public override void Execute(object parameter) - { - dockWorkspace.ShowToolPane(contentId); - } - } - - class TabPageCommand(TabPageModel model, DockWorkspace dockWorkspace) : SimpleCommand - { - public override void Execute(object parameter) - { - // ensure the tab control is focused before setting the active tab page, else the tab will not be focused - dockWorkspace.ActiveTabPage?.Focus(); - // reset first, else clicking on the already active tab will not focus the tab and the menu checkmark will not be updated - dockWorkspace.ActiveTabPage = null; - dockWorkspace.ActiveTabPage = model; - } - } -} \ No newline at end of file diff --git a/ILSpy/Commands/SimpleCommand.cs b/ILSpy/Commands/SimpleCommand.cs deleted file mode 100644 index f57d07571..000000000 --- a/ILSpy/Commands/SimpleCommand.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections; -using System.Windows.Data; -using System.Windows.Input; - -namespace ICSharpCode.ILSpy -{ - public abstract class SimpleCommand : ICommand - { - public event EventHandler CanExecuteChanged { - add { CommandManager.RequerySuggested += value; } - remove { CommandManager.RequerySuggested -= value; } - } - - public abstract void Execute(object parameter); - - public virtual bool CanExecute(object parameter) - { - return true; - } - } - - public interface IProvideParameterBinding - { - Binding ParameterBinding { get; } - } - - public interface IProvideParameterList - { - IEnumerable ParameterList { get; } - object GetParameterText(object parameter); - } -} diff --git a/ILSpy/Commands/SortAssemblyListCommand.cs b/ILSpy/Commands/SortAssemblyListCommand.cs deleted file mode 100644 index 8a62182bc..000000000 --- a/ILSpy/Commands/SortAssemblyListCommand.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; - -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy -{ - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._View), Header = nameof(Resources.SortAssembly_listName), MenuIcon = "Images/Sort", MenuCategory = nameof(Resources.View))] - [ExportToolbarCommand(ToolTip = nameof(Resources.SortAssemblyListName), ToolbarIcon = "Images/Sort", ToolbarCategory = nameof(Resources.View))] - [Shared] - sealed class SortAssemblyListCommand(AssemblyTreeModel assemblyTreeModel) : SimpleCommand - { - public override void Execute(object parameter) - { - assemblyTreeModel.SortAssemblyList(); - } - } - - [ExportMainMenuCommand(ParentMenuID = nameof(Resources._View), Header = nameof(Resources._CollapseTreeNodes), MenuIcon = "Images/CollapseAll", MenuCategory = nameof(Resources.View))] - [ExportToolbarCommand(ToolTip = nameof(Resources.CollapseTreeNodes), ToolbarIcon = "Images/CollapseAll", ToolbarCategory = nameof(Resources.View))] - [Shared] - sealed class CollapseAllCommand(AssemblyTreeModel assemblyTreeModel) : SimpleCommand - { - public override void Execute(object parameter) - { - assemblyTreeModel.CollapseAll(); - - } - } -} diff --git a/ILSpy/ContextMenuEntry.cs b/ILSpy/ContextMenuEntry.cs deleted file mode 100644 index a88812fca..000000000 --- a/ILSpy/ContextMenuEntry.cs +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Linq; -using System.Windows; -using System.Windows.Controls; - -using ICSharpCode.AvalonEdit; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpyX.Search; -using ICSharpCode.ILSpy.Controls.TreeView; -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Composition; -using TomsToolbox.Essentials; -using TomsToolbox.Wpf.Composition; - -namespace ICSharpCode.ILSpy -{ - public interface IContextMenuEntry - { - bool IsVisible(TextViewContext context); - bool IsEnabled(TextViewContext context); - void Execute(TextViewContext context); - } - - public class TextViewContext - { - /// - /// Returns the selected nodes in the tree view. - /// Returns null, if context menu does not belong to a tree view. - /// - public SharpTreeNode[] SelectedTreeNodes { get; private set; } - - /// - /// Returns the tree view the context menu is assigned to. - /// Returns null, if context menu is not assigned to a tree view. - /// - public SharpTreeView TreeView { get; private set; } - - /// - /// Returns the text view the context menu is assigned to. - /// Returns null, if context menu is not assigned to a text view. - /// - public DecompilerTextView TextView { get; private set; } - - /// - /// Returns the list box the context menu is assigned to. - /// Returns null, if context menu is not assigned to a list box. - /// - public ListBox ListBox { get; private set; } - - /// - /// Returns the data grid the context menu is assigned to. - /// Returns null, if context menu is not assigned to a data grid. - /// - public DataGrid DataGrid { get; private set; } - - /// - /// Returns the reference the mouse cursor is currently hovering above. - /// Returns null, if there was no reference found. - /// - public ReferenceSegment Reference { get; private set; } - - /// - /// Returns the position in TextView the mouse cursor is currently hovering above. - /// Returns null, if TextView returns null; - /// - public TextViewPosition? Position { get; private set; } - - /// - /// Returns the original source of the context menu event. - /// - public DependencyObject OriginalSource { get; private set; } - - public static TextViewContext Create(ContextMenuEventArgs eventArgs, SharpTreeView treeView = null, DecompilerTextView textView = null, ListBox listBox = null, DataGrid dataGrid = null) - { - ReferenceSegment reference; - - if (textView is not null) - { - reference = textView.GetReferenceSegmentAtMousePosition(); - } - else - { - reference = (listBox?.SelectedItem ?? dataGrid?.SelectedItem) switch { - SearchResult searchResult => new() { Reference = searchResult.Reference }, - TreeNodes.IMemberTreeNode treeNode => new() { Reference = treeNode.Member }, { } value => new() { Reference = value }, - _ => null - }; - } - - var position = textView?.GetPositionFromMousePosition(); - var selectedTreeNodes = treeView?.GetTopLevelSelection().ToArray(); - - return new() { - ListBox = listBox, - DataGrid = dataGrid, - TreeView = treeView, - TextView = textView, - SelectedTreeNodes = selectedTreeNodes, - Reference = reference, - Position = position, - OriginalSource = eventArgs.OriginalSource as DependencyObject - }; - } - } - - public interface IContextMenuEntryMetadata - { - string MenuID { get; } - string ParentMenuID { get; } - string Icon { get; } - string Header { get; } - string Category { get; } - string InputGestureText { get; } - - double Order { get; } - } - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class ExportContextMenuEntryAttribute : ExportAttribute, IContextMenuEntryMetadata - { - public ExportContextMenuEntryAttribute() - : base(typeof(IContextMenuEntry)) - { - // entries default to end of menu unless given specific order position - Order = double.MaxValue; - } - /// - /// Gets/Sets the ID of this menu item. Menu entries are not required to have an ID, - /// however, setting it allows to declare nested menu structures. - /// Plugin authors are advised to use GUIDs as identifiers to prevent conflicts. - /// - /// NOTE: Defining cycles (for example by accidentally setting equal to ) - /// will lead to a stack-overflow and crash of ILSpy at startup. - /// - public string MenuID { get; set; } - /// - /// Gets/Sets the parent of this menu item. All menu items sharing the same parent will be displayed as sub-menu items. - /// If this property is set to , the menu item is displayed in the top-level menu. - /// - /// NOTE: Defining cycles (for example by accidentally setting equal to ) - /// will lead to a stack-overflow and crash of ILSpy at startup. - /// - public string ParentMenuID { get; set; } - public string Icon { get; set; } - public string Header { get; set; } - public string Category { get; set; } - public string InputGestureText { get; set; } - public double Order { get; set; } - } - - internal class ContextMenuProvider - { - private static readonly WeakEventSource ContextMenuClosedEventSource = new(); - - public static event EventHandler ContextMenuClosed { - add => ContextMenuClosedEventSource.Subscribe(value); - remove => ContextMenuClosedEventSource.Unsubscribe(value); - } - - /// - /// Enables extensible context menu support for the specified tree view. - /// - 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 void 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(); - } - - public static void Add(ListBox listBox) - { - var provider = new ContextMenuProvider(listBox); - listBox.ContextMenuOpening += provider.listBox_ContextMenuOpening; - listBox.ContextMenu = new ContextMenu(); - } - - public static void Add(DataGrid dataGrid) - { - var provider = new ContextMenuProvider(dataGrid); - dataGrid.ContextMenuOpening += provider.dataGrid_ContextMenuOpening; - dataGrid.ContextMenu = new ContextMenu(); - } - - readonly Control control; - readonly SharpTreeView treeView; - readonly DecompilerTextView textView; - readonly ListBox listBox; - readonly DataGrid dataGrid; - readonly IExport[] entries; - - private ContextMenuProvider(Control control) - { - entries = control.GetExportProvider().GetExports().ToArray(); - - this.control = control; - } - - ContextMenuProvider(DecompilerTextView textView) - : this((Control)textView) - { - this.textView = textView ?? throw new ArgumentNullException(nameof(textView)); - } - - ContextMenuProvider(SharpTreeView treeView) - : this((Control)treeView) - { - this.treeView = treeView ?? throw new ArgumentNullException(nameof(treeView)); - } - - ContextMenuProvider(ListBox listBox) - : this((Control)listBox) - { - this.listBox = listBox ?? throw new ArgumentNullException(nameof(listBox)); - } - - ContextMenuProvider(DataGrid dataGrid) - : this((Control)dataGrid) - { - this.dataGrid = dataGrid ?? throw new ArgumentNullException(nameof(dataGrid)); - } - - void treeView_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - var context = TextViewContext.Create(e, treeView: treeView); - if (context.SelectedTreeNodes.Length == 0) - { - e.Handled = true; // don't show the menu - return; - } - - if (ShowContextMenu(context, out var menu)) - treeView.ContextMenu = menu; - else - // hide the context menu. - e.Handled = true; - } - - void textView_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - var context = TextViewContext.Create(e, textView: textView); - if (ShowContextMenu(context, out var menu)) - textView.ContextMenu = menu; - else - // hide the context menu. - e.Handled = true; - } - - void listBox_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - var context = TextViewContext.Create(e, listBox: listBox); - if (ShowContextMenu(context, out var menu)) - listBox.ContextMenu = menu; - else - // hide the context menu. - e.Handled = true; - } - - void dataGrid_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - var context = TextViewContext.Create(e, dataGrid: dataGrid); - if (ShowContextMenu(context, out var menu)) - dataGrid.ContextMenu = menu; - else - // hide the context menu. - e.Handled = true; - } - - bool ShowContextMenu(TextViewContext context, out ContextMenu menu) - { - // Closing event is raised on the control where mouse is clicked, not on the control that opened the menu, so we hook on the global window event. - var window = Window.GetWindow(control)!; - window.ContextMenuClosing += ContextMenu_Closing; - - void ContextMenu_Closing(object sender, EventArgs e) - { - window.ContextMenuClosing -= ContextMenu_Closing; - ContextMenuClosedEventSource.Raise(this, EventArgs.Empty); - } - - menu = new ContextMenu(); - - var menuGroups = new Dictionary[]>(); - IExport[] topLevelGroup = null; - foreach (var group in entries.OrderBy(c => c.Metadata.Order).GroupBy(c => c.Metadata.ParentMenuID)) - { - if (group.Key == null) - { - topLevelGroup = group.ToArray(); - } - else - { - menuGroups.Add(group.Key, group.ToArray()); - } - } - BuildMenu(topLevelGroup ?? Array.Empty>(), menu.Items); - return menu.Items.Count > 0; - - void BuildMenu(IExport[] menuGroup, ItemCollection parent) - { - foreach (var category in menuGroup.GroupBy(c => c.Metadata.Category)) - { - var needSeparatorForCategory = parent.Count > 0; - foreach (var entryPair in category) - { - var entry = entryPair.Value; - if (entry.IsVisible(context)) - { - if (needSeparatorForCategory) - { - parent.Add(new Separator()); - needSeparatorForCategory = false; - } - var menuItem = new MenuItem(); - menuItem.Header = ResourceHelper.GetString(entryPair.Metadata.Header); - menuItem.InputGestureText = entryPair.Metadata.InputGestureText; - if (!string.IsNullOrEmpty(entryPair.Metadata.Icon)) - { - menuItem.Icon = new Image { - Width = 16, - Height = 16, - Source = Images.Load(entryPair.Value, entryPair.Metadata.Icon) - }; - } - if (entryPair.Value.IsEnabled(context)) - { - menuItem.Click += delegate { entry.Execute(context); }; - } - else - menuItem.IsEnabled = false; - parent.Add(menuItem); - - if (entryPair.Metadata.MenuID != null && menuGroups.TryGetValue(entryPair.Metadata.MenuID, out var group)) - { - BuildMenu(group, menuItem.Items); - } - } - } - } - } - } - } -} diff --git a/ILSpy/Controls/CollapsiblePanel.cs b/ILSpy/Controls/CollapsiblePanel.cs deleted file mode 100644 index bed3dd450..000000000 --- a/ILSpy/Controls/CollapsiblePanel.cs +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Input; -using System.Windows.Media.Animation; -using System.Windows.Threading; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// Allows animated collapsing of the content of this panel. - /// - public class CollapsiblePanel : ContentControl - { - static CollapsiblePanel() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(CollapsiblePanel), - new FrameworkPropertyMetadata(typeof(CollapsiblePanel))); - FocusableProperty.OverrideMetadata(typeof(CollapsiblePanel), - new FrameworkPropertyMetadata(false)); - } - - public static readonly DependencyProperty IsCollapsedProperty = DependencyProperty.Register( - "IsCollapsed", typeof(bool), typeof(CollapsiblePanel), - new UIPropertyMetadata(false, new PropertyChangedCallback(OnIsCollapsedChanged))); - - public bool IsCollapsed { - get { return (bool)GetValue(IsCollapsedProperty); } - set { SetValue(IsCollapsedProperty, value); } - } - - public static readonly DependencyProperty CollapseOrientationProperty = - DependencyProperty.Register("CollapseOrientation", typeof(Orientation), typeof(CollapsiblePanel), - new FrameworkPropertyMetadata(Orientation.Vertical)); - - public Orientation CollapseOrientation { - get { return (Orientation)GetValue(CollapseOrientationProperty); } - set { SetValue(CollapseOrientationProperty, value); } - } - - public static readonly DependencyProperty DurationProperty = DependencyProperty.Register( - "Duration", typeof(TimeSpan), typeof(CollapsiblePanel), - new UIPropertyMetadata(TimeSpan.FromMilliseconds(250))); - - /// - /// The duration in milliseconds of the animation. - /// - public TimeSpan Duration { - get { return (TimeSpan)GetValue(DurationProperty); } - set { SetValue(DurationProperty, value); } - } - - protected internal static readonly DependencyProperty AnimationProgressProperty = DependencyProperty.Register( - "AnimationProgress", typeof(double), typeof(CollapsiblePanel), - new FrameworkPropertyMetadata(1.0)); - - /// - /// Value between 0 and 1 specifying how far the animation currently is. - /// - protected internal double AnimationProgress { - get { return (double)GetValue(AnimationProgressProperty); } - set { SetValue(AnimationProgressProperty, value); } - } - - protected internal static readonly DependencyProperty AnimationProgressXProperty = DependencyProperty.Register( - "AnimationProgressX", typeof(double), typeof(CollapsiblePanel), - new FrameworkPropertyMetadata(1.0)); - - /// - /// Value between 0 and 1 specifying how far the animation currently is. - /// - protected internal double AnimationProgressX { - get { return (double)GetValue(AnimationProgressXProperty); } - set { SetValue(AnimationProgressXProperty, value); } - } - - protected internal static readonly DependencyProperty AnimationProgressYProperty = DependencyProperty.Register( - "AnimationProgressY", typeof(double), typeof(CollapsiblePanel), - new FrameworkPropertyMetadata(1.0)); - - /// - /// Value between 0 and 1 specifying how far the animation currently is. - /// - protected internal double AnimationProgressY { - get { return (double)GetValue(AnimationProgressYProperty); } - set { SetValue(AnimationProgressYProperty, value); } - } - - static void OnIsCollapsedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((CollapsiblePanel)d).SetupAnimation((bool)e.NewValue); - } - - void SetupAnimation(bool isCollapsed) - { - if (this.IsLoaded) - { - // If the animation is already running, calculate remaining portion of the time - double currentProgress = AnimationProgress; - if (!isCollapsed) - { - currentProgress = 1.0 - currentProgress; - } - - DoubleAnimation animation = new DoubleAnimation(); - animation.To = isCollapsed ? 0.0 : 1.0; - animation.Duration = TimeSpan.FromSeconds(Duration.TotalSeconds * currentProgress); - animation.FillBehavior = FillBehavior.HoldEnd; - - this.BeginAnimation(AnimationProgressProperty, animation); - if (CollapseOrientation == Orientation.Horizontal) - { - this.BeginAnimation(AnimationProgressXProperty, animation); - this.AnimationProgressY = 1.0; - } - else - { - this.AnimationProgressX = 1.0; - this.BeginAnimation(AnimationProgressYProperty, animation); - } - } - else - { - this.AnimationProgress = isCollapsed ? 0.0 : 1.0; - this.AnimationProgressX = (CollapseOrientation == Orientation.Horizontal) ? this.AnimationProgress : 1.0; - this.AnimationProgressY = (CollapseOrientation == Orientation.Vertical) ? this.AnimationProgress : 1.0; - } - } - } - - sealed class CollapsiblePanelProgressToVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - if (value is double) - return (double)value > 0 ? Visibility.Visible : Visibility.Collapsed; - else - return Visibility.Visible; - } - - public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - throw new NotImplementedException(); - } - } - - public class SelfCollapsingPanel : CollapsiblePanel - { - public static readonly DependencyProperty CanCollapseProperty = - DependencyProperty.Register("CanCollapse", typeof(bool), typeof(SelfCollapsingPanel), - new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnCanCollapseChanged))); - - public bool CanCollapse { - get { return (bool)GetValue(CanCollapseProperty); } - set { SetValue(CanCollapseProperty, value); } - } - - static void OnCanCollapseChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - SelfCollapsingPanel panel = (SelfCollapsingPanel)d; - if ((bool)e.NewValue) - { - if (!panel.HeldOpenByMouse) - panel.IsCollapsed = true; - } - else - { - panel.IsCollapsed = false; - } - } - - bool HeldOpenByMouse { - get { return IsMouseOver || IsMouseCaptureWithin; } - } - - protected override void OnMouseLeave(MouseEventArgs e) - { - base.OnMouseLeave(e); - if (CanCollapse && !HeldOpenByMouse) - IsCollapsed = true; - } - - protected override void OnLostMouseCapture(MouseEventArgs e) - { - base.OnLostMouseCapture(e); - if (CanCollapse && !HeldOpenByMouse) - IsCollapsed = true; - } - } -} diff --git a/ILSpy/Controls/CultureSelectionConverter.cs b/ILSpy/Controls/CultureSelectionConverter.cs deleted file mode 100644 index f8b7c2389..000000000 --- a/ILSpy/Controls/CultureSelectionConverter.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2021 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE - -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace ICSharpCode.ILSpy.Controls -{ - public class CultureSelectionConverter : MarkupExtension, IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is string s) - return s.Equals(parameter); - return value == parameter; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if ((bool)value) - return parameter; - return Binding.DoNothing; - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} diff --git a/ILSpy/Controls/CustomDialog.cs b/ILSpy/Controls/CustomDialog.cs deleted file mode 100644 index 1e180c517..000000000 --- a/ILSpy/Controls/CustomDialog.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace ICSharpCode.ILSpy.Controls -{ - public sealed class CustomDialog : System.Windows.Forms.Form - { - System.Windows.Forms.Label label; - System.Windows.Forms.Panel panel; - int acceptButton; - int cancelButton; - int result = -1; - - /// - /// Gets the index of the button pressed. - /// - public int Result { - get { - return result; - } - } - - public CustomDialog(string caption, string message, int acceptButton, int cancelButton, string[] buttonLabels) - { - this.SuspendLayout(); - MyInitializeComponent(); - - this.Icon = null; - this.acceptButton = acceptButton; - this.cancelButton = cancelButton; - this.Text = caption; - - using (Graphics g = this.CreateGraphics()) - { - Size size = TextRenderer.MeasureText(message, label.Font, new((int)(Screen.FromControl(this).WorkingArea.Width * 0.9), int.MaxValue), TextFormatFlags.NoPrefix | TextFormatFlags.WordBreak); - Size clientSize = new Size((int)Math.Ceiling(size.Width * 96 / g.DpiX) + DockPadding.Left + DockPadding.Right, (int)Math.Ceiling(size.Height * 96 / g.DpiY) + DockPadding.Top + DockPadding.Bottom); - Button[] buttons = new Button[buttonLabels.Length]; - int[] positions = new int[buttonLabels.Length]; - int pos = 0; - for (int i = 0; i < buttons.Length; i++) - { - Button newButton = new Button(); - newButton.FlatStyle = FlatStyle.System; - newButton.Tag = i; - string buttonLabel = buttonLabels[i]; - newButton.Text = buttonLabel; - newButton.Click += new EventHandler(ButtonClick); - Size buttonSize = TextRenderer.MeasureText(buttonLabel, newButton.Font); - newButton.Width = Math.Max(newButton.Width, ((int)Math.Ceiling(buttonSize.Width * 96 / g.DpiX / 8.0) + 1) * 8); - positions[i] = pos; - buttons[i] = newButton; - pos += newButton.Width + 4; - } - if (acceptButton >= 0) - { - AcceptButton = buttons[acceptButton]; - } - if (cancelButton >= 0) - { - CancelButton = buttons[cancelButton]; - } - - pos += 4; // add space before first button - // (we don't start with pos=4 because this space doesn't belong to the button panel) - - if (pos > clientSize.Width) - { - clientSize.Width = pos; - } - clientSize.Height += panel.Height; - this.ClientSize = clientSize; - int start = (clientSize.Width - pos) / 2; - for (int i = 0; i < buttons.Length; i++) - { - buttons[i].Location = new Point(start + positions[i], 4); - } - panel.Controls.AddRange(buttons); - } - label.Text = message; - - this.ResumeLayout(false); - } - - protected override void OnKeyDown(KeyEventArgs e) - { - if (cancelButton == -1 && e.KeyCode == Keys.Escape) - { - this.Close(); - } - else if (e.KeyCode == Keys.C && e.Control) - { - Clipboard.SetText(this.Text + Environment.NewLine + label.Text); - } - } - - void ButtonClick(object sender, EventArgs e) - { - result = (int)((Control)sender).Tag; - this.Close(); - } - - /// - /// This method is required for Windows Forms designer support. - /// Do not change the method contents inside the source code editor. The Forms designer might - /// not be able to load this method if it was changed manually. - /// - void MyInitializeComponent() - { - this.panel = new System.Windows.Forms.Panel(); - this.label = new System.Windows.Forms.Label(); - // - // panel - // - this.panel.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel.Location = new System.Drawing.Point(4, 80); - this.panel.Name = "panel"; - this.panel.Size = new System.Drawing.Size(266, 32); - this.panel.TabIndex = 0; - // - // label - // - this.label.Dock = System.Windows.Forms.DockStyle.Fill; - this.label.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label.Location = new System.Drawing.Point(4, 4); - this.label.Name = "label"; - this.label.Size = new System.Drawing.Size(266, 76); - this.label.TabIndex = 1; - this.label.UseMnemonic = false; - // - // CustomDialog - // - this.ClientSize = new System.Drawing.Size(274, 112); - this.Controls.Add(this.label); - this.Controls.Add(this.panel); - this.DockPadding.Left = 4; - this.DockPadding.Right = 4; - this.DockPadding.Top = 4; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.ShowInTaskbar = false; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "CustomDialog"; - this.KeyPreview = true; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "CustomDialog"; - this.AutoScaleMode = AutoScaleMode.Dpi; - this.AutoScaleDimensions = new SizeF(96, 96); - } - } -} diff --git a/ILSpy/Controls/ExtensionMethods.cs b/ILSpy/Controls/ExtensionMethods.cs deleted file mode 100644 index 1ab16694e..000000000 --- a/ILSpy/Controls/ExtensionMethods.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows; -using System.Windows.Markup; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// ExtensionMethods used in ILSpy. - /// - public static class ExtensionMethods - { - /// - /// Sets the value of a dependency property on using a markup extension. - /// - /// This method does not support markup extensions like x:Static that depend on - /// having a XAML file as context. - public static void SetValueToExtension(this DependencyObject targetObject, DependencyProperty property, MarkupExtension markupExtension) - { - // This method was copied from ICSharpCode.Core.Presentation (with permission to switch license to X11) - - if (targetObject == null) - throw new ArgumentNullException(nameof(targetObject)); - if (property == null) - throw new ArgumentNullException(nameof(property)); - if (markupExtension == null) - throw new ArgumentNullException(nameof(markupExtension)); - - var serviceProvider = new SetValueToExtensionServiceProvider(targetObject, property); - targetObject.SetValue(property, markupExtension.ProvideValue(serviceProvider)); - } - - sealed class SetValueToExtensionServiceProvider : IServiceProvider, IProvideValueTarget - { - // This class was copied from ICSharpCode.Core.Presentation (with permission to switch license to X11) - - readonly DependencyObject targetObject; - readonly DependencyProperty targetProperty; - - public SetValueToExtensionServiceProvider(DependencyObject targetObject, DependencyProperty property) - { - this.targetObject = targetObject; - this.targetProperty = property; - } - - public object GetService(Type serviceType) - { - if (serviceType == typeof(IProvideValueTarget)) - return this; - else - return null; - } - - public object TargetObject { - get { return targetObject; } - } - - public object TargetProperty { - get { return targetProperty; } - } - } - } -} diff --git a/ILSpy/Controls/GridViewColumnAutoSize.cs b/ILSpy/Controls/GridViewColumnAutoSize.cs deleted file mode 100644 index 8f5efb43e..000000000 --- a/ILSpy/Controls/GridViewColumnAutoSize.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Windows; -using System.Windows.Controls; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// This class adds the AutoWidth property to the WPF ListView. - /// It supports a semi-colon-separated list of values, for each defined cell. - /// Each value can either be a fixed size double, or a percentage. - /// The sizes of columns with a percentage will be calculated from the - /// remaining width (after assigning the fixed sizes). - /// Examples: 50%;25%;25% or 30;100%;50 - /// - public class GridViewColumnAutoSize - { - // This class was copied from ICSharpCode.Core.Presentation. - - public static readonly DependencyProperty AutoWidthProperty = - DependencyProperty.RegisterAttached("AutoWidth", typeof(string), typeof(GridViewColumnAutoSize), - new FrameworkPropertyMetadata(null, AutoWidthPropertyChanged)); - - public static string GetAutoWidth(DependencyObject obj) - { - return (string)obj.GetValue(AutoWidthProperty); - } - - public static void SetAutoWidth(DependencyObject obj, string value) - { - obj.SetValue(AutoWidthProperty, value); - } - - static void AutoWidthPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) - { - ListView grid = sender as ListView; - if (grid == null) - return; - grid.SizeChanged += delegate (object listView, SizeChangedEventArgs e) { - ListView lv = listView as ListView; - if (lv == null) - return; - GridView v = lv.View as GridView; - if (v == null) - return; - CalculateSizes(v, GetAutoWidth(lv), e.NewSize.Width); - }; - GridView view = grid.View as GridView; - if (view == null) - return; - CalculateSizes(view, args.NewValue as string, grid.ActualWidth); - } - - static void CalculateSizes(GridView view, string sizeValue, double fullWidth) - { - string[] sizes = (sizeValue ?? "").Split(';'); - - if (sizes.Length != view.Columns.Count) - return; - Dictionary> percentages = new Dictionary>(); - double remainingWidth = fullWidth - 30; // 30 is a good offset for the scrollbar - - for (int i = 0; i < view.Columns.Count; i++) - { - var column = view.Columns[i]; - double size; - bool isPercentage = !double.TryParse(sizes[i], out size); - if (isPercentage) - { - size = double.Parse(sizes[i].TrimEnd('%', ' ')); - percentages.Add(i, w => w * size / 100.0); - } - else - { - column.Width = size; - remainingWidth -= size; - } - } - - if (remainingWidth < 0) - return; - foreach (var p in percentages) - { - var column = view.Columns[p.Key]; - column.Width = p.Value(remainingWidth); - } - } - } -} diff --git a/ILSpy/Controls/MainMenu.xaml b/ILSpy/Controls/MainMenu.xaml deleted file mode 100644 index dfb723166..000000000 --- a/ILSpy/Controls/MainMenu.xaml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Controls/MainMenu.xaml.cs b/ILSpy/Controls/MainMenu.xaml.cs deleted file mode 100644 index 3bb7ad404..000000000 --- a/ILSpy/Controls/MainMenu.xaml.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) 2024 Tom Englert for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Composition; -using System.Globalization; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Input; - -using ICSharpCode.ILSpy.Commands; - -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.ViewModels; - -using TomsToolbox.Composition; -using TomsToolbox.ObservableCollections; -using TomsToolbox.Wpf; -using TomsToolbox.Wpf.Converters; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// Interaction logic for MainMenu.xaml - /// - [Export] - [NonShared] - public partial class MainMenu - { - public MainMenu(SettingsService settingsService, IExportProvider exportProvider, DockWorkspace dockWorkspace) - { - SessionSettings = settingsService.SessionSettings; - - InitializeComponent(); - - this.BeginInvoke(() => { - InitMainMenu(Menu, exportProvider); - InitWindowMenu(WindowMenuItem, Window.GetWindow(this)!.InputBindings, dockWorkspace); - }); - } - - public SessionSettings SessionSettings { get; } - - static void InitMainMenu(Menu mainMenu, IExportProvider exportProvider) - { - var mainMenuCommands = exportProvider.GetExports("MainMenuCommand"); - // Start by constructing the individual flat menus - var parentMenuItems = new Dictionary(); - var menuGroups = mainMenuCommands.OrderBy(c => c.Metadata?.MenuOrder).GroupBy(c => c.Metadata?.ParentMenuID).ToArray(); - foreach (var menu in menuGroups) - { - // Get or add the target menu item and add all items grouped by menu category - var parentMenuItem = GetOrAddParentMenuItem(menu.Key, menu.Key); - foreach (var category in menu.GroupBy(c => c.Metadata?.MenuCategory)) - { - if (parentMenuItem.Items.Count > 0) - { - parentMenuItem.Items.Add(new Separator { Tag = category.Key }); - } - foreach (var entry in category) - { - if (menuGroups.Any(g => g.Key == entry.Metadata?.MenuID)) - { - var menuItem = GetOrAddParentMenuItem(entry.Metadata?.MenuID, entry.Metadata?.Header); - // replace potential dummy text with real name - menuItem.Header = ResourceHelper.GetString(entry.Metadata?.Header); - parentMenuItem.Items.Add(menuItem); - } - else - { - var command = entry.Value; - - var menuItem = new MenuItem { - Command = CommandWrapper.Unwrap(command), - Tag = entry.Metadata?.MenuID, - Header = ResourceHelper.GetString(entry.Metadata?.Header) - }; - - if (!string.IsNullOrEmpty(entry.Metadata?.MenuIcon)) - { - menuItem.Icon = new Image { - Width = 16, - Height = 16, - Source = Images.Load(command, entry.Metadata.MenuIcon) - }; - } - - menuItem.IsEnabled = entry.Metadata?.IsEnabled ?? false; - menuItem.InputGestureText = entry.Metadata?.InputGestureText; - - if (command is IProvideParameterBinding parameterBinding) - { - BindingOperations.SetBinding(menuItem, MenuItem.CommandParameterProperty, parameterBinding.ParameterBinding); - } - - parentMenuItem.Items.Add(menuItem); - } - } - } - } - - foreach (var item in parentMenuItems.Values.Where(item => item.Parent == null)) - { - mainMenu.Items.Add(item); - } - - MenuItem GetOrAddParentMenuItem(string menuId, string resourceKey) - { - if (!parentMenuItems.TryGetValue(menuId, out var parentMenuItem)) - { - var topLevelMenuItem = mainMenu.Items.OfType().FirstOrDefault(m => (string)m.Tag == menuId); - if (topLevelMenuItem == null) - { - parentMenuItem = new() { - Header = ResourceHelper.GetString(resourceKey), - Tag = menuId - }; - parentMenuItems.Add(menuId, parentMenuItem); - } - else - { - parentMenuItems.Add(menuId, topLevelMenuItem); - parentMenuItem = topLevelMenuItem; - } - } - return parentMenuItem; - } - } - - static void InitWindowMenu(MenuItem windowMenuItem, InputBindingCollection inputBindings, DockWorkspace dockWorkspace) - { - var defaultItems = windowMenuItem.Items.Cast().ToArray(); - - windowMenuItem.Items.Clear(); - - var toolItems = dockWorkspace.ToolPanes.Select(toolPane => CreateMenuItem(toolPane, inputBindings, dockWorkspace)).ToArray(); - var tabItems = dockWorkspace.TabPages.ObservableSelect(tabPage => CreateMenuItem(tabPage, dockWorkspace)); - - var allItems = new ObservableCompositeCollection(defaultItems, [new Separator()], toolItems, [new Separator()], tabItems); - - windowMenuItem.ItemsSource = allItems; - } - - static Control CreateMenuItem(TabPageModel pane, DockWorkspace dockWorkspace) - { - var header = new TextBlock { - MaxWidth = 200, - TextTrimming = TextTrimming.CharacterEllipsis - }; - - header.SetBinding(TextBlock.TextProperty, new Binding(nameof(pane.Title)) { - Source = pane - }); - - var menuItem = new MenuItem { - Command = new TabPageCommand(pane, dockWorkspace), - Header = header, - IsCheckable = true - }; - - menuItem.SetBinding(MenuItem.IsCheckedProperty, new Binding(nameof(dockWorkspace.ActiveTabPage)) { - Source = dockWorkspace, - ConverterParameter = pane, - Converter = BinaryOperationConverter.Equality, - Mode = BindingMode.OneWay - }); - - return menuItem; - } - - static Control CreateMenuItem(ToolPaneModel pane, InputBindingCollection inputBindings, DockWorkspace dockWorkspace) - { - var menuItem = new MenuItem { - Command = pane.AssociatedCommand ?? new ToolPaneCommand(pane.ContentId, dockWorkspace), - Header = pane.Title - }; - var shortcutKey = pane.ShortcutKey; - if (shortcutKey != null) - { - inputBindings.Add(new InputBinding(menuItem.Command, shortcutKey)); - menuItem.InputGestureText = shortcutKey.GetDisplayStringForCulture(CultureInfo.CurrentUICulture); - } - if (!string.IsNullOrEmpty(pane.Icon)) - { - menuItem.Icon = new Image { - Width = 16, - Height = 16, - Source = Images.Load(pane, pane.Icon) - }; - } - - return menuItem; - } - } -} diff --git a/ILSpy/Controls/MainToolBar.xaml b/ILSpy/Controls/MainToolBar.xaml deleted file mode 100644 index 2261e6e22..000000000 --- a/ILSpy/Controls/MainToolBar.xaml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Controls/MainToolBar.xaml.cs b/ILSpy/Controls/MainToolBar.xaml.cs deleted file mode 100644 index 1c27d76dc..000000000 --- a/ILSpy/Controls/MainToolBar.xaml.cs +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) 2024 Tom Englert for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.ComponentModel; -using System.Composition; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Threading; - -using ICSharpCode.ILSpy.Themes; -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Composition; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// Interaction logic for MainToolBar.xaml - /// - [Export] - [NonShared] - public partial class MainToolBar - { - public MainToolBar(IExportProvider exportProvider) - { - InitializeComponent(); - - this.Dispatcher.BeginInvoke(DispatcherPriority.Background, () => { - InitToolbar(ToolBar, exportProvider); - Window.GetWindow(this)!.KeyDown += MainWindow_KeyDown; - }); - } - - static void InitToolbar(ToolBar toolBar, IExportProvider exportProvider) - { - int navigationPos = 0; - int openPos = 1; - var toolbarCommandsByCategory = exportProvider - .GetExports("ToolbarCommand") - .OrderBy(c => c.Metadata?.ToolbarOrder) - .GroupBy(c => c.Metadata?.ToolbarCategory); - - foreach (var commandCategory in toolbarCommandsByCategory) - { - if (commandCategory.Key == nameof(Properties.Resources.Navigation)) - { - foreach (var command in commandCategory) - { - toolBar.Items.Insert(navigationPos++, CreateToolbarItem(command)); - openPos++; - } - } - else if (commandCategory.Key == nameof(Properties.Resources.Open)) - { - foreach (var command in commandCategory) - { - toolBar.Items.Insert(openPos++, CreateToolbarItem(command)); - } - } - else - { - toolBar.Items.Add(new Separator()); - foreach (var command in commandCategory) - { - toolBar.Items.Add(CreateToolbarItem(command)); - } - } - } - } - - static UIElement CreateToolbarItem(IExport commandExport) - { - var command = commandExport.Value; - - Button toolbarItem = new() { - Style = ThemeManager.Current.CreateToolBarButtonStyle(), - Command = CommandWrapper.Unwrap(command), - ToolTip = Properties.Resources.ResourceManager.GetString( - commandExport.Metadata?.ToolTip ?? string.Empty), - Tag = commandExport.Metadata?.Tag, - Content = new Image { - Width = 16, - Height = 16, - Source = Images.Load(command, commandExport.Metadata?.ToolbarIcon) - } - }; - - if (command is IProvideParameterBinding parameterBinding) - { - BindingOperations.SetBinding(toolbarItem, ButtonBase.CommandParameterProperty, - parameterBinding.ParameterBinding); - } - - if (command is IProvideParameterList parameterList) - { - toolbarItem.Margin = new Thickness(2, 0, 0, 0); - - var dropDownPanel = new StackPanel { Orientation = Orientation.Horizontal }; - - var dropDownToggle = new ToggleButton { - Style = ThemeManager.Current.CreateToolBarToggleButtonStyle(), - Content = "▾", - Padding = new Thickness(0), - MinWidth = 0, - Margin = new Thickness(0, 0, 2, 0) - }; - - var contextMenu = new ContextMenu { - PlacementTarget = dropDownPanel, - Tag = command - }; - - ContextMenuService.SetPlacement(toolbarItem, PlacementMode.Bottom); - toolbarItem.ContextMenu = contextMenu; - toolbarItem.ContextMenuOpening += (_, _) => - PrepareParameterList(contextMenu); - dropDownToggle.Checked += (_, _) => { - PrepareParameterList(contextMenu); - contextMenu.Placement = PlacementMode.Bottom; - contextMenu.SetCurrentValue(ContextMenu.IsOpenProperty, true); - }; - - BindingOperations.SetBinding(dropDownToggle, ToggleButton.IsCheckedProperty, - new Binding(nameof(contextMenu.IsOpen)) { Source = contextMenu }); - - BindingOperations.SetBinding(dropDownToggle, IsEnabledProperty, - new Binding(nameof(IsEnabled)) { Source = toolbarItem }); - - // When the toggle button is checked, clicking it to uncheck will dismiss the menu first - // which unchecks the toggle button via binding above and the click is used to open it again. - // This is a workaround to ignore the click to uncheck the already unchecked toggle button. - // We have to ensure the dismissing click is on the toggle button, otherwise the flag - // will not get cleared and menu will not open next time. - Mouse.AddPreviewMouseDownOutsideCapturedElementHandler(contextMenu, (_, e) => { - var point = e.GetPosition(dropDownToggle); - dropDownToggle.Tag = dropDownToggle.InputHitTest(point); - }); - dropDownToggle.PreviewMouseLeftButtonDown += (_, e) => { - e.Handled = dropDownToggle.Tag != null; - dropDownToggle.Tag = null; - }; - - dropDownPanel.Children.Add(toolbarItem); - dropDownPanel.Children.Add(dropDownToggle); - return dropDownPanel; - } - - return toolbarItem; - } - - static void PrepareParameterList(ContextMenu menu) - { - const int maximumParameterListCount = 20; - - var command = (ICommand)menu.Tag; - var parameterList = (IProvideParameterList)command; - - menu.Items.Clear(); - foreach (var parameter in parameterList.ParameterList) - { - MenuItem parameterItem = new MenuItem(); - parameterItem.Command = CommandWrapper.Unwrap(command); - parameterItem.CommandParameter = parameter; - parameterItem.CommandTarget = menu.PlacementTarget; - parameterItem.InputGestureText = " "; - - var headerPresenter = new ContentPresenter { RecognizesAccessKey = false }; - parameterItem.Header = headerPresenter; - - var header = parameterList.GetParameterText(parameter); - switch (header) - { - case SharpTreeNode node: - headerPresenter.Content = node.NavigationText; - if (node.Icon is ImageSource icon) - parameterItem.Icon = new Image { - Width = 16, - Height = 16, - Source = icon - }; - break; - - default: - headerPresenter.Content = header; - break; - } - - menu.Items.Add(parameterItem); - if (menu.Items.Count >= maximumParameterListCount) - break; - } - } - - void MainWindow_KeyDown(object sender, KeyEventArgs e) - { - if (e.Handled || e.KeyboardDevice.Modifiers != ModifierKeys.Alt || e.Key != Key.System) - return; - - switch (e.SystemKey) - { - case Key.A: - assemblyListComboBox.Focus(); - e.Handled = true; - break; - case Key.L: - languageComboBox.Focus(); - e.Handled = true; - break; - case Key.E: // Alt+V was already taken by _View menu - languageVersionComboBox.Focus(); - e.Handled = true; - break; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Controls/MarkupExtensions.cs b/ILSpy/Controls/MarkupExtensions.cs deleted file mode 100644 index c3383270c..000000000 --- a/ILSpy/Controls/MarkupExtensions.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows; -using System.Windows.Markup; -using System.Windows.Media; - -namespace ICSharpCode.ILSpy.Controls -{ - [MarkupExtensionReturnType(typeof(Color))] - class ControlColor : MarkupExtension - { - readonly float val; - - /// - /// Amount of highlight (0..1) - /// - public float Highlight { get; set; } - - /// - /// val: Color value in the range 105..255. - /// - public ControlColor(float val) - { - if (!(val >= 105 && val <= 255)) - throw new ArgumentOutOfRangeException(nameof(val)); - this.val = val; - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - if (val > 227) - { - return Interpolate(227, SystemColors.ControlLightColor, 255, SystemColors.ControlLightLightColor); - } - else if (val > 160) - { - return Interpolate(160, SystemColors.ControlDarkColor, 227, SystemColors.ControlLightColor); - } - else - { - return Interpolate(105, SystemColors.ControlDarkDarkColor, 160, SystemColors.ControlDarkColor); - } - } - - Color Interpolate(float v1, Color c1, float v2, Color c2) - { - float v = (val - v1) / (v2 - v1); - Color c = c1 * (1 - v) + c2 * v; - return c * (1 - Highlight) + SystemColors.HighlightColor * Highlight; - } - } -} \ No newline at end of file diff --git a/ILSpy/Controls/ResourceObjectTable.xaml b/ILSpy/Controls/ResourceObjectTable.xaml deleted file mode 100644 index 57b462810..000000000 --- a/ILSpy/Controls/ResourceObjectTable.xaml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Controls/ResourceObjectTable.xaml.cs b/ILSpy/Controls/ResourceObjectTable.xaml.cs deleted file mode 100644 index 73f4ca1bf..000000000 --- a/ILSpy/Controls/ResourceObjectTable.xaml.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Input; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// Interaction logic for ResourceObjectTable.xaml - /// - public partial class ResourceObjectTable : UserControl - { - ICollectionView filteredView; - string filter; - - public ResourceObjectTable(IEnumerable resources, FrameworkElement container) - { - InitializeComponent(); - // set size to fit decompiler window - container.SizeChanged += OnParentSizeChanged; - if (!double.IsNaN(container.ActualWidth)) - Width = Math.Max(container.ActualWidth - 45, 0); - MaxHeight = container.ActualHeight; - - filteredView = CollectionViewSource.GetDefaultView(resources); - filteredView.Filter = OnResourceFilter; - resourceListView.ItemsSource = filteredView; - } - - private bool OnResourceFilter(object obj) - { - if (string.IsNullOrEmpty(filter)) - return true; - - if (obj is TreeNodes.ResourcesFileTreeNode.SerializedObjectRepresentation item) - return item.Key?.Contains(filter, StringComparison.OrdinalIgnoreCase) == true || - item.Value?.Contains(filter, StringComparison.OrdinalIgnoreCase) == true; - - return false; // make it obvious search is not working - } - - private void OnParentSizeChanged(object sender, SizeChangedEventArgs e) - { - if (e.WidthChanged && !double.IsNaN(e.NewSize.Width)) - Width = Math.Max(e.NewSize.Width - 45, 0); - if (e.HeightChanged) - MaxHeight = e.NewSize.Height; - } - - private void OnFilterTextChanged(object sender, TextChangedEventArgs e) - { - filter = resourceFilterBox.Text; - filteredView?.Refresh(); - } - - void ExecuteCopy(object sender, ExecutedRoutedEventArgs args) - { - StringBuilder sb = new StringBuilder(); - foreach (var item in resourceListView.SelectedItems) - { - if (item is TreeNodes.ResourcesFileTreeNode.SerializedObjectRepresentation so) - { - switch (args.Parameter) - { - case "Key": - sb.AppendLine(so.Key); - continue; - - case "Value": - sb.AppendLine(so.Value); - continue; - - case "Type": - sb.AppendLine(so.Type); - continue; - - default: - sb.AppendLine($"{so.Key}\t{so.Value}\t{so.Type}"); - continue; - } - } - sb.AppendLine(item.ToString()); - } - Clipboard.SetText(sb.ToString()); - } - - void CanExecuteCopy(object sender, CanExecuteRoutedEventArgs args) - { - args.CanExecute = true; - } - } -} \ No newline at end of file diff --git a/ILSpy/Controls/ResourceStringTable.xaml b/ILSpy/Controls/ResourceStringTable.xaml deleted file mode 100644 index 1000eb640..000000000 --- a/ILSpy/Controls/ResourceStringTable.xaml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Controls/ResourceStringTable.xaml.cs b/ILSpy/Controls/ResourceStringTable.xaml.cs deleted file mode 100644 index 5190ba414..000000000 --- a/ILSpy/Controls/ResourceStringTable.xaml.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Input; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// Interaction logic for ResourceStringTable.xaml - /// - public partial class ResourceStringTable : UserControl - { - ICollectionView filteredView; - string filter; - - public ResourceStringTable(IEnumerable strings, FrameworkElement container) - { - InitializeComponent(); - // set size to fit decompiler window - container.SizeChanged += OnParentSizeChanged; - if (!double.IsNaN(container.ActualWidth)) - Width = Math.Max(container.ActualWidth - 45, 0); - MaxHeight = container.ActualHeight; - - filteredView = CollectionViewSource.GetDefaultView(strings); - filteredView.Filter = OnResourceFilter; - resourceListView.ItemsSource = filteredView; - } - - private bool OnResourceFilter(object obj) - { - if (string.IsNullOrEmpty(filter)) - return true; - - if (obj is KeyValuePair item) - return item.Key?.Contains(filter, StringComparison.OrdinalIgnoreCase) == true || - item.Value?.Contains(filter, StringComparison.OrdinalIgnoreCase) == true; - - return false; // make it obvious search is not working - } - - private void OnParentSizeChanged(object sender, SizeChangedEventArgs e) - { - if (e.WidthChanged && !double.IsNaN(e.NewSize.Width)) - Width = Math.Max(e.NewSize.Width - 45, 0); - if (e.HeightChanged) - MaxHeight = e.NewSize.Height; - } - - private void OnFilterTextChanged(object sender, TextChangedEventArgs e) - { - filter = resourceFilterBox.Text; - filteredView?.Refresh(); - } - - void ExecuteCopy(object sender, ExecutedRoutedEventArgs args) - { - StringBuilder sb = new StringBuilder(); - foreach (var item in resourceListView.SelectedItems) - { - if (item is KeyValuePair pair) - { - switch (args.Parameter) - { - case "Key": - sb.AppendLine(pair.Key); - continue; - - case "Value": - sb.AppendLine(pair.Value); - continue; - - default: - sb.AppendLine($"{pair.Key}\t{pair.Value}"); - continue; - } - } - sb.AppendLine(item.ToString()); - } - Clipboard.SetText(sb.ToString()); - } - - void CanExecuteCopy(object sender, CanExecuteRoutedEventArgs args) - { - args.CanExecute = true; - } - } -} \ No newline at end of file diff --git a/ILSpy/Controls/SearchBox.cs b/ILSpy/Controls/SearchBox.cs deleted file mode 100644 index 2b9d39f6f..000000000 --- a/ILSpy/Controls/SearchBox.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Threading; - -namespace ICSharpCode.ILSpy.Controls -{ - public class SearchBox : TextBox - { - static SearchBox() - { - DefaultStyleKeyProperty.OverrideMetadata( - typeof(SearchBox), - new FrameworkPropertyMetadata(typeof(SearchBox))); - } - - #region Dependency properties - - public static DependencyProperty WatermarkTextProperty = DependencyProperty.Register("WatermarkText", typeof(string), typeof(SearchBox)); - - public static DependencyProperty WatermarkColorProperty = DependencyProperty.Register("WatermarkColor", typeof(Brush), typeof(SearchBox)); - - public static DependencyProperty HasTextProperty = DependencyProperty.Register("HasText", typeof(bool), typeof(SearchBox)); - - public static readonly DependencyProperty UpdateDelayProperty = - DependencyProperty.Register("UpdateDelay", typeof(TimeSpan), typeof(SearchBox), - new FrameworkPropertyMetadata(TimeSpan.FromMilliseconds(200))); - - #endregion - - #region Public Properties - - public string WatermarkText { - get { return (string)GetValue(WatermarkTextProperty); } - set { SetValue(WatermarkTextProperty, value); } - } - - public Brush WatermarkColor { - get { return (Brush)GetValue(WatermarkColorProperty); } - set { SetValue(WatermarkColorProperty, value); } - } - - public bool HasText { - get { return (bool)GetValue(HasTextProperty); } - private set { SetValue(HasTextProperty, value); } - } - - public TimeSpan UpdateDelay { - get { return (TimeSpan)GetValue(UpdateDelayProperty); } - set { SetValue(UpdateDelayProperty, value); } - } - - #endregion - - #region Handlers - - private void IconBorder_MouseLeftButtonUp(object obj, MouseButtonEventArgs e) - { - if (this.HasText) - this.Text = string.Empty; - } - - #endregion - - #region Overrides - - DispatcherTimer timer; - - protected override void OnTextChanged(TextChangedEventArgs e) - { - base.OnTextChanged(e); - - HasText = this.Text.Length > 0; - if (timer == null) - { - timer = new DispatcherTimer(); - timer.Tick += timer_Tick; - } - timer.Stop(); - timer.Interval = this.UpdateDelay; - timer.Start(); - - UpdateWatermarkLabel(); - } - - private void UpdateWatermarkLabel() - { - Label wl = (Label)GetTemplateChild("WatermarkLabel"); - if (wl != null) - wl.Visibility = HasText ? Visibility.Hidden : Visibility.Visible; - } - - void timer_Tick(object sender, EventArgs e) - { - timer.Stop(); - timer = null; - var textBinding = GetBindingExpression(TextProperty); - if (textBinding != null) - { - textBinding.UpdateSource(); - } - } - - protected override void OnLostFocus(RoutedEventArgs e) - { - UpdateWatermarkLabel(); - base.OnLostFocus(e); - } - - protected override void OnGotFocus(RoutedEventArgs e) - { - UpdateWatermarkLabel(); - base.OnGotFocus(e); - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - Border iconBorder = GetTemplateChild("PART_IconBorder") as Border; - if (iconBorder != null) - { - iconBorder.MouseLeftButtonUp += IconBorder_MouseLeftButtonUp; - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - if (e.Key == Key.Escape && this.Text.Length > 0) - { - this.Text = string.Empty; - e.Handled = true; - } - else - { - base.OnKeyDown(e); - } - } - #endregion - } -} diff --git a/ILSpy/Controls/SearchBoxStyle.xaml b/ILSpy/Controls/SearchBoxStyle.xaml deleted file mode 100644 index d809e7fb2..000000000 --- a/ILSpy/Controls/SearchBoxStyle.xaml +++ /dev/null @@ -1,65 +0,0 @@ - - - - \ No newline at end of file diff --git a/ILSpy/Controls/SortableGridViewColumn.cs b/ILSpy/Controls/SortableGridViewColumn.cs deleted file mode 100644 index a70ad9049..000000000 --- a/ILSpy/Controls/SortableGridViewColumn.cs +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.ComponentModel; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; - -namespace ICSharpCode.ILSpy.Controls -{ - /// - /// Allows to automatically sort a grid view. - /// - public class SortableGridViewColumn : GridViewColumn - { - // This class was copied from ICSharpCode.Core.Presentation. - - static readonly ComponentResourceKey headerTemplateKey = new ComponentResourceKey(typeof(SortableGridViewColumn), "ColumnHeaderTemplate"); - - public SortableGridViewColumn() - { - this.SetValueToExtension(HeaderTemplateProperty, new DynamicResourceExtension(headerTemplateKey)); - } - - string sortBy; - - public string SortBy { - get { return sortBy; } - set { - if (sortBy != value) - { - sortBy = value; - OnPropertyChanged(new PropertyChangedEventArgs("SortBy")); - } - } - } - - #region SortDirection property - public static readonly DependencyProperty SortDirectionProperty = - DependencyProperty.RegisterAttached("SortDirection", typeof(ColumnSortDirection), typeof(SortableGridViewColumn), - new FrameworkPropertyMetadata(ColumnSortDirection.None, OnSortDirectionChanged)); - - public ColumnSortDirection SortDirection { - get { return (ColumnSortDirection)GetValue(SortDirectionProperty); } - set { SetValue(SortDirectionProperty, value); } - } - - public static ColumnSortDirection GetSortDirection(ListView listView) - { - return (ColumnSortDirection)listView.GetValue(SortDirectionProperty); - } - - public static void SetSortDirection(ListView listView, ColumnSortDirection value) - { - listView.SetValue(SortDirectionProperty, value); - } - - static void OnSortDirectionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) - { - ListView grid = sender as ListView; - if (grid != null) - { - SortableGridViewColumn col = GetCurrentSortColumn(grid); - if (col != null) - col.SortDirection = (ColumnSortDirection)args.NewValue; - Sort(grid); - } - } - #endregion - - #region CurrentSortColumn property - public static readonly DependencyProperty CurrentSortColumnProperty = - DependencyProperty.RegisterAttached("CurrentSortColumn", typeof(SortableGridViewColumn), typeof(SortableGridViewColumn), - new FrameworkPropertyMetadata(OnCurrentSortColumnChanged)); - - public static SortableGridViewColumn GetCurrentSortColumn(ListView listView) - { - return (SortableGridViewColumn)listView.GetValue(CurrentSortColumnProperty); - } - - public static void SetCurrentSortColumn(ListView listView, SortableGridViewColumn value) - { - listView.SetValue(CurrentSortColumnProperty, value); - } - - static void OnCurrentSortColumnChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) - { - ListView grid = sender as ListView; - if (grid != null) - { - SortableGridViewColumn oldColumn = (SortableGridViewColumn)args.OldValue; - if (oldColumn != null) - oldColumn.SortDirection = ColumnSortDirection.None; - SortableGridViewColumn newColumn = (SortableGridViewColumn)args.NewValue; - if (newColumn != null) - { - newColumn.SortDirection = GetSortDirection(grid); - } - Sort(grid); - } - } - #endregion - - #region SortMode property - public static readonly DependencyProperty SortModeProperty = - DependencyProperty.RegisterAttached("SortMode", typeof(ListViewSortMode), typeof(SortableGridViewColumn), - new FrameworkPropertyMetadata(ListViewSortMode.None, OnSortModeChanged)); - - public static ListViewSortMode GetSortMode(ListView listView) - { - return (ListViewSortMode)listView.GetValue(SortModeProperty); - } - - public static void SetSortMode(ListView listView, ListViewSortMode value) - { - listView.SetValue(SortModeProperty, value); - } - - static void OnSortModeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) - { - ListView grid = sender as ListView; - if (grid != null) - { - if ((ListViewSortMode)args.NewValue != ListViewSortMode.None) - grid.AddHandler(GridViewColumnHeader.ClickEvent, new RoutedEventHandler(GridViewColumnHeaderClickHandler)); - else - grid.RemoveHandler(GridViewColumnHeader.ClickEvent, new RoutedEventHandler(GridViewColumnHeaderClickHandler)); - } - } - - static void GridViewColumnHeaderClickHandler(object sender, RoutedEventArgs e) - { - ListView grid = sender as ListView; - GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader; - if (grid != null && headerClicked != null && headerClicked.Role != GridViewColumnHeaderRole.Padding) - { - if (headerClicked.Column == GetCurrentSortColumn(grid)) - { - switch (GetSortDirection(grid)) - { - case ColumnSortDirection.None: - SetSortDirection(grid, ColumnSortDirection.Ascending); - break; - case ColumnSortDirection.Ascending: - SetSortDirection(grid, ColumnSortDirection.Descending); - break; - case ColumnSortDirection.Descending: - SetSortDirection(grid, ColumnSortDirection.None); - break; - } - } - else - { - SetSortDirection(grid, ColumnSortDirection.Ascending); - SetCurrentSortColumn(grid, headerClicked.Column as SortableGridViewColumn); - } - } - } - #endregion - - static void Sort(ListView grid) - { - ColumnSortDirection currentDirection = GetSortDirection(grid); - SortableGridViewColumn column = GetCurrentSortColumn(grid); - ICollectionView dataView = CollectionViewSource.GetDefaultView(grid.ItemsSource); - - if (dataView == null) - return; - - if (column != null && GetSortMode(grid) == ListViewSortMode.Automatic && currentDirection != ColumnSortDirection.None) - { - string sortBy = column.SortBy; - if (sortBy == null) - { - Binding binding = column.DisplayMemberBinding as Binding; - if (binding != null && binding.Path != null) - { - sortBy = binding.Path.Path; - } - } - - dataView.SortDescriptions.Clear(); - if (sortBy != null) - { - ListSortDirection direction; - if (currentDirection == ColumnSortDirection.Descending) - direction = ListSortDirection.Descending; - else - direction = ListSortDirection.Ascending; - dataView.SortDescriptions.Add(new SortDescription(sortBy, direction)); - } - } - else - { - dataView.SortDescriptions.Clear(); - } - - dataView.Refresh(); - } - } - - public enum ColumnSortDirection - { - None, - Ascending, - Descending - } - - public enum ListViewSortMode - { - /// - /// Disable automatic sorting when sortable columns are clicked. - /// - None, - /// - /// Fully automatic sorting. - /// - Automatic, - /// - /// Automatically update SortDirection and CurrentSortColumn properties, - /// but do not actually sort the data. - /// - HalfAutomatic - } - - sealed class ColumnSortDirectionToVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - return Equals(value, parameter) ? Visibility.Visible : Visibility.Collapsed; - } - - public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - throw new NotSupportedException(); - } - } -} diff --git a/ILSpy/Controls/TreeView/EditTextBox.cs b/ILSpy/Controls/TreeView/EditTextBox.cs deleted file mode 100644 index 467dad618..000000000 --- a/ILSpy/Controls/TreeView/EditTextBox.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - class EditTextBox : TextBox - { - static EditTextBox() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(EditTextBox), - new FrameworkPropertyMetadata(typeof(EditTextBox))); - } - - public EditTextBox() - { - Loaded += delegate { Init(); }; - } - - public SharpTreeViewItem Item { get; set; } - - public SharpTreeNode Node { - get { return Item.Node; } - } - - void Init() - { - Text = Node.LoadEditText(); - Focus(); - SelectAll(); - } - - protected override void OnKeyDown(KeyEventArgs e) - { - if (e.Key == Key.Enter) - { - Commit(); - } - else if (e.Key == Key.Escape) - { - Node.IsEditing = false; - } - } - - protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e) - { - if (Node.IsEditing) - { - Commit(); - } - } - - bool committing; - - void Commit() - { - if (!committing) - { - committing = true; - - Node.IsEditing = false; - if (!Node.SaveEditText(Text)) - { - Item.Focus(); - } - Node.RaisePropertyChanged(nameof(Text)); - - //if (Node.SaveEditText(Text)) { - // Node.IsEditing = false; - // Node.RaisePropertyChanged("Text"); - //} - //else { - // Init(); - //} - - committing = false; - } - } - } -} diff --git a/ILSpy/Controls/TreeView/ExtensionMethods.cs b/ILSpy/Controls/TreeView/ExtensionMethods.cs deleted file mode 100644 index f7fd2b0d0..000000000 --- a/ILSpy/Controls/TreeView/ExtensionMethods.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Windows; -using System.Windows.Media; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - static class ExtensionMethods - { - public static T FindAncestor(this DependencyObject d) where T : class - { - return AncestorsAndSelf(d).OfType().FirstOrDefault(); - } - - public static IEnumerable AncestorsAndSelf(this DependencyObject d) - { - while (d != null) - { - yield return d; - d = VisualTreeHelper.GetParent(d); - } - } - - public static void AddOnce(this IList list, object item) - { - if (!list.Contains(item)) - { - list.Add(item); - } - } - } -} diff --git a/ILSpy/Controls/TreeView/GeneralAdorner.cs b/ILSpy/Controls/TreeView/GeneralAdorner.cs deleted file mode 100644 index 51985e301..000000000 --- a/ILSpy/Controls/TreeView/GeneralAdorner.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Windows; -using System.Windows.Documents; -using System.Windows.Media; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class GeneralAdorner : Adorner - { - public GeneralAdorner(UIElement target) - : base(target) - { - } - - FrameworkElement child; - - public FrameworkElement Child { - get { - return child; - } - set { - if (child != value) - { - RemoveVisualChild(child); - RemoveLogicalChild(child); - child = value; - AddLogicalChild(value); - AddVisualChild(value); - InvalidateMeasure(); - } - } - } - - protected override int VisualChildrenCount { - get { return child == null ? 0 : 1; } - } - - protected override Visual GetVisualChild(int index) - { - return child; - } - - protected override Size MeasureOverride(Size constraint) - { - if (child != null) - { - child.Measure(constraint); - return child.DesiredSize; - } - return new Size(); - } - - protected override Size ArrangeOverride(Size finalSize) - { - if (child != null) - { - child.Arrange(new Rect(finalSize)); - return finalSize; - } - return new Size(); - } - } -} diff --git a/ILSpy/Controls/TreeView/InsertMarker.cs b/ILSpy/Controls/TreeView/InsertMarker.cs deleted file mode 100644 index 56e432e95..000000000 --- a/ILSpy/Controls/TreeView/InsertMarker.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Windows; -using System.Windows.Controls; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class InsertMarker : Control - { - static InsertMarker() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(InsertMarker), - new FrameworkPropertyMetadata(typeof(InsertMarker))); - } - } -} diff --git a/ILSpy/Controls/TreeView/LinesRenderer.cs b/ILSpy/Controls/TreeView/LinesRenderer.cs deleted file mode 100644 index 3025a86a8..000000000 --- a/ILSpy/Controls/TreeView/LinesRenderer.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Diagnostics; -using System.Windows; -using System.Windows.Media; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - class LinesRenderer : FrameworkElement - { - static LinesRenderer() - { - pen = new Pen(Brushes.LightGray, 1); - pen.Freeze(); - } - - static Pen pen; - - SharpTreeNodeView NodeView { - get { return TemplatedParent as SharpTreeNodeView; } - } - - protected override void OnRender(DrawingContext dc) - { - if (NodeView.Node == null) - { - // This seems to happen sometimes with DataContext==DisconnectedItem, - // though I'm not sure why WPF would call OnRender() on a disconnected node - Debug.WriteLine($"LinesRenderer.OnRender() called with DataContext={NodeView.DataContext}"); - return; - } - var indent = NodeView.CalculateIndent(); - var p = new Point(indent + 4.5, 0); - - if (!NodeView.Node.IsRoot || NodeView.ParentTreeView.ShowRootExpander) - { - dc.DrawLine(pen, new Point(p.X, ActualHeight / 2), new Point(p.X + 10, ActualHeight / 2)); - } - - if (NodeView.Node.IsRoot) - return; - - if (NodeView.Node.IsLast) - { - dc.DrawLine(pen, p, new Point(p.X, ActualHeight / 2)); - } - else - { - dc.DrawLine(pen, p, new Point(p.X, ActualHeight)); - } - - var current = NodeView.Node; - while (true) - { - p.X -= 19; - current = current.Parent; - if (p.X < 0) - break; - if (!current.IsLast) - { - dc.DrawLine(pen, p, new Point(p.X, ActualHeight)); - } - } - } - } -} diff --git a/ILSpy/Controls/TreeView/SharpGridView.cs b/ILSpy/Controls/TreeView/SharpGridView.cs deleted file mode 100644 index 7616fff01..000000000 --- a/ILSpy/Controls/TreeView/SharpGridView.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Windows; -using System.Windows.Controls; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class SharpGridView : GridView - { - static SharpGridView() - { - ItemContainerStyleKey = - new ComponentResourceKey(typeof(SharpTreeView), "GridViewItemContainerStyleKey"); - } - - public static ResourceKey ItemContainerStyleKey { get; private set; } - - protected override object ItemContainerDefaultStyleKey { - get { - return ItemContainerStyleKey; - } - } - } -} diff --git a/ILSpy/Controls/TreeView/SharpTreeNodeView.cs b/ILSpy/Controls/TreeView/SharpTreeNodeView.cs deleted file mode 100644 index bc90b1008..000000000 --- a/ILSpy/Controls/TreeView/SharpTreeNodeView.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.ComponentModel; -using System.Diagnostics; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Media; - -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class SharpTreeNodeView : Control - { - static SharpTreeNodeView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(SharpTreeNodeView), - new FrameworkPropertyMetadata(typeof(SharpTreeNodeView))); - } - - public static readonly DependencyProperty TextBackgroundProperty = - DependencyProperty.Register("TextBackground", typeof(Brush), typeof(SharpTreeNodeView)); - - public Brush TextBackground { - get { return (Brush)GetValue(TextBackgroundProperty); } - set { SetValue(TextBackgroundProperty, value); } - } - - public SharpTreeNode Node { - get { return DataContext as SharpTreeNode; } - } - - public SharpTreeViewItem ParentItem { get; private set; } - - public static readonly DependencyProperty CellEditorProperty = - DependencyProperty.Register("CellEditor", typeof(Control), typeof(SharpTreeNodeView), - new FrameworkPropertyMetadata()); - - public Control CellEditor { - get { return (Control)GetValue(CellEditorProperty); } - set { SetValue(CellEditorProperty, value); } - } - - public SharpTreeView ParentTreeView { - get { return ParentItem.ParentTreeView; } - } - - internal LinesRenderer LinesRenderer { get; private set; } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - LinesRenderer = Template.FindName("linesRenderer", this) as LinesRenderer; - UpdateTemplate(); - } - - protected override void OnVisualParentChanged(DependencyObject oldParent) - { - base.OnVisualParentChanged(oldParent); - ParentItem = this.FindAncestor(); - ParentItem.NodeView = this; - } - - protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) - { - base.OnPropertyChanged(e); - if (e.Property == DataContextProperty) - { - UpdateDataContext(e.OldValue as SharpTreeNode, e.NewValue as SharpTreeNode); - } - } - - void UpdateDataContext(SharpTreeNode oldNode, SharpTreeNode newNode) - { - if (newNode != null) - { - newNode.PropertyChanged += Node_PropertyChanged; - if (Template != null) - { - UpdateTemplate(); - } - } - if (oldNode != null) - { - oldNode.PropertyChanged -= Node_PropertyChanged; - } - } - - void Node_PropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == "IsEditing") - { - OnIsEditingChanged(); - } - else if (e.PropertyName == "IsLast") - { - if (ParentTreeView.ShowLines) - { - foreach (var child in Node.VisibleDescendantsAndSelf()) - { - var container = ParentTreeView.ItemContainerGenerator.ContainerFromItem(child) as SharpTreeViewItem; - if (container != null && container.NodeView != null) - { - container.NodeView.LinesRenderer.InvalidateVisual(); - } - } - } - } - else if (e.PropertyName == "IsExpanded") - { - if (Node.IsExpanded) - ParentTreeView.HandleExpanding(Node); - } - } - - void OnIsEditingChanged() - { - var textEditorContainer = Template.FindName("textEditorContainer", this) as Border; - if (Node.IsEditing) - { - if (CellEditor == null) - textEditorContainer.Child = new EditTextBox() { Item = ParentItem }; - else - textEditorContainer.Child = CellEditor; - } - else - { - textEditorContainer.Child = null; - } - } - - void UpdateTemplate() - { - var spacer = Template.FindName("spacer", this) as FrameworkElement; - spacer.Width = CalculateIndent(); - - var expander = Template.FindName("expander", this) as ToggleButton; - if (ParentTreeView.Root == Node && !ParentTreeView.ShowRootExpander) - { - expander.Visibility = Visibility.Collapsed; - } - else - { - expander.ClearValue(VisibilityProperty); - } - } - - internal double CalculateIndent() - { - var result = 19 * Node.Level; - if (ParentTreeView.ShowRoot) - { - if (!ParentTreeView.ShowRootExpander) - { - if (ParentTreeView.Root != Node) - { - result -= 15; - } - } - } - else - { - result -= 19; - } - if (result < 0) - { - Debug.WriteLine("Negative indent level detected for node " + Node); - return 0; - } - return result; - } - } -} diff --git a/ILSpy/Controls/TreeView/SharpTreeView.cs b/ILSpy/Controls/TreeView/SharpTreeView.cs deleted file mode 100644 index a8842671a..000000000 --- a/ILSpy/Controls/TreeView/SharpTreeView.cs +++ /dev/null @@ -1,851 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Diagnostics; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Threading; - -using ICSharpCode.ILSpyX.TreeView; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class SharpTreeView : ListView - { - static SharpTreeView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(SharpTreeView), - new FrameworkPropertyMetadata(typeof(SharpTreeView))); - - SelectionModeProperty.OverrideMetadata(typeof(SharpTreeView), - new FrameworkPropertyMetadata(SelectionMode.Extended)); - - AlternationCountProperty.OverrideMetadata(typeof(SharpTreeView), - new FrameworkPropertyMetadata(2)); - - DefaultItemContainerStyleKey = - new ComponentResourceKey(typeof(SharpTreeView), "DefaultItemContainerStyleKey"); - - VirtualizingStackPanel.VirtualizationModeProperty.OverrideMetadata(typeof(SharpTreeView), - new FrameworkPropertyMetadata(VirtualizationMode.Recycling)); - - RegisterCommands(); - } - - public static ResourceKey DefaultItemContainerStyleKey { get; } - - public SharpTreeView() - { - SetResourceReference(ItemContainerStyleProperty, DefaultItemContainerStyleKey); - } - - public static readonly DependencyProperty RootProperty = - DependencyProperty.Register(nameof(Root), typeof(SharpTreeNode), typeof(SharpTreeView)); - - public SharpTreeNode Root { - get { return (SharpTreeNode)GetValue(RootProperty); } - set { SetValue(RootProperty, value); } - } - - public static readonly DependencyProperty ShowRootProperty = - DependencyProperty.Register(nameof(ShowRoot), typeof(bool), typeof(SharpTreeView), - new FrameworkPropertyMetadata(true)); - - public bool ShowRoot { - get { return (bool)GetValue(ShowRootProperty); } - set { SetValue(ShowRootProperty, value); } - } - - public static readonly DependencyProperty ShowRootExpanderProperty = - DependencyProperty.Register(nameof(ShowRootExpander), typeof(bool), typeof(SharpTreeView), - new FrameworkPropertyMetadata(false)); - - public bool ShowRootExpander { - get { return (bool)GetValue(ShowRootExpanderProperty); } - set { SetValue(ShowRootExpanderProperty, value); } - } - - public static readonly DependencyProperty AllowDropOrderProperty = - DependencyProperty.Register(nameof(AllowDropOrder), typeof(bool), typeof(SharpTreeView)); - - public bool AllowDropOrder { - get { return (bool)GetValue(AllowDropOrderProperty); } - set { SetValue(AllowDropOrderProperty, value); } - } - - public static readonly DependencyProperty ShowLinesProperty = - DependencyProperty.Register(nameof(ShowLines), typeof(bool), typeof(SharpTreeView), - new FrameworkPropertyMetadata(true)); - - public bool ShowLines { - get { return (bool)GetValue(ShowLinesProperty); } - set { SetValue(ShowLinesProperty, value); } - } - - public static bool GetShowAlternation(DependencyObject obj) - { - return (bool)obj.GetValue(ShowAlternationProperty); - } - - public static void SetShowAlternation(DependencyObject obj, bool value) - { - obj.SetValue(ShowAlternationProperty, value); - } - - public static readonly DependencyProperty ShowAlternationProperty = - DependencyProperty.RegisterAttached("ShowAlternation", typeof(bool), typeof(SharpTreeView), - new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits)); - - protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) - { - base.OnPropertyChanged(e); - if (e.Property == RootProperty || - e.Property == ShowRootProperty || - e.Property == ShowRootExpanderProperty) - { - Reload(); - } - } - - TreeFlattener flattener; - bool updatesLocked; - - public IDisposable LockUpdates() - { - return new UpdateLock(this); - } - - class UpdateLock : IDisposable - { - SharpTreeView instance; - - public UpdateLock(SharpTreeView instance) - { - this.instance = instance; - this.instance.updatesLocked = true; - } - - public void Dispose() - { - this.instance.updatesLocked = false; - } - } - - void Reload() - { - if (flattener != null) - { - flattener.Stop(); - flattener.CollectionChanged -= flattener_CollectionChanged; - } - if (Root != null) - { - if (!(ShowRoot && ShowRootExpander)) - { - Root.IsExpanded = true; - } - flattener = new TreeFlattener(Root, ShowRoot); - flattener.CollectionChanged += flattener_CollectionChanged; - this.ItemsSource = flattener; - } - } - - void flattener_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - // Deselect nodes that are being hidden, if any remain in the tree - if (e.Action == NotifyCollectionChangedAction.Remove && Items.Count > 0) - { - List selectedOldItems = null; - foreach (SharpTreeNode node in e.OldItems) - { - if (node.IsSelected) - { - if (selectedOldItems == null) - selectedOldItems = new List(); - selectedOldItems.Add(node); - } - } - if (!updatesLocked && selectedOldItems != null) - { - var list = SelectedItems.Cast().Except(selectedOldItems).ToList(); - UpdateFocusedNode(list, Math.Max(0, e.OldStartingIndex - 1)); - } - } - } - - void UpdateFocusedNode(List newSelection, int topSelectedIndex) - { - if (updatesLocked) - return; - SetSelectedItems(newSelection ?? Enumerable.Empty()); - if (SelectedItem == null && this.IsKeyboardFocusWithin) - { - // if we removed all selected nodes, then move the focus to the node - // preceding the first of the old selected nodes - SelectedIndex = topSelectedIndex; - if (SelectedItem != null) - FocusNode((SharpTreeNode)SelectedItem); - } - } - - protected override DependencyObject GetContainerForItemOverride() - { - return new SharpTreeViewItem(); - } - - protected override bool IsItemItsOwnContainerOverride(object item) - { - return item is SharpTreeViewItem; - } - - protected override void PrepareContainerForItemOverride(DependencyObject element, object item) - { - base.PrepareContainerForItemOverride(element, item); - SharpTreeViewItem container = element as SharpTreeViewItem; - container.ParentTreeView = this; - // Make sure that the line renderer takes into account the new bound data - if (container.NodeView != null) - { - container.NodeView.LinesRenderer.InvalidateVisual(); - } - } - - bool doNotScrollOnExpanding; - - /// - /// Handles the node expanding event in the tree view. - /// This method gets called only if the node is in the visible region (a SharpTreeNodeView exists). - /// - internal void HandleExpanding(SharpTreeNode node) - { - if (doNotScrollOnExpanding) - return; - SharpTreeNode lastVisibleChild = node; - while (true) - { - SharpTreeNode tmp = lastVisibleChild.Children.LastOrDefault(c => c.IsVisible); - if (tmp != null) - { - lastVisibleChild = tmp; - } - else - { - break; - } - } - if (lastVisibleChild != node) - { - // Make the the expanded children are visible; but don't scroll down - // to much (keep node itself visible) - base.ScrollIntoView(lastVisibleChild); - // For some reason, this only works properly when delaying it... - Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action( - delegate { - base.ScrollIntoView(node); - })); - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - SharpTreeViewItem container = e.OriginalSource as SharpTreeViewItem; - switch (e.Key) - { - case Key.Left: - if (container != null && ItemsControl.ItemsControlFromItemContainer(container) == this) - { - if (container.Node.IsExpanded) - { - container.Node.IsExpanded = false; - } - else if (container.Node.Parent != null) - { - this.FocusNode(container.Node.Parent); - } - e.Handled = true; - } - break; - case Key.Right: - if (container != null && ItemsControl.ItemsControlFromItemContainer(container) == this) - { - if (!container.Node.IsExpanded && container.Node.ShowExpander) - { - container.Node.IsExpanded = true; - } - else if (container.Node.Children.Count > 0) - { - // jump to first child: - container.MoveFocus(new TraversalRequest(FocusNavigationDirection.Down)); - } - e.Handled = true; - } - break; - case Key.Return: - if (container != null && Keyboard.Modifiers == ModifierKeys.None && this.SelectedItems.Count == 1 && this.SelectedItem == container.Node) - { - e.Handled = true; - container.Node.ActivateItem(new WpfWindowsRoutedEventArgs(e)); - } - break; - case Key.Space: - if (container != null && Keyboard.Modifiers == ModifierKeys.None && this.SelectedItems.Count == 1 && this.SelectedItem == container.Node) - { - e.Handled = true; - if (container.Node.IsCheckable) - { - if (container.Node.IsChecked == null) // If partially selected, we want to select everything - container.Node.IsChecked = true; - else - container.Node.IsChecked = !container.Node.IsChecked; - } - else - { - container.Node.ActivateItem(new WpfWindowsRoutedEventArgs(e)); - } - } - break; - case Key.Add: - if (container != null && ItemsControl.ItemsControlFromItemContainer(container) == this) - { - container.Node.IsExpanded = true; - e.Handled = true; - } - break; - case Key.Subtract: - if (container != null && ItemsControl.ItemsControlFromItemContainer(container) == this) - { - container.Node.IsExpanded = false; - e.Handled = true; - } - break; - case Key.Multiply: - if (container != null && ItemsControl.ItemsControlFromItemContainer(container) == this) - { - container.Node.IsExpanded = true; - ExpandRecursively(container.Node); - e.Handled = true; - } - break; - case Key.Back: - if (IsTextSearchEnabled) - { - var instance = SharpTreeViewTextSearch.GetInstance(this); - if (instance != null) - { - instance.RevertLastCharacter(); - e.Handled = true; - } - } - break; - case Key.System: - // https://github.com/icsharpcode/ILSpy/issues/3378: - // Behavior got broken when upgrading to .NET 8.0 for unknown reasons and without - // any more specific known cause. We fix it by not handling Alt+Left or Right - // in SharpTreeView so it is handled by the window. - if (e.SystemKey is Key.Left or Key.Right) - { - // yes, we do NOT call base.OnKeyDown(e); in this case. - return; - } - break; - } - if (!e.Handled) - base.OnKeyDown(e); - } - - protected override void OnTextInput(TextCompositionEventArgs e) - { - if (!string.IsNullOrEmpty(e.Text) && IsTextSearchEnabled && (e.OriginalSource == this || ItemsControl.ItemsControlFromItemContainer(e.OriginalSource as DependencyObject) == this)) - { - var instance = SharpTreeViewTextSearch.GetInstance(this); - if (instance != null) - { - instance.Search(e.Text); - e.Handled = true; - } - } - if (!e.Handled) - base.OnTextInput(e); - } - - void ExpandRecursively(SharpTreeNode node) - { - if (node.CanExpandRecursively) - { - node.IsExpanded = true; - foreach (SharpTreeNode child in node.Children) - { - ExpandRecursively(child); - } - } - } - - /// - /// Scrolls the specified node in view and sets keyboard focus on it. - /// - public void FocusNode(SharpTreeNode node) - { - ArgumentNullException.ThrowIfNull(node); - - ScrollIntoView(node); - - // WPF's ScrollIntoView() uses the same if/dispatcher construct, so we call OnFocusItem() after the item was brought into view. - if (this.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated) - { - OnFocusItem(node); - } - else - { - this.BeginInvoke(DispatcherPriority.Loaded, () => OnFocusItem(node)); - } - } - - public void ScrollIntoView(SharpTreeNode node) - { - if (node == null) - throw new ArgumentNullException("node"); - doNotScrollOnExpanding = true; - foreach (SharpTreeNode ancestor in node.Ancestors()) - { - ancestor.IsExpanded = true; - } - doNotScrollOnExpanding = false; - base.ScrollIntoView(node); - } - - object OnFocusItem(object item) - { - FrameworkElement element = this.ItemContainerGenerator.ContainerFromItem(item) as FrameworkElement; - if (element != null) - { - element.Focus(); - } - return null; - } - - protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer() - { - return new SharpTreeViewAutomationPeer(this); - } - #region Track selection - - protected override void OnSelectionChanged(SelectionChangedEventArgs e) - { - foreach (SharpTreeNode node in e.RemovedItems) - { - node.IsSelected = false; - } - foreach (SharpTreeNode node in e.AddedItems) - { - node.IsSelected = true; - } - base.OnSelectionChanged(e); - } - - #endregion - - #region Drag and Drop - protected override void OnDragEnter(DragEventArgs e) - { - OnDragOver(e); - } - - protected override void OnDragOver(DragEventArgs e) - { - e.Effects = DragDropEffects.None; - - if (Root != null && !ShowRoot) - { - e.Handled = true; - Root.CanDrop(new WpfWindowsDragEventArgs(e), Root.Children.Count); - } - } - - protected override void OnDrop(DragEventArgs e) - { - e.Effects = DragDropEffects.None; - - if (Root != null && !ShowRoot) - { - e.Handled = true; - Root.InternalDrop(new WpfWindowsDragEventArgs(e), Root.Children.Count); - } - } - - internal void HandleDragEnter(SharpTreeViewItem item, DragEventArgs e) - { - HandleDragOver(item, e); - } - - internal void HandleDragOver(SharpTreeViewItem item, DragEventArgs e) - { - HidePreview(); - - var target = GetDropTarget(item, e); - if (target != null) - { - e.Handled = true; - ShowPreview(target.Item, target.Place); - } - } - - internal void HandleDrop(SharpTreeViewItem item, DragEventArgs e) - { - try - { - HidePreview(); - - var target = GetDropTarget(item, e); - if (target != null) - { - e.Handled = true; - target.Node.InternalDrop(new WpfWindowsDragEventArgs(e), target.Index); - } - } - catch (Exception ex) - { - Debug.WriteLine(ex.ToString()); - throw; - } - } - - internal void HandleDragLeave(SharpTreeViewItem item, DragEventArgs e) - { - HidePreview(); - e.Handled = true; - } - - class DropTarget - { - public SharpTreeViewItem Item; - public DropPlace Place; - public double Y; - public SharpTreeNode Node; - public int Index; - } - - DropTarget GetDropTarget(SharpTreeViewItem item, DragEventArgs e) - { - var dropTargets = BuildDropTargets(item, e); - var y = e.GetPosition(item).Y; - foreach (var target in dropTargets) - { - if (target.Y >= y) - { - return target; - } - } - return null; - } - - List BuildDropTargets(SharpTreeViewItem item, DragEventArgs e) - { - var result = new List(); - var node = item.Node; - - if (AllowDropOrder) - { - TryAddDropTarget(result, item, DropPlace.Before, e); - } - - TryAddDropTarget(result, item, DropPlace.Inside, e); - - if (AllowDropOrder) - { - if (node.IsExpanded && node.Children.Count > 0) - { - var firstChildItem = ItemContainerGenerator.ContainerFromItem(node.Children[0]) as SharpTreeViewItem; - TryAddDropTarget(result, firstChildItem, DropPlace.Before, e); - } - else - { - TryAddDropTarget(result, item, DropPlace.After, e); - } - } - - var h = item.ActualHeight; - var y1 = 0.2 * h; - var y2 = h / 2; - var y3 = h - y1; - - if (result.Count == 2) - { - if (result[0].Place == DropPlace.Inside && - result[1].Place != DropPlace.Inside) - { - result[0].Y = y3; - } - else if (result[0].Place != DropPlace.Inside && - result[1].Place == DropPlace.Inside) - { - result[0].Y = y1; - } - else - { - result[0].Y = y2; - } - } - else if (result.Count == 3) - { - result[0].Y = y1; - result[1].Y = y3; - } - if (result.Count > 0) - { - result[result.Count - 1].Y = h; - } - return result; - } - - void TryAddDropTarget(List targets, SharpTreeViewItem item, DropPlace place, DragEventArgs e) - { - SharpTreeNode node; - int index; - - GetNodeAndIndex(item, place, out node, out index); - - if (node != null) - { - e.Effects = DragDropEffects.None; - if (node.CanDrop(new WpfWindowsDragEventArgs(e), index)) - { - DropTarget target = new DropTarget() { - Item = item, - Place = place, - Node = node, - Index = index - }; - targets.Add(target); - } - } - } - - void GetNodeAndIndex(SharpTreeViewItem item, DropPlace place, out SharpTreeNode node, out int index) - { - node = null; - index = 0; - - if (place == DropPlace.Inside) - { - node = item.Node; - index = node.Children.Count; - } - else if (place == DropPlace.Before) - { - if (item.Node.Parent != null) - { - node = item.Node.Parent; - index = node.Children.IndexOf(item.Node); - } - } - else - { - if (item.Node.Parent != null) - { - node = item.Node.Parent; - index = node.Children.IndexOf(item.Node) + 1; - } - } - } - - SharpTreeNodeView previewNodeView; - InsertMarker insertMarker; - DropPlace previewPlace; - - enum DropPlace - { - Before, Inside, After - } - - void ShowPreview(SharpTreeViewItem item, DropPlace place) - { - previewNodeView = item.NodeView; - previewPlace = place; - - if (place == DropPlace.Inside) - { - previewNodeView.SetResourceReference(SharpTreeNodeView.TextBackgroundProperty, SystemColors.HighlightBrushKey); - previewNodeView.SetResourceReference(SharpTreeNodeView.ForegroundProperty, SystemColors.HighlightTextBrushKey); - } - else - { - if (insertMarker == null) - { - var adornerLayer = AdornerLayer.GetAdornerLayer(this); - var adorner = new GeneralAdorner(this); - insertMarker = new InsertMarker(); - adorner.Child = insertMarker; - adornerLayer.Add(adorner); - } - - insertMarker.Visibility = Visibility.Visible; - - var p1 = previewNodeView.TransformToVisual(this).Transform(new Point()); - var p = new Point(p1.X + previewNodeView.CalculateIndent() + 4.5, p1.Y - 3); - - if (place == DropPlace.After) - { - p.Y += previewNodeView.ActualHeight; - } - - insertMarker.Margin = new Thickness(p.X, p.Y, 0, 0); - - SharpTreeNodeView secondNodeView = null; - var index = flattener.IndexOf(item.Node); - - if (place == DropPlace.Before) - { - if (index > 0) - { - secondNodeView = (ItemContainerGenerator.ContainerFromIndex(index - 1) as SharpTreeViewItem).NodeView; - } - } - else if (index + 1 < flattener.Count) - { - secondNodeView = (ItemContainerGenerator.ContainerFromIndex(index + 1) as SharpTreeViewItem).NodeView; - } - - var w = p1.X + previewNodeView.ActualWidth - p.X; - - if (secondNodeView != null) - { - var p2 = secondNodeView.TransformToVisual(this).Transform(new Point()); - w = Math.Max(w, p2.X + secondNodeView.ActualWidth - p.X); - } - - insertMarker.Width = w + 10; - } - } - - void HidePreview() - { - if (previewNodeView != null) - { - previewNodeView.ClearValue(SharpTreeNodeView.TextBackgroundProperty); - previewNodeView.ClearValue(SharpTreeNodeView.ForegroundProperty); - if (insertMarker != null) - { - insertMarker.Visibility = Visibility.Collapsed; - } - previewNodeView = null; - } - } - #endregion - - #region Cut / Copy / Paste / Delete Commands - - static void RegisterCommands() - { - CommandManager.RegisterClassCommandBinding(typeof(SharpTreeView), - new CommandBinding(ApplicationCommands.Cut, HandleExecuted_Cut, HandleCanExecute_Cut)); - - CommandManager.RegisterClassCommandBinding(typeof(SharpTreeView), - new CommandBinding(ApplicationCommands.Copy, HandleExecuted_Copy, HandleCanExecute_Copy)); - - CommandManager.RegisterClassCommandBinding(typeof(SharpTreeView), - new CommandBinding(ApplicationCommands.Paste, HandleExecuted_Paste, HandleCanExecute_Paste)); - - CommandManager.RegisterClassCommandBinding(typeof(SharpTreeView), - new CommandBinding(ApplicationCommands.Delete, HandleExecuted_Delete, HandleCanExecute_Delete)); - } - - static void HandleExecuted_Cut(object sender, ExecutedRoutedEventArgs e) - { - - } - - static void HandleCanExecute_Cut(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = false; - } - - static void HandleExecuted_Copy(object sender, ExecutedRoutedEventArgs e) - { - - } - - static void HandleCanExecute_Copy(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = false; - } - - static void HandleExecuted_Paste(object sender, ExecutedRoutedEventArgs e) - { - - } - - static void HandleCanExecute_Paste(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = false; - } - - static void HandleExecuted_Delete(object sender, ExecutedRoutedEventArgs e) - { - SharpTreeView treeView = (SharpTreeView)sender; - treeView.updatesLocked = true; - int selectedIndex = -1; - try - { - foreach (SharpTreeNode node in treeView.GetTopLevelSelection().ToArray()) - { - if (selectedIndex == -1) - selectedIndex = treeView.flattener.IndexOf(node); - node.Delete(); - } - } - finally - { - treeView.updatesLocked = false; - treeView.UpdateFocusedNode(null, Math.Max(0, selectedIndex - 1)); - } - } - - static void HandleCanExecute_Delete(object sender, CanExecuteRoutedEventArgs e) - { - SharpTreeView treeView = (SharpTreeView)sender; - e.CanExecute = treeView.GetTopLevelSelection().All(node => node.CanDelete()); - } - - /// - /// Gets the selected items which do not have any of their ancestors selected. - /// - public IEnumerable GetTopLevelSelection() - { - var selection = this.SelectedItems.OfType().ToHashSet(); - - return selection.Where(item => item.Ancestors().All(a => !selection.Contains(a))); - } - - #endregion - - public void SetSelectedNodes(IEnumerable nodes) - { - bool success = this.SetSelectedItems(nodes.ToList()); - Debug.Assert(success); - } - } -} diff --git a/ILSpy/Controls/TreeView/SharpTreeView.xaml b/ILSpy/Controls/TreeView/SharpTreeView.xaml deleted file mode 100644 index e93d659e3..000000000 --- a/ILSpy/Controls/TreeView/SharpTreeView.xaml +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Controls/TreeView/SharpTreeViewAutomationPeer.cs b/ILSpy/Controls/TreeView/SharpTreeViewAutomationPeer.cs deleted file mode 100644 index 16408f0d2..000000000 --- a/ILSpy/Controls/TreeView/SharpTreeViewAutomationPeer.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Windows.Automation.Peers; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - class SharpTreeViewAutomationPeer : FrameworkElementAutomationPeer - { - internal SharpTreeViewAutomationPeer(SharpTreeView owner) : base(owner) - { - } - - protected override AutomationControlType GetAutomationControlTypeCore() - { - return AutomationControlType.Tree; - } - } -} diff --git a/ILSpy/Controls/TreeView/SharpTreeViewItem.cs b/ILSpy/Controls/TreeView/SharpTreeViewItem.cs deleted file mode 100644 index 3dd292d25..000000000 --- a/ILSpy/Controls/TreeView/SharpTreeViewItem.cs +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class SharpTreeViewItem : ListViewItem - { - static SharpTreeViewItem() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(SharpTreeViewItem), - new FrameworkPropertyMetadata(typeof(SharpTreeViewItem))); - } - - public SharpTreeNode Node { - get { return DataContext as SharpTreeNode; } - } - - public SharpTreeNodeView NodeView { get; internal set; } - public SharpTreeView ParentTreeView { get; internal set; } - - protected override void OnKeyDown(KeyEventArgs e) - { - switch (e.Key) - { - case Key.F2: - if (Node.IsEditable && ParentTreeView != null && ParentTreeView.SelectedItems.Count == 1 && ParentTreeView.SelectedItems[0] == Node) - { - Node.IsEditing = true; - e.Handled = true; - } - break; - case Key.Escape: - if (Node.IsEditing) - { - Node.IsEditing = false; - e.Handled = true; - } - break; - } - } - - protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer() - { - return new SharpTreeViewItemAutomationPeer(this); - } - - #region Mouse - - Point startPoint; - bool wasSelected; - bool wasDoubleClick; - - protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) - { - wasSelected = IsSelected; - if (!IsSelected) - { - base.OnMouseLeftButtonDown(e); - } - - if (Mouse.LeftButton == MouseButtonState.Pressed) - { - startPoint = e.GetPosition(null); - CaptureMouse(); - - if (e.ClickCount == 2) - { - wasDoubleClick = true; - } - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - if (IsMouseCaptured) - { - var currentPoint = e.GetPosition(null); - if (Math.Abs(currentPoint.X - startPoint.X) >= SystemParameters.MinimumHorizontalDragDistance || - Math.Abs(currentPoint.Y - startPoint.Y) >= SystemParameters.MinimumVerticalDragDistance) - { - - var selection = ParentTreeView.GetTopLevelSelection().ToArray(); - if (Node.CanDrag(selection)) - { - Node.StartDrag(this, selection, new WpfWindowsDragDropManager()); - } - } - } - } - - protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) - { - if (wasDoubleClick) - { - wasDoubleClick = false; - Node.ActivateItem(new WpfWindowsRoutedEventArgs(e)); - if (!e.Handled) - { - if (!Node.IsRoot || ParentTreeView.ShowRootExpander) - { - Node.IsExpanded = !Node.IsExpanded; - } - } - } - - ReleaseMouseCapture(); - if (wasSelected) - { - base.OnMouseLeftButtonDown(e); - } - } - - protected override void OnMouseUp(MouseButtonEventArgs e) - { - if (e.ChangedButton == MouseButton.Middle) - { - Node.ActivateItemSecondary(new WpfWindowsRoutedEventArgs(e)); - } - else - { - base.OnMouseUp(e); - } - } - - #endregion - - #region Drag and Drop - - protected override void OnDragEnter(DragEventArgs e) - { - ParentTreeView.HandleDragEnter(this, e); - } - - protected override void OnDragOver(DragEventArgs e) - { - ParentTreeView.HandleDragOver(this, e); - } - - protected override void OnDrop(DragEventArgs e) - { - ParentTreeView.HandleDrop(this, e); - } - - protected override void OnDragLeave(DragEventArgs e) - { - ParentTreeView.HandleDragLeave(this, e); - } - - #endregion - } -} diff --git a/ILSpy/Controls/TreeView/SharpTreeViewItemAutomationPeer.cs b/ILSpy/Controls/TreeView/SharpTreeViewItemAutomationPeer.cs deleted file mode 100644 index f2f900325..000000000 --- a/ILSpy/Controls/TreeView/SharpTreeViewItemAutomationPeer.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.ComponentModel; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Automation.Peers; -using System.Windows.Automation.Provider; - -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - class SharpTreeViewItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider - { - internal SharpTreeViewItemAutomationPeer(SharpTreeViewItem owner) - : base(owner) - { - SharpTreeViewItem.DataContextChanged += OnDataContextChanged; - SharpTreeNode node = SharpTreeViewItem.DataContext as SharpTreeNode; - if (node == null) - return; - - node.PropertyChanged += OnPropertyChanged; - } - private SharpTreeViewItem SharpTreeViewItem { get { return (SharpTreeViewItem)base.Owner; } } - protected override AutomationControlType GetAutomationControlTypeCore() - { - return AutomationControlType.TreeItem; - } - - public override object GetPattern(PatternInterface patternInterface) - { - if (patternInterface == PatternInterface.ExpandCollapse) - return this; - return base.GetPattern(patternInterface); - } - - public void Collapse() - { - } - - public void Expand() - { - } - - public ExpandCollapseState ExpandCollapseState { - get { - SharpTreeNode node = SharpTreeViewItem.DataContext as SharpTreeNode; - if (node == null || !node.ShowExpander) - return ExpandCollapseState.LeafNode; - return node.IsExpanded ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed; - } - } - - private void OnPropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName != "IsExpanded") - return; - SharpTreeNode node = sender as SharpTreeNode; - if (node == null || node.Children.Count == 0) - return; - bool newValue = node.IsExpanded; - bool oldValue = !newValue; - RaisePropertyChangedEvent( - ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty, - oldValue ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed, - newValue ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed); - } - - private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) - { - SharpTreeNode oldNode = e.OldValue as SharpTreeNode; - if (oldNode != null) - oldNode.PropertyChanged -= OnPropertyChanged; - SharpTreeNode newNode = e.NewValue as SharpTreeNode; - if (newNode != null) - newNode.PropertyChanged += OnPropertyChanged; - } - } -} diff --git a/ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs b/ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs deleted file mode 100644 index a5bfae598..000000000 --- a/ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) 2020 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Windows; -using System.Windows.Threading; - -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - /// - /// Custom TextSearch-implementation. - /// Fixes #67 - Moving to class member in tree view by typing in first character of member name selects parent assembly - /// - public partial class SharpTreeViewTextSearch : DependencyObject - { - static readonly DependencyPropertyKey TextSearchInstancePropertyKey = DependencyProperty.RegisterAttachedReadOnly("TextSearchInstance", - typeof(SharpTreeViewTextSearch), typeof(SharpTreeViewTextSearch), new FrameworkPropertyMetadata(null)); - static readonly DependencyProperty TextSearchInstanceProperty = TextSearchInstancePropertyKey.DependencyProperty; - - DispatcherTimer timer; - - bool isActive; - int lastMatchIndex; - string matchPrefix; - - readonly Stack inputStack; - readonly SharpTreeView treeView; - - private SharpTreeViewTextSearch(SharpTreeView treeView) - { - if (treeView == null) - throw new ArgumentNullException(nameof(treeView)); - this.treeView = treeView; - inputStack = new Stack(8); - ClearState(); - } - - public static SharpTreeViewTextSearch GetInstance(SharpTreeView sharpTreeView) - { - var textSearch = (SharpTreeViewTextSearch)sharpTreeView.GetValue(TextSearchInstanceProperty); - if (textSearch == null) - { - textSearch = new SharpTreeViewTextSearch(sharpTreeView); - sharpTreeView.SetValue(TextSearchInstancePropertyKey, textSearch); - } - return textSearch; - } - - public bool RevertLastCharacter() - { - if (!isActive || inputStack.Count == 0) - return false; - matchPrefix = matchPrefix.Substring(0, matchPrefix.Length - inputStack.Pop().Length); - ResetTimeout(); - return true; - } - - public bool Search(string nextChar) - { - int startIndex = isActive ? lastMatchIndex : Math.Max(0, treeView.SelectedIndex); - bool lookBackwards = inputStack.Count > 0 && string.Compare(inputStack.Peek(), nextChar, StringComparison.OrdinalIgnoreCase) == 0; - int nextMatchIndex = IndexOfMatch(matchPrefix + nextChar, startIndex, lookBackwards, out bool wasNewCharUsed); - if (nextMatchIndex != -1) - { - if (!isActive || nextMatchIndex != startIndex) - { - treeView.SelectedItem = treeView.Items[nextMatchIndex]; - treeView.FocusNode((SharpTreeNode)treeView.SelectedItem); - lastMatchIndex = nextMatchIndex; - } - if (wasNewCharUsed) - { - matchPrefix += nextChar; - inputStack.Push(nextChar); - } - isActive = true; - } - if (isActive) - { - ResetTimeout(); - } - return nextMatchIndex != -1; - } - - int IndexOfMatch(string needle, int startIndex, bool tryBackward, out bool charWasUsed) - { - charWasUsed = false; - if (treeView.Items.Count == 0 || string.IsNullOrEmpty(needle)) - return -1; - int index = -1; - int fallbackIndex = -1; - bool fallbackMatch = false; - int i = startIndex; - var comparisonType = treeView.IsTextSearchCaseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase; - do - { - var item = (SharpTreeNode)treeView.Items[i]; - if (item != null && item.Text != null) - { - string text = item.Text.ToString(); - if (text.StartsWith(needle, comparisonType)) - { - charWasUsed = true; - index = i; - break; - } - if (tryBackward) - { - if (fallbackMatch && matchPrefix != string.Empty) - { - if (fallbackIndex == -1 && text.StartsWith(matchPrefix, comparisonType)) - { - fallbackIndex = i; - } - } - else - { - fallbackMatch = true; - } - } - } - i++; - if (i >= treeView.Items.Count) - i = 0; - } while (i != startIndex); - return index == -1 ? fallbackIndex : index; - } - - void ClearState() - { - isActive = false; - matchPrefix = string.Empty; - lastMatchIndex = -1; - inputStack.Clear(); - timer?.Stop(); - timer = null; - } - - void ResetTimeout() - { - if (timer == null) - { - timer = new DispatcherTimer(DispatcherPriority.Normal); - timer.Tick += (sender, e) => ClearState(); - } - else - { - timer.Stop(); - } - timer.Interval = TimeSpan.FromMilliseconds(NativeMethods.GetDoubleClickTime() * 2); - timer.Start(); - } - } -} \ No newline at end of file diff --git a/ILSpy/Controls/TreeView/WpfWindowsDataObject.cs b/ILSpy/Controls/TreeView/WpfWindowsDataObject.cs deleted file mode 100644 index bb64999d9..000000000 --- a/ILSpy/Controls/TreeView/WpfWindowsDataObject.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Windows; - -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public sealed class WpfWindowsDataObject : IPlatformDataObject - { - private readonly IDataObject _dataObject; - - public WpfWindowsDataObject(IDataObject dataObject) - { - _dataObject = dataObject; - } - - public object GetData(string format) - { - return _dataObject.GetData(format); - } - - public bool GetDataPresent(string format) - { - return _dataObject.GetDataPresent(format); - } - - public void SetData(string format, object data) - { - _dataObject.SetData(format, data); - } - - object IPlatformDataObject.UnderlyingDataObject => _dataObject; - } -} diff --git a/ILSpy/Controls/TreeView/WpfWindowsDragDropManager.cs b/ILSpy/Controls/TreeView/WpfWindowsDragDropManager.cs deleted file mode 100644 index d5de40a77..000000000 --- a/ILSpy/Controls/TreeView/WpfWindowsDragDropManager.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Windows; - -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class WpfWindowsDragDropManager : IPlatformDragDrop - { - public XPlatDragDropEffects DoDragDrop(object dragSource, IPlatformDataObject data, XPlatDragDropEffects allowedEffects) - { - return (XPlatDragDropEffects)DragDrop.DoDragDrop(dragSource as DependencyObject, data.UnderlyingDataObject, (DragDropEffects)allowedEffects); - } - } -} \ No newline at end of file diff --git a/ILSpy/Controls/TreeView/WpfWindowsDragEventArgs.cs b/ILSpy/Controls/TreeView/WpfWindowsDragEventArgs.cs deleted file mode 100644 index 75dcc58c0..000000000 --- a/ILSpy/Controls/TreeView/WpfWindowsDragEventArgs.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Windows; - -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class WpfWindowsDragEventArgs : IPlatformDragEventArgs - { - private readonly DragEventArgs _eventArgs; - - public WpfWindowsDragEventArgs(DragEventArgs eventArgs) - { - _eventArgs = eventArgs; - } - - public XPlatDragDropEffects Effects { get => (XPlatDragDropEffects)_eventArgs.Effects; set => _eventArgs.Effects = (DragDropEffects)value; } - - public IPlatformDataObject Data => new WpfWindowsDataObject(_eventArgs.Data); - } -} diff --git a/ILSpy/Controls/TreeView/WpfWindowsRoutedEventArgs.cs b/ILSpy/Controls/TreeView/WpfWindowsRoutedEventArgs.cs deleted file mode 100644 index bd6459a89..000000000 --- a/ILSpy/Controls/TreeView/WpfWindowsRoutedEventArgs.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Windows; - -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; - -namespace ICSharpCode.ILSpy.Controls.TreeView -{ - public class WpfWindowsRoutedEventArgs : IPlatformRoutedEventArgs - { - private readonly RoutedEventArgs _eventArgs; - - public WpfWindowsRoutedEventArgs(RoutedEventArgs eventArgs) - { - _eventArgs = eventArgs; - } - - public bool Handled { get => _eventArgs.Handled; set => _eventArgs.Handled = value; } - } -} diff --git a/ILSpy/Controls/XamlResourceExtension.cs b/ILSpy/Controls/XamlResourceExtension.cs deleted file mode 100644 index 239f24ef2..000000000 --- a/ILSpy/Controls/XamlResourceExtension.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows.Markup; - -namespace ICSharpCode.ILSpy.Controls -{ - class XamlResourceExtension : MarkupExtension - { - readonly string name; - - public XamlResourceExtension(string name) - { - this.name = name ?? throw new ArgumentNullException(nameof(name)); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return Images.Load(null, name); - } - } -} diff --git a/ILSpy/Controls/ZoomButtons.cs b/ILSpy/Controls/ZoomButtons.cs deleted file mode 100644 index 96cbb2d2c..000000000 --- a/ILSpy/Controls/ZoomButtons.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; - -namespace ICSharpCode.ILSpy.Controls -{ - public class ZoomButtons : RangeBase - { - static ZoomButtons() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(ZoomButtons), - new FrameworkPropertyMetadata(typeof(ZoomButtons))); - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - var uxPlus = (ButtonBase)Template.FindName("uxPlus", this); - var uxMinus = (ButtonBase)Template.FindName("uxMinus", this); - var uxReset = (ButtonBase)Template.FindName("uxReset", this); - - if (uxPlus != null) - uxPlus.Click += OnZoomInClick; - if (uxMinus != null) - uxMinus.Click += OnZoomOutClick; - if (uxReset != null) - uxReset.Click += OnResetClick; - } - - const double ZoomFactor = 1.1; - - void OnZoomInClick(object sender, EventArgs e) - { - SetCurrentValue(ValueProperty, ZoomScrollViewer.RoundToOneIfClose(this.Value * ZoomFactor)); - } - - void OnZoomOutClick(object sender, EventArgs e) - { - SetCurrentValue(ValueProperty, ZoomScrollViewer.RoundToOneIfClose(this.Value / ZoomFactor)); - } - - void OnResetClick(object sender, EventArgs e) - { - SetCurrentValue(ValueProperty, 1.0); - } - } -} diff --git a/ILSpy/Controls/ZoomScrollViewer.cs b/ILSpy/Controls/ZoomScrollViewer.cs deleted file mode 100644 index b81ac2ef1..000000000 --- a/ILSpy/Controls/ZoomScrollViewer.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; - -namespace ICSharpCode.ILSpy.Controls -{ - public class ZoomScrollViewer : ScrollViewer - { - static ZoomScrollViewer() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(ZoomScrollViewer), - new FrameworkPropertyMetadata(typeof(ZoomScrollViewer))); - } - - public static readonly DependencyProperty CurrentZoomProperty = - DependencyProperty.Register("CurrentZoom", typeof(double), typeof(ZoomScrollViewer), - new FrameworkPropertyMetadata(1.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, CalculateZoomButtonCollapsed, CoerceZoom)); - - public double CurrentZoom { - get { return (double)GetValue(CurrentZoomProperty); } - set { SetValue(CurrentZoomProperty, value); } - } - - static object CoerceZoom(DependencyObject d, object baseValue) - { - var zoom = (double)baseValue; - ZoomScrollViewer sv = (ZoomScrollViewer)d; - return Math.Max(sv.MinimumZoom, Math.Min(sv.MaximumZoom, zoom)); - } - - public static readonly DependencyProperty MinimumZoomProperty = - DependencyProperty.Register("MinimumZoom", typeof(double), typeof(ZoomScrollViewer), - new FrameworkPropertyMetadata(0.2)); - - public double MinimumZoom { - get { return (double)GetValue(MinimumZoomProperty); } - set { SetValue(MinimumZoomProperty, value); } - } - - public static readonly DependencyProperty MaximumZoomProperty = - DependencyProperty.Register("MaximumZoom", typeof(double), typeof(ZoomScrollViewer), - new FrameworkPropertyMetadata(5.0)); - - public double MaximumZoom { - get { return (double)GetValue(MaximumZoomProperty); } - set { SetValue(MaximumZoomProperty, value); } - } - - public static readonly DependencyProperty MouseWheelZoomProperty = - DependencyProperty.Register("MouseWheelZoom", typeof(bool), typeof(ZoomScrollViewer), - new FrameworkPropertyMetadata(true)); - - public bool MouseWheelZoom { - get { return (bool)GetValue(MouseWheelZoomProperty); } - set { SetValue(MouseWheelZoomProperty, value); } - } - - public static readonly DependencyProperty AlwaysShowZoomButtonsProperty = - DependencyProperty.Register("AlwaysShowZoomButtons", typeof(bool), typeof(ZoomScrollViewer), - new FrameworkPropertyMetadata(false, CalculateZoomButtonCollapsed)); - - public bool AlwaysShowZoomButtons { - get { return (bool)GetValue(AlwaysShowZoomButtonsProperty); } - set { SetValue(AlwaysShowZoomButtonsProperty, value); } - } - - static readonly DependencyPropertyKey ComputedZoomButtonCollapsedPropertyKey = - DependencyProperty.RegisterReadOnly("ComputedZoomButtonCollapsed", typeof(bool), typeof(ZoomScrollViewer), - new FrameworkPropertyMetadata(true)); - - public static readonly DependencyProperty ComputedZoomButtonCollapsedProperty = ComputedZoomButtonCollapsedPropertyKey.DependencyProperty; - - public bool ComputedZoomButtonCollapsed { - get { return (bool)GetValue(ComputedZoomButtonCollapsedProperty); } - private set { SetValue(ComputedZoomButtonCollapsedPropertyKey, value); } - } - - static void CalculateZoomButtonCollapsed(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ZoomScrollViewer z = d as ZoomScrollViewer; - if (z != null) - z.ComputedZoomButtonCollapsed = (z.AlwaysShowZoomButtons == false) && (z.CurrentZoom == 1.0); - } - - protected override void OnPreviewMouseWheel(MouseWheelEventArgs e) - { - if (!e.Handled && Keyboard.Modifiers == ModifierKeys.Control && MouseWheelZoom) - { - double oldZoom = CurrentZoom; - double newZoom = RoundToOneIfClose(CurrentZoom * Math.Pow(1.001, e.Delta)); - newZoom = Math.Max(this.MinimumZoom, Math.Min(this.MaximumZoom, newZoom)); - - // adjust scroll position so that mouse stays over the same virtual coordinate - ContentPresenter presenter = Template.FindName("PART_Presenter", this) as ContentPresenter; - Vector relMousePos; - if (presenter != null) - { - Point mousePos = e.GetPosition(presenter); - relMousePos = new Vector(mousePos.X / presenter.ActualWidth, mousePos.Y / presenter.ActualHeight); - } - else - { - relMousePos = new Vector(0.5, 0.5); - } - - Point scrollOffset = new Point(this.HorizontalOffset, this.VerticalOffset); - Vector oldHalfViewport = new Vector(this.ViewportWidth / 2, this.ViewportHeight / 2); - Vector newHalfViewport = oldHalfViewport / newZoom * oldZoom; - Point oldCenter = scrollOffset + oldHalfViewport; - Point virtualMousePos = scrollOffset + new Vector(relMousePos.X * this.ViewportWidth, relMousePos.Y * this.ViewportHeight); - - // As newCenter, we want to choose a point between oldCenter and virtualMousePos. The more we zoom in, the closer - // to virtualMousePos. We'll create the line x = oldCenter + lambda * (virtualMousePos-oldCenter). - // On this line, we need to choose lambda between -1 and 1: - // -1 = zoomed out completely - // 0 = zoom unchanged - // +1 = zoomed in completely - // But the zoom factor (newZoom/oldZoom) we have is in the range [0,+Infinity]. - - // Basically, I just played around until I found a function that maps this to [-1,1] and works well. - // "f" is squared because otherwise the mouse simply stays over virtualMousePos, but I wanted virtualMousePos - // to move towards the middle -> squaring f causes lambda to be closer to 1, giving virtualMousePos more weight - // then oldCenter. - - double f = Math.Min(newZoom, oldZoom) / Math.Max(newZoom, oldZoom); - double lambda = 1 - f * f; - if (oldZoom > newZoom) - lambda = -lambda; - - Debug.Print("old: " + oldZoom + ", new: " + newZoom); - - Point newCenter = oldCenter + lambda * (virtualMousePos - oldCenter); - scrollOffset = newCenter - newHalfViewport; - - SetCurrentValue(CurrentZoomProperty, newZoom); - - this.ScrollToHorizontalOffset(scrollOffset.X); - this.ScrollToVerticalOffset(scrollOffset.Y); - - e.Handled = true; - } - base.OnPreviewMouseWheel(e); - } - - internal static double RoundToOneIfClose(double val) - { - if (Math.Abs(val - 1.0) < 0.001) - return 1.0; - else - return val; - } - } -} diff --git a/ILSpy/Controls/ZoomScrollViewer.xaml b/ILSpy/Controls/ZoomScrollViewer.xaml deleted file mode 100644 index 3dfc72705..000000000 --- a/ILSpy/Controls/ZoomScrollViewer.xaml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/DecompilationOptions.cs b/ILSpy/DecompilationOptions.cs deleted file mode 100644 index 483b159f1..000000000 --- a/ILSpy/DecompilationOptions.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Threading; - -using ICSharpCode.Decompiler; -using ICSharpCode.ILSpy.Options; -using ICSharpCode.ILSpyX; - -using DecompilerSettings = ICSharpCode.ILSpyX.Settings.DecompilerSettings; - -namespace ICSharpCode.ILSpy -{ - /// - /// Options passed to the decompiler. - /// - public class DecompilationOptions - { - /// - /// Gets whether a full decompilation (all members recursively) is desired. - /// If this option is false, language bindings are allowed to show the only headers of the decompiled element's children. - /// - public bool FullDecompilation { get; set; } - - /// - /// Gets/Sets the directory into which the project is saved. - /// - public string SaveAsProjectDirectory { get; set; } - - /// - /// Gets/sets whether invalid identifiers should be escaped (and therefore the code be made compilable). - /// This setting is ignored in case is set. - /// - public bool EscapeInvalidIdentifiers { get; set; } - - /// - /// Gets the cancellation token that is used to abort the decompiler. - /// - /// - /// Decompilers should regularly call options.CancellationToken.ThrowIfCancellationRequested(); - /// to allow for cooperative cancellation of the decompilation task. - /// - public CancellationToken CancellationToken { get; set; } - - /// - /// Gets the progress reporter. - /// - /// - /// If decompilers do not implement progress reporting, an indeterminate wait bar is displayed. - /// - public IProgress Progress { get; set; } - - /// - /// Gets the settings for the decompiler. - /// - public DecompilerSettings DecompilerSettings { get; private set; } - - /// - /// Gets/sets an optional state of a decompiler text view. - /// - /// - /// This state is used to restore test view's state when decompilation is started by Go Back/Forward action. - /// - public TextView.DecompilerTextViewState TextViewState { get; set; } - - /// - /// Used internally for debugging. - /// - internal int StepLimit = int.MaxValue; - internal bool IsDebug = false; - - public DecompilationOptions(LanguageVersion version, DecompilerSettings settings, DisplaySettings displaySettings) - { - if (!Enum.TryParse(version?.Version, out Decompiler.CSharp.LanguageVersion languageVersion)) - languageVersion = Decompiler.CSharp.LanguageVersion.Latest; - - var newSettings = this.DecompilerSettings = settings.Clone(); - - newSettings.SetLanguageVersion(languageVersion); - newSettings.ExpandMemberDefinitions = displaySettings.ExpandMemberDefinitions; - newSettings.ExpandUsingDeclarations = displaySettings.ExpandUsingDeclarations; - newSettings.FoldBraces = displaySettings.FoldBraces; - newSettings.ShowDebugInfo = displaySettings.ShowDebugInfo; - newSettings.CSharpFormattingOptions.IndentationString = GetIndentationString(displaySettings); - } - - private string GetIndentationString(DisplaySettings displaySettings) - { - if (displaySettings.IndentationUseTabs) - { - int numberOfTabs = displaySettings.IndentationSize / displaySettings.IndentationTabSize; - int numberOfSpaces = displaySettings.IndentationSize % displaySettings.IndentationTabSize; - return new string('\t', numberOfTabs) + new string(' ', numberOfSpaces); - } - return new string(' ', displaySettings.IndentationSize); - } - } -} diff --git a/ILSpy/Docking/CloseAllDocumentsCommand.cs b/ILSpy/Docking/CloseAllDocumentsCommand.cs deleted file mode 100644 index 5c82e38b9..000000000 --- a/ILSpy/Docking/CloseAllDocumentsCommand.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Composition; - -using ICSharpCode.ILSpy.Properties; - -namespace ICSharpCode.ILSpy.Docking -{ - [ExportMainMenuCommand(Header = nameof(Resources.Window_CloseAllDocuments), ParentMenuID = nameof(Resources._Window))] - [Shared] - class CloseAllDocumentsCommand(DockWorkspace dockWorkspace) : SimpleCommand - { - public override void Execute(object parameter) - { - dockWorkspace.CloseAllTabs(); - } - } - - [ExportMainMenuCommand(Header = nameof(Resources.Window_ResetLayout), ParentMenuID = nameof(Resources._Window))] - [Shared] - class ResetLayoutCommand(DockWorkspace dockWorkspace) : SimpleCommand - { - public override void Execute(object parameter) - { - dockWorkspace.ResetLayout(); - } - } -} diff --git a/ILSpy/Docking/DockLayoutSettings.cs b/ILSpy/Docking/DockLayoutSettings.cs deleted file mode 100644 index 6fa8c62e7..000000000 --- a/ILSpy/Docking/DockLayoutSettings.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.IO; -using System.Linq; -using System.Xml.Linq; - -using AvalonDock.Layout.Serialization; - -namespace ICSharpCode.ILSpy.Docking -{ - public class DockLayoutSettings - { - /// NOTE: do NOT remove any of the (empty) sections, the deserializer is not very resilient and expects this exact order of elements! - private const string DefaultLayout = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"; - - private string rawSettings; - - public bool Valid => rawSettings != null; - - public void Reset() - { - this.rawSettings = DefaultLayout; - } - - public DockLayoutSettings(XElement element) - { - if ((element != null) && element.HasElements) - { - rawSettings = element.Elements().FirstOrDefault()?.ToString(); - } - } - - public XElement SaveAsXml() - { - try - { - return XElement.Parse(rawSettings); - } - catch (Exception) - { - return null; - } - } - - public void Deserialize(XmlLayoutSerializer serializer) - { - if (!Valid) - rawSettings = DefaultLayout; - try - { - Deserialize(rawSettings); - } - catch (Exception) - { - Deserialize(DefaultLayout); - } - - void Deserialize(string settings) - { - using (StringReader reader = new StringReader(settings)) - { - serializer.Deserialize(reader); - } - } - } - - public void Serialize(XmlLayoutSerializer serializer) - { - using (StringWriter fs = new StringWriter()) - { - serializer.Serialize(fs); - rawSettings = fs.ToString(); - } - } - } -} diff --git a/ILSpy/Docking/DockWorkspace.cs b/ILSpy/Docking/DockWorkspace.cs deleted file mode 100644 index 724f1ed63..000000000 --- a/ILSpy/Docking/DockWorkspace.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Threading; - -using AvalonDock.Layout; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.ViewModels; - -using TomsToolbox.Composition; -using TomsToolbox.Essentials; -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy.Docking -{ - [Export] - [Shared] - public partial class DockWorkspace : ObservableObjectBase, ILayoutUpdateStrategy - { - private readonly IExportProvider exportProvider; - - private readonly ObservableCollection tabPages = []; - private ReadOnlyCollection toolPanes; - - readonly SessionSettings sessionSettings; - - public DockWorkspace(SettingsService settingsService, IExportProvider exportProvider) - { - this.exportProvider = exportProvider; - - sessionSettings = settingsService.SessionSettings; - - this.tabPages.CollectionChanged += TabPages_CollectionChanged; - TabPages = new(tabPages); - - MessageBus.Subscribers += (sender, e) => CurrentAssemblyList_Changed(sender, e); - } - - private void CurrentAssemblyList_Changed(object sender, NotifyCollectionChangedEventArgs e) - { - if (e.OldItems is not { } oldItems) - return; - - foreach (var tab in tabPages.ToArray()) - { - var state = tab.GetState(); - var decompiledNodes = state?.DecompiledNodes; - if (decompiledNodes == null) - continue; - - bool found = decompiledNodes - .Select(node => node.Ancestors().OfType().LastOrDefault()) - .ExceptNullItems() - .Any(assemblyNode => !oldItems.Contains(assemblyNode.LoadedAssembly)); - - if (!found) - { - tabPages.Remove(tab); - } - } - - if (tabPages.Count == 0) - { - AddTabPage(); - } - } - - private void TabPages_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - if (e.Action == NotifyCollectionChangedAction.Add) - { - if (e.NewItems?[0] is TabPageModel model) - { - ActiveTabPage = model; - model.IsActive = true; - model.IsVisible = true; - } - } - - bool canClose = tabPages.Count > 1; - - foreach (var item in tabPages) - { - item.IsCloseable = canClose; - } - - MessageBus.Send(this, new TabPagesCollectionChangedEventArgs(e)); - } - - public TabPageModel AddTabPage(TabPageModel tabPage = null) - { - TabPageModel item = tabPage ?? exportProvider.GetExportedValue(); - tabPages.Add(item); - return item; - } - - public ReadOnlyObservableCollection TabPages { get; } - - public ReadOnlyCollection ToolPanes => toolPanes ??= exportProvider - .GetExportedValues("ToolPane") - .OrderBy(item => item.Title) - .ToArray() - .AsReadOnly(); - - public bool ShowToolPane(string contentId) - { - var pane = ToolPanes.FirstOrDefault(p => p.ContentId == contentId); - if (pane != null) - { - pane.Show(); - return true; - } - return false; - } - - public void Remove(PaneModel model) - { - switch (model) - { - case TabPageModel document: - tabPages.Remove(document); - break; - case ToolPaneModel tool: - tool.IsVisible = false; - break; - } - } - - private TabPageModel activeTabPage = null; - public TabPageModel ActiveTabPage { - get { - return activeTabPage; - } - set { - if (!SetProperty(ref activeTabPage, value)) - return; - - var state = value?.GetState(); - if (state == null) - return; - - MessageBus.Send(this, new ActiveTabPageChangedEventArgs(value?.GetState())); - } - } - public void ShowText(AvalonEditTextOutput textOutput) - { - ActiveTabPage.ShowTextView(textView => textView.ShowText(textOutput)); - } - - public Task RunWithCancellation(Func> taskCreation) - { - return ActiveTabPage.ShowTextViewAsync(textView => textView.RunWithCancellation(taskCreation)); - } - - public Task RunWithCancellation(Func> taskCreation, string progressTitle) - { - return ActiveTabPage.ShowTextViewAsync(textView => textView.RunWithCancellation(taskCreation, progressTitle)); - } - - internal void ShowNodes(AvalonEditTextOutput output, TreeNodes.ILSpyTreeNode[] nodes, IHighlightingDefinition highlighting) - { - ActiveTabPage.ShowTextView(textView => textView.ShowNodes(output, nodes, highlighting)); - } - - internal void CloseAllTabs() - { - var activePage = ActiveTabPage; - - tabPages.RemoveWhere(page => page != activePage); - } - - // Dummy property to make the XAML designer happy, the model is provided by the AvalonDock PaneStyleSelectors, not by the DockWorkspace, but the designer assumes the data context in the PaneStyleSelectors is the DockWorkspace. - public PaneModel Model { get; } = null; - } -} diff --git a/ILSpy/Docking/DockWorkspace.wpf.cs b/ILSpy/Docking/DockWorkspace.wpf.cs deleted file mode 100644 index fddb2e1a3..000000000 --- a/ILSpy/Docking/DockWorkspace.wpf.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Linq; -using System.Reflection; -using System.Windows.Data; -using System.Windows.Threading; - -using AvalonDock; -using AvalonDock.Layout; -using AvalonDock.Layout.Serialization; - -using ICSharpCode.ILSpy.Analyzers; -using ICSharpCode.ILSpy.Search; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Docking -{ - /// - /// WPF-specific extensions to . - /// - partial class DockWorkspace - { - private DockingManager DockingManager => exportProvider.GetExportedValue(); - - void LayoutSerializationCallback(object sender, LayoutSerializationCallbackEventArgs e) - { - switch (e.Model) - { - case LayoutAnchorable la: - e.Content = this.ToolPanes.FirstOrDefault(p => p.ContentId == la.ContentId); - e.Cancel = e.Content == null; - la.CanDockAsTabbedDocument = false; - if (e.Content is ToolPaneModel toolPaneModel) - { - e.Cancel = toolPaneModel.IsVisible; - toolPaneModel.IsVisible = true; - } - break; - default: - e.Cancel = true; - break; - } - } - - - public PaneModel ActivePane { - get => DockingManager.ActiveContent as PaneModel; - set => DockingManager.ActiveContent = value; - } - - public void InitializeLayout() - { - if (tabPages.Count == 0) - { - // Make sure there is at least one tab open - AddTabPage(); - } - - DockingManager.LayoutUpdateStrategy = this; - XmlLayoutSerializer serializer = new XmlLayoutSerializer(DockingManager); - serializer.LayoutSerializationCallback += LayoutSerializationCallback; - try - { - sessionSettings.DockLayout.Deserialize(serializer); - } - finally - { - serializer.LayoutSerializationCallback -= LayoutSerializationCallback; - } - - DockingManager.SetBinding(DockingManager.AnchorablesSourceProperty, new Binding(nameof(ToolPanes))); - DockingManager.SetBinding(DockingManager.DocumentsSourceProperty, new Binding(nameof(TabPages))); - } - - internal void ResetLayout() - { - foreach (var pane in ToolPanes) - { - pane.IsVisible = false; - } - CloseAllTabs(); - sessionSettings.DockLayout.Reset(); - InitializeLayout(); - - App.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, () => MessageBus.Send(this, new ResetLayoutEventArgs())); - } - - static readonly PropertyInfo previousContainerProperty = typeof(LayoutContent).GetProperty("PreviousContainer", BindingFlags.NonPublic | BindingFlags.Instance); - - public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer) - { - if (!(anchorableToShow.Content is LegacyToolPaneModel legacyContent)) - return false; - anchorableToShow.CanDockAsTabbedDocument = false; - - LayoutAnchorablePane previousContainer; - switch (legacyContent.Location) - { - case LegacyToolPaneLocation.Top: - previousContainer = GetContainer(); - previousContainer.Children.Add(anchorableToShow); - return true; - case LegacyToolPaneLocation.Bottom: - previousContainer = GetContainer(); - previousContainer.Children.Add(anchorableToShow); - return true; - default: - return false; - } - - LayoutAnchorablePane GetContainer() - { - var anchorable = layout.Descendents().OfType().FirstOrDefault(x => x.Content is T) - ?? layout.Hidden.First(x => x.Content is T); - return (LayoutAnchorablePane)previousContainerProperty.GetValue(anchorable) ?? (LayoutAnchorablePane)anchorable.Parent; - } - } - - public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown) - { - anchorableShown.IsActive = true; - anchorableShown.IsSelected = true; - } - - public bool BeforeInsertDocument(LayoutRoot layout, LayoutDocument anchorableToShow, ILayoutContainer destinationContainer) - { - return false; - } - - public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown) - { - } - } -} \ No newline at end of file diff --git a/ILSpy/Docking/PaneStyleSelector.cs b/ILSpy/Docking/PaneStyleSelector.cs deleted file mode 100644 index 413602a82..000000000 --- a/ILSpy/Docking/PaneStyleSelector.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Windows; -using System.Windows.Controls; - -using ICSharpCode.ILSpy.ViewModels; -// Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -namespace ICSharpCode.ILSpy.Docking -{ - public class PaneStyleSelector : StyleSelector - { - public Style ToolPaneStyle { get; set; } - - public Style TabPageStyle { get; set; } - - public override Style SelectStyle(object item, DependencyObject container) - { - if (item is TabPageModel) - return TabPageStyle; - - if (item is ToolPaneModel) - return ToolPaneStyle; - - return base.SelectStyle(item, container); - } - } -} diff --git a/ILSpy/Docking/TabPageGuardConverter.cs b/ILSpy/Docking/TabPageGuardConverter.cs deleted file mode 100644 index ff78ce499..000000000 --- a/ILSpy/Docking/TabPageGuardConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows.Data; - -using ICSharpCode.ILSpy.ViewModels; - -using TomsToolbox.Wpf.Converters; - -namespace ICSharpCode.ILSpy.Docking -{ - public class TabPageGuardConverter : ValueConverter - { - protected override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - return value is TabPageModel ? value : Binding.DoNothing; - } - - protected override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - return value is TabPageModel ? value : Binding.DoNothing; - } - } -} diff --git a/ILSpy/EntityReference.cs b/ILSpy/EntityReference.cs deleted file mode 100644 index 090578f57..000000000 --- a/ILSpy/EntityReference.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2018 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -#nullable enable - -using System.Diagnostics; -using System.Reflection.Metadata; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpyX; - -namespace ICSharpCode.ILSpy -{ - [DebuggerDisplay("EntityReference Module={Module}, Handle={Handle}, Protocol={Protocol}")] - public class EntityReference - { - readonly MetadataFile? peFile; - public string Module { get; } - public Handle Handle { get; } - public string Protocol { get; } - - public EntityReference(string moduleFileName, Handle handle) - { - this.Module = moduleFileName; - this.Handle = handle; - this.Protocol = "decompile"; - } - - public EntityReference(string? protocol, string moduleFileName, Handle handle) - : this(moduleFileName, handle) - { - this.Protocol = protocol ?? "decompile"; - } - - public EntityReference(MetadataFile module, Handle handle, string protocol = "decompile") - { - this.peFile = module; - this.Module = module.FileName; - this.Handle = handle; - this.Protocol = protocol; - } - - public MetadataFile? ResolveAssembly(AssemblyList context) - { - return peFile ?? context.FindAssembly(Module)?.GetMetadataFileOrNull(); - } - } -} diff --git a/ILSpy/ExtensionMethods.cs b/ILSpy/ExtensionMethods.cs deleted file mode 100644 index 27f27b16e..000000000 --- a/ILSpy/ExtensionMethods.cs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpyX; - -using TomsToolbox.Essentials; - -namespace ICSharpCode.ILSpy -{ - /// - /// ExtensionMethods used in ILSpy. - /// - public static class ExtensionMethods - { - public static string ToSuffixString(this System.Reflection.Metadata.EntityHandle handle, bool showMetadataTokens, bool useBase10) - { - if (!showMetadataTokens) - return string.Empty; - - int token = System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(handle); - if (useBase10) - return " @" + token; - return " @" + token.ToString("x8"); - } - - /// - /// Takes at most first characters from string, and appends '...' if string is longer. - /// String can be null. - /// - public static string TakeStartEllipsis(this string s, int length) - { - if (string.IsNullOrEmpty(s) || length >= s.Length) - return s; - return s.Substring(0, length) + "..."; - } - - /// - /// Equivalent to collection.Select(func).ToArray(), but more efficient as it makes - /// use of the input collection's known size. - /// - public static U[] SelectArray(this ICollection collection, Func func) - { - U[] result = new U[collection.Count]; - int index = 0; - foreach (var element in collection) - { - result[index++] = func(element); - } - return result; - } - - public static ICompilation? GetTypeSystemWithCurrentOptionsOrNull(this MetadataFile file, SettingsService settingsService, LanguageVersion? languageVersion) - { - var decompilerSettings = settingsService.DecompilerSettings.Clone(); - if (!Enum.TryParse(languageVersion?.Version, out Decompiler.CSharp.LanguageVersion csharpLanguageVersion)) - csharpLanguageVersion = Decompiler.CSharp.LanguageVersion.Latest; - decompilerSettings.SetLanguageVersion(csharpLanguageVersion); - return file - .GetLoadedAssembly() - .GetTypeSystemOrNull(DecompilerTypeSystem.GetOptions(decompilerSettings)); - } - - #region DPI independence - public static Rect TransformToDevice(this Rect rect, Visual visual) - { - Matrix matrix = PresentationSource.FromVisual(visual).CompositionTarget.TransformToDevice; - return Rect.Transform(rect, matrix); - } - - public static Rect TransformFromDevice(this Rect rect, Visual visual) - { - Matrix matrix = PresentationSource.FromVisual(visual).CompositionTarget.TransformFromDevice; - return Rect.Transform(rect, matrix); - } - - public static Size TransformToDevice(this Size size, Visual visual) - { - Matrix matrix = PresentationSource.FromVisual(visual).CompositionTarget.TransformToDevice; - return new Size(size.Width * matrix.M11, size.Height * matrix.M22); - } - - public static Size TransformFromDevice(this Size size, Visual visual) - { - Matrix matrix = PresentationSource.FromVisual(visual).CompositionTarget.TransformFromDevice; - return new Size(size.Width * matrix.M11, size.Height * matrix.M22); - } - - public static Point TransformToDevice(this Point point, Visual visual) - { - Matrix matrix = PresentationSource.FromVisual(visual).CompositionTarget.TransformToDevice; - return matrix.Transform(point); - } - - public static Point TransformFromDevice(this Point point, Visual visual) - { - Matrix matrix = PresentationSource.FromVisual(visual).CompositionTarget.TransformFromDevice; - return matrix.Transform(point); - } - #endregion - - public static T? FindVisualChild(this DependencyObject? depObj) where T : DependencyObject - { - if (depObj != null) - { - for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++) - { - DependencyObject child = VisualTreeHelper.GetChild(depObj, i); - if (child is T dependencyObject) - { - return dependencyObject; - } - - T? childItem = FindVisualChild(child); - if (childItem != null) - return childItem; - } - } - return null; - } - - public static T? GetParent(this DependencyObject? depObj) where T : DependencyObject - { - if (depObj == null) - return null; - while (!(depObj is T)) - { - var parent = VisualTreeHelper.GetParent(depObj); - if (parent == null) - return null; - depObj = parent; - } - return (T)depObj; - } - - public static void SelectItem(this DataGrid view, object item) - { - var container = (DataGridRow)view.ItemContainerGenerator.ContainerFromItem(item); - if (container != null) - container.IsSelected = true; - view.Focus(); - } - - public static double ToGray(this Color? color) - { - return color?.R * 0.3 + color?.G * 0.6 + color?.B * 0.1 ?? 0.0; - } - - internal static string? FormatExceptions(this IList exceptions) - { - if (exceptions.Count == 0) - return null; - - string delimiter = $"-------------------------------------------------{Environment.NewLine}"; - - return string.Join(delimiter, exceptions.Select(FormatException)); - } - - private static string FormatException(App.ExceptionData item) - { - var output = new StringBuilder(); - - if (!item.PluginName.IsNullOrEmpty()) - output.AppendLine("Error(s) loading plugin: " + item.PluginName); - - if (item.Exception is System.Reflection.ReflectionTypeLoadException exception) - { - foreach (var ex in exception.LoaderExceptions.ExceptNullItems()) - { - output.AppendLine(ex.ToString()); - output.AppendLine(); - } - } - else - { - output.AppendLine(item.Exception.ToString()); - } - - return output.ToString(); - } - - public static IDisposable PreserveFocus(this IInputElement? inputElement, bool preserve = true) - { - return new RestoreFocusHelper(inputElement, preserve); - } - - private sealed class RestoreFocusHelper(IInputElement? inputElement, bool preserve) : IDisposable - { - public void Dispose() - { - if (preserve) - { - inputElement?.Focus(); - } - } - } - } -} diff --git a/ILSpy/GlobalUsings.cs b/ILSpy/GlobalUsings.cs deleted file mode 100644 index 12988b1a7..000000000 --- a/ILSpy/GlobalUsings.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2024 Tom Englert for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -global using ICSharpCode.ILSpy.Util; \ No newline at end of file diff --git a/ILSpy/GuessFileType.cs b/ILSpy/GuessFileType.cs deleted file mode 100644 index 6016ab3dc..000000000 --- a/ILSpy/GuessFileType.cs +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.IO; -using System.Text; -using System.Xml; - -namespace ICSharpCode.ILSpy -{ - /// - /// Static methods for determining the type of a file. - /// - static class GuessFileType - { - public static FileType DetectFileType(Stream stream) - { - StreamReader reader; - if (stream.Length >= 2) - { - int firstByte = stream.ReadByte(); - int secondByte = stream.ReadByte(); - switch ((firstByte << 8) | secondByte) - { - case 0xfffe: // UTF-16 LE BOM / UTF-32 LE BOM - case 0xfeff: // UTF-16 BE BOM - stream.Position -= 2; - reader = new StreamReader(stream, detectEncodingFromByteOrderMarks: true); - break; - case 0xefbb: // start of UTF-8 BOM - if (stream.ReadByte() == 0xbf) - { - reader = new StreamReader(stream, Encoding.UTF8); - break; - } - else - { - return FileType.Binary; - } - default: - if (IsUTF8(stream, (byte)firstByte, (byte)secondByte)) - { - stream.Position = 0; - reader = new StreamReader(stream, Encoding.UTF8); - break; - } - else - { - return FileType.Binary; - } - } - } - else - { - return FileType.Binary; - } - // Now we got a StreamReader with the correct encoding - // Check for XML now - try - { - XmlTextReader xmlReader = new XmlTextReader(reader); - xmlReader.XmlResolver = null; - xmlReader.MoveToContent(); - return FileType.Xml; - } - catch (XmlException) - { - return FileType.Text; - } - } - - static bool IsUTF8(Stream fs, byte firstByte, byte secondByte) - { - int max = (int)Math.Min(fs.Length, 500000); // look at max. 500 KB - const int ASCII = 0; - const int Error = 1; - const int UTF8 = 2; - const int UTF8Sequence = 3; - int state = ASCII; - int sequenceLength = 0; - byte b; - for (int i = 0; i < max; i++) - { - if (i == 0) - { - b = firstByte; - } - else if (i == 1) - { - b = secondByte; - } - else - { - b = (byte)fs.ReadByte(); - } - if (b < 0x80) - { - // normal ASCII character - if (state == UTF8Sequence) - { - state = Error; - break; - } - } - else if (b < 0xc0) - { - // 10xxxxxx : continues UTF8 byte sequence - if (state == UTF8Sequence) - { - --sequenceLength; - if (sequenceLength < 0) - { - state = Error; - break; - } - else if (sequenceLength == 0) - { - state = UTF8; - } - } - else - { - state = Error; - break; - } - } - else if (b >= 0xc2 && b < 0xf5) - { - // beginning of byte sequence - if (state == UTF8 || state == ASCII) - { - state = UTF8Sequence; - if (b < 0xe0) - { - sequenceLength = 1; // one more byte following - } - else if (b < 0xf0) - { - sequenceLength = 2; // two more bytes following - } - else - { - sequenceLength = 3; // three more bytes following - } - } - else - { - state = Error; - break; - } - } - else - { - // 0xc0, 0xc1, 0xf5 to 0xff are invalid in UTF-8 (see RFC 3629) - state = Error; - break; - } - } - return state != Error; - } - } - - enum FileType - { - Binary, - Text, - Xml - } -} diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj deleted file mode 100644 index f27a6034c..000000000 --- a/ILSpy/ILSpy.csproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - WinExe - net10.0-windows - major - win-x64;win-arm64 - False - false - false - true - ICSharpCode.ILSpy - - True - - Images\ILSpy-Large.ico - app.manifest - - True - ..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk - true - 1 - true - - - - - - - - full - true - True - - - - pdbonly - true - - - - - - - - - - - - - - - - - - - license.txt - - - - - - - - - - - - True - True - Resources.resx - - - - - - PublicResXFileCodeGenerator - Resources.Designer.cs - - - - - - - - - - - - - - - - - - - - - Microsoft.VCToolsVersion.default.props - $(MSBuildToolsPath)\..\..\..\VC\ - - $(MSBuildToolsPath)\..\..\..\..\VC\ - $(VCBasePath)Auxiliary\Build\$(VCToolsVersionPropsFileNameDefault) - True - - - - $(NoWarn);1701;1702;CA1001;CA2213 - - - - $(NoWarn);1701;1702;CA1001;CA2213 - - - - - - - - - - - - - - powershell -NoProfile -ExecutionPolicy Bypass -File BuildTools/sort-resx.ps1 - - - - - - - - - diff --git a/ILSpy/ILSpySettingsFilePathProvider.cs b/ILSpy/ILSpySettingsFilePathProvider.cs deleted file mode 100644 index 20c0f176b..000000000 --- a/ILSpy/ILSpySettingsFilePathProvider.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2022 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.IO; - -using ICSharpCode.ILSpyX.Settings; - -namespace ICSharpCode.ILSpy -{ - internal class ILSpySettingsFilePathProvider : ISettingsFilePathProvider - { - public string GetSettingsFilePath() - { - if (App.CommandLineArguments.ConfigFile != null) - return App.CommandLineArguments.ConfigFile; - - var assemblyLocation = typeof(MainWindow).Assembly.Location; - if (!String.IsNullOrWhiteSpace(assemblyLocation)) - { - string localPath = Path.Combine(Path.GetDirectoryName(assemblyLocation), "ILSpy.xml"); - if (File.Exists(localPath)) - return localPath; - } - - return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ICSharpCode", "ILSpy.xml"); - } - } -} diff --git a/ILSpy/ILSpyTraceListener.cs b/ILSpy/ILSpyTraceListener.cs deleted file mode 100644 index 3321ec5e2..000000000 --- a/ILSpy/ILSpyTraceListener.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading; - -using ICSharpCode.ILSpy.Controls; - -namespace ICSharpCode.ILSpy -{ - class ILSpyTraceListener : DefaultTraceListener - { - [Conditional("DEBUG")] - public static void Install() - { - Trace.Listeners.Clear(); - Trace.Listeners.Add(new ILSpyTraceListener()); - } - - public ILSpyTraceListener() - { - base.AssertUiEnabled = false; - } - - HashSet ignoredStacks = new HashSet(); - bool dialogIsOpen; - - public override void Fail(string message) - { - this.Fail(message, null); - } - - public override void Fail(string message, string detailMessage) - { - base.Fail(message, detailMessage); // let base class write the assert to the debug console - string topFrame = ""; - string stackTrace = ""; - try - { - stackTrace = new StackTrace(true).ToString(); - var frames = stackTrace.Split('\r', '\n') - .Where(f => f.Length > 0) - .SkipWhile(f => f.Contains("ILSpyTraceListener") || f.Contains("System.Diagnostics")) - .ToList(); - topFrame = frames[0]; - stackTrace = string.Join(Environment.NewLine, frames); - } - catch { } - lock (ignoredStacks) - { - if (ignoredStacks.Contains(topFrame)) - return; - if (dialogIsOpen) - return; - dialogIsOpen = true; - } - // We might be unable to display a dialog here, e.g. because - // we're on the UI thread but dispatcher processing is disabled. - // In any case, we don't want to pump messages while the dialog is displaying, - // so we create a separate UI thread for the dialog: - int result = 0; - var thread = new Thread(() => result = ShowAssertionDialog(message, detailMessage, stackTrace)); - thread.SetApartmentState(ApartmentState.STA); - thread.Start(); - thread.Join(); - if (result == 0) - { // throw - throw new AssertionFailedException(message); - } - else if (result == 1) - { // debug - Debugger.Break(); - } - else if (result == 2) - { // ignore - } - else if (result == 3) - { - lock (ignoredStacks) - { - ignoredStacks.Add(topFrame); - } - } - } - - int ShowAssertionDialog(string message, string detailMessage, string stackTrace) - { - message = message + Environment.NewLine + detailMessage + Environment.NewLine + stackTrace; - string[] buttonTexts = { "Throw", "Debug", "Ignore", "Ignore All" }; - CustomDialog inputBox = new CustomDialog("Assertion Failed", message.TakeStartEllipsis(750), -1, 2, buttonTexts); - inputBox.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - inputBox.ShowInTaskbar = true; // make this window more visible, because it effectively interrupts the decompilation process. - try - { - inputBox.ShowDialog(); - return inputBox.Result; - } - finally - { - dialogIsOpen = false; - inputBox.Dispose(); - } - } - } - - class AssertionFailedException : Exception - { - public AssertionFailedException(string message) : base(message) { } - } -} diff --git a/ILSpy/ISmartTextOutput.cs b/ILSpy/ISmartTextOutput.cs deleted file mode 100644 index 62f283696..000000000 --- a/ILSpy/ISmartTextOutput.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Windows; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.Decompiler; - -namespace ICSharpCode.ILSpy -{ - /// - /// Adds additional WPF-specific output features to . - /// - public interface ISmartTextOutput : ITextOutput - { - /// - /// Inserts an interactive UI element at the current position in the text output. - /// - void AddUIElement(Func element); - - void BeginSpan(HighlightingColor highlightingColor); - void EndSpan(); - - /// - /// Gets/sets the title displayed in the document tab's header. - /// - string Title { get; set; } - } -} diff --git a/ILSpy/Images/AccessOverlayIcon.cs b/ILSpy/Images/AccessOverlayIcon.cs deleted file mode 100644 index 9322ebfba..000000000 --- a/ILSpy/Images/AccessOverlayIcon.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -namespace ICSharpCode.ILSpy -{ - internal enum AccessOverlayIcon - { - Public, - Protected, - Internal, - ProtectedInternal, - Private, - PrivateProtected, - CompilerControlled - } -} diff --git a/ILSpy/Images/Assembly.svg b/ILSpy/Images/Assembly.svg deleted file mode 100644 index f07e9ec99..000000000 --- a/ILSpy/Images/Assembly.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Assembly.xaml b/ILSpy/Images/Assembly.xaml deleted file mode 100644 index 3f7ffdc99..000000000 --- a/ILSpy/Images/Assembly.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/ILSpy/Images/AssemblyList.svg b/ILSpy/Images/AssemblyList.svg deleted file mode 100644 index 948ca46b1..000000000 --- a/ILSpy/Images/AssemblyList.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/AssemblyList.xaml b/ILSpy/Images/AssemblyList.xaml deleted file mode 100644 index 33a32f40a..000000000 --- a/ILSpy/Images/AssemblyList.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/AssemblyListGAC.svg b/ILSpy/Images/AssemblyListGAC.svg deleted file mode 100644 index 80bae75f6..000000000 --- a/ILSpy/Images/AssemblyListGAC.svg +++ /dev/null @@ -1,84 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/ILSpy/Images/AssemblyListGAC.xaml b/ILSpy/Images/AssemblyListGAC.xaml deleted file mode 100644 index 2a779232d..000000000 --- a/ILSpy/Images/AssemblyListGAC.xaml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/AssemblyLoading.svg b/ILSpy/Images/AssemblyLoading.svg deleted file mode 100644 index 9281b25e6..000000000 --- a/ILSpy/Images/AssemblyLoading.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/AssemblyLoading.xaml b/ILSpy/Images/AssemblyLoading.xaml deleted file mode 100644 index cd2fb7143..000000000 --- a/ILSpy/Images/AssemblyLoading.xaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/AssemblyWarning.svg b/ILSpy/Images/AssemblyWarning.svg deleted file mode 100644 index 1a7d200c1..000000000 --- a/ILSpy/Images/AssemblyWarning.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/AssemblyWarning.xaml b/ILSpy/Images/AssemblyWarning.xaml deleted file mode 100644 index 6b3c3531a..000000000 --- a/ILSpy/Images/AssemblyWarning.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/ILSpy/Images/Back.svg b/ILSpy/Images/Back.svg deleted file mode 100644 index 4a752dbc9..000000000 --- a/ILSpy/Images/Back.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Back.xaml b/ILSpy/Images/Back.xaml deleted file mode 100644 index 7ddf0a4df..000000000 --- a/ILSpy/Images/Back.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Class.svg b/ILSpy/Images/Class.svg deleted file mode 100644 index e553c3633..000000000 --- a/ILSpy/Images/Class.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Class.xaml b/ILSpy/Images/Class.xaml deleted file mode 100644 index 465fa3ca4..000000000 --- a/ILSpy/Images/Class.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Close.svg b/ILSpy/Images/Close.svg deleted file mode 100644 index d68f1ae0e..000000000 --- a/ILSpy/Images/Close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Close.xaml b/ILSpy/Images/Close.xaml deleted file mode 100644 index 6543d2d3c..000000000 --- a/ILSpy/Images/Close.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/CollapseAll.svg b/ILSpy/Images/CollapseAll.svg deleted file mode 100644 index a7b706705..000000000 --- a/ILSpy/Images/CollapseAll.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/CollapseAll.xaml b/ILSpy/Images/CollapseAll.xaml deleted file mode 100644 index e0d9a09cd..000000000 --- a/ILSpy/Images/CollapseAll.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Constructor.svg b/ILSpy/Images/Constructor.svg deleted file mode 100644 index 3ca6aedac..000000000 --- a/ILSpy/Images/Constructor.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/ILSpy/Images/Constructor.xaml b/ILSpy/Images/Constructor.xaml deleted file mode 100644 index 19466af25..000000000 --- a/ILSpy/Images/Constructor.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/ILSpy/Images/Copy.svg b/ILSpy/Images/Copy.svg deleted file mode 100644 index 3de60b008..000000000 --- a/ILSpy/Images/Copy.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Copy.xaml b/ILSpy/Images/Copy.xaml deleted file mode 100644 index 1ec44e951..000000000 --- a/ILSpy/Images/Copy.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/Delegate.svg b/ILSpy/Images/Delegate.svg deleted file mode 100644 index 1ba71123f..000000000 --- a/ILSpy/Images/Delegate.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Delegate.xaml b/ILSpy/Images/Delegate.xaml deleted file mode 100644 index 268ddb36e..000000000 --- a/ILSpy/Images/Delegate.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Delete.svg b/ILSpy/Images/Delete.svg deleted file mode 100644 index 0e2c9437e..000000000 --- a/ILSpy/Images/Delete.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Delete.xaml b/ILSpy/Images/Delete.xaml deleted file mode 100644 index ce1d2d715..000000000 --- a/ILSpy/Images/Delete.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/DictionaryContain.svg b/ILSpy/Images/DictionaryContain.svg deleted file mode 100644 index bb184464c..000000000 --- a/ILSpy/Images/DictionaryContain.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/DictionaryContain.xaml b/ILSpy/Images/DictionaryContain.xaml deleted file mode 100644 index f0dd255a2..000000000 --- a/ILSpy/Images/DictionaryContain.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Enum.svg b/ILSpy/Images/Enum.svg deleted file mode 100644 index 010d59d77..000000000 --- a/ILSpy/Images/Enum.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Enum.xaml b/ILSpy/Images/Enum.xaml deleted file mode 100644 index 7f40a3518..000000000 --- a/ILSpy/Images/Enum.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/EnumValue.svg b/ILSpy/Images/EnumValue.svg deleted file mode 100644 index aa901ec19..000000000 --- a/ILSpy/Images/EnumValue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/EnumValue.xaml b/ILSpy/Images/EnumValue.xaml deleted file mode 100644 index 14d6bc387..000000000 --- a/ILSpy/Images/EnumValue.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Event.svg b/ILSpy/Images/Event.svg deleted file mode 100644 index e874ec217..000000000 --- a/ILSpy/Images/Event.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Event.xaml b/ILSpy/Images/Event.xaml deleted file mode 100644 index cbf6d0879..000000000 --- a/ILSpy/Images/Event.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ILSpy/Images/ExpandAll.svg b/ILSpy/Images/ExpandAll.svg deleted file mode 100644 index 6279eada7..000000000 --- a/ILSpy/Images/ExpandAll.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ExpandAll.xaml b/ILSpy/Images/ExpandAll.xaml deleted file mode 100644 index e46b95c82..000000000 --- a/ILSpy/Images/ExpandAll.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ExportOverlay.svg b/ILSpy/Images/ExportOverlay.svg deleted file mode 100644 index d39635968..000000000 --- a/ILSpy/Images/ExportOverlay.svg +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/ExportOverlay.xaml b/ILSpy/Images/ExportOverlay.xaml deleted file mode 100644 index 387c04fb4..000000000 --- a/ILSpy/Images/ExportOverlay.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ExtensionMethod.svg b/ILSpy/Images/ExtensionMethod.svg deleted file mode 100644 index 999349160..000000000 --- a/ILSpy/Images/ExtensionMethod.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ExtensionMethod.xaml b/ILSpy/Images/ExtensionMethod.xaml deleted file mode 100644 index e7c4ad20c..000000000 --- a/ILSpy/Images/ExtensionMethod.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/ILSpy/Images/Field.svg b/ILSpy/Images/Field.svg deleted file mode 100644 index e1b5aa5e3..000000000 --- a/ILSpy/Images/Field.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Field.xaml b/ILSpy/Images/Field.xaml deleted file mode 100644 index c432096c8..000000000 --- a/ILSpy/Images/Field.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/FieldReadOnly.svg b/ILSpy/Images/FieldReadOnly.svg deleted file mode 100644 index c79e4b2d6..000000000 --- a/ILSpy/Images/FieldReadOnly.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/ILSpy/Images/FieldReadOnly.xaml b/ILSpy/Images/FieldReadOnly.xaml deleted file mode 100644 index 2359f6d35..000000000 --- a/ILSpy/Images/FieldReadOnly.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/FindAssembly.svg b/ILSpy/Images/FindAssembly.svg deleted file mode 100644 index ab9d7c6f2..000000000 --- a/ILSpy/Images/FindAssembly.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/FindAssembly.xaml b/ILSpy/Images/FindAssembly.xaml deleted file mode 100644 index ac945aa76..000000000 --- a/ILSpy/Images/FindAssembly.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Folder.Closed.svg b/ILSpy/Images/Folder.Closed.svg deleted file mode 100644 index 481bb01ac..000000000 --- a/ILSpy/Images/Folder.Closed.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Folder.Closed.xaml b/ILSpy/Images/Folder.Closed.xaml deleted file mode 100644 index b6956e77e..000000000 --- a/ILSpy/Images/Folder.Closed.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/Folder.Open.xaml b/ILSpy/Images/Folder.Open.xaml deleted file mode 100644 index fdbccfc54..000000000 --- a/ILSpy/Images/Folder.Open.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ILSpy/Images/FolderOpen.svg b/ILSpy/Images/FolderOpen.svg deleted file mode 100644 index 4c8a03f5b..000000000 --- a/ILSpy/Images/FolderOpen.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Forward.svg b/ILSpy/Images/Forward.svg deleted file mode 100644 index b47d19598..000000000 --- a/ILSpy/Images/Forward.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Forward.xaml b/ILSpy/Images/Forward.xaml deleted file mode 100644 index 85efa5c2a..000000000 --- a/ILSpy/Images/Forward.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Header.svg b/ILSpy/Images/Header.svg deleted file mode 100644 index 44056d1b8..000000000 --- a/ILSpy/Images/Header.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Header.xaml b/ILSpy/Images/Header.xaml deleted file mode 100644 index ea115bdd7..000000000 --- a/ILSpy/Images/Header.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Heap.svg b/ILSpy/Images/Heap.svg deleted file mode 100644 index 72f0dc265..000000000 --- a/ILSpy/Images/Heap.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Heap.xaml b/ILSpy/Images/Heap.xaml deleted file mode 100644 index 2e96c9a8f..000000000 --- a/ILSpy/Images/Heap.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ILSpy-Large.ico b/ILSpy/Images/ILSpy-Large.ico deleted file mode 100644 index 14a26f95a3aa8fa9e1f738502a482a9050d8b123..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 58965 zcmeEt_ghkL{5K#PxK~l`Ju*j`S`IXKnWL<%9B7&|N4W=xnyWH3Gc{8*)3j8y+zZr7 z%M{CjngjP%+<>4DpX>X4|AXhphwD1mb?(FA+&Az0JzwwF0RVsiHo$)$AV2~jp9cWA zGtbr3{%2e&3jm}ruSrP!-!U%$pwaoiV+f!W0su@5006wq>;L`U6AS>vkN@u&0`O!7 z0MEmf7(8_Q3g5r` zb|JwNj8MnsyJ-*ZEn7zTKii!&;`xyFl>fqV>p_0nBt%lLrr*af(IDbN;89>(=2M8+7B}E6YBKk(rdfs<5Ki(f3?#R#j<_^gK9*H)B~>FXdX- z4X2Olwhym8ZEWeS9szpWx3ainC;LV}t*iMAX}YW1u`d8{<-EVe+|R*&bEBMI*1hbb-rO=|agO|5AGDMxC8Rw%^8GP%7 zhh(J6vAMQ9`TgnLde)iiBTMbboCb*mkItL`YLDSQC)2G!nKq|e`~U}lXLMb_3|bm z93?=)xV9~7v7%BA>hTJAT{2Jp7k=>S?vH3(!~zz>_&mFcY1yLZVp`Bo$w7&gj>m&8 zBUSq27_~4m>g-jlHQ4#WnideHvb)%U${=--5u*FH6jgRc)}ssDs8h5Z7u=;?50_&G zJBpJrAi?5~TrJVjH41C~{$!rFEuilFsG|xmLd($lSC2^=9g{anS=;;Q zbX2-yp^79MCvsna(#L{!5^i<-L+B2Zghje9n|?&}A zeO%wW^R)%>Zf7T4zlXXhNf`>)2TjRP&Tqn=9MwfISM^-?SR%@bB;Nf`fY4gKJz9y0 z9-yxKiNjOMfF>-WPLu--AK=L~vQITyksSD5T%MA{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oWvK5+K;b70tj*+K*CW5sgTrOX<@W^s}Kk^ZFv+Kp59J=b5zfux$6LiJBR zT8%TE4+*>CUjswr)I2^h5Pf1zap;;>Y|enpkT*(aT#3}LhX_JNpIwGq-=m-u2qNc? zX=~ee-MHa+^ZhC(XW*uxvSM>}YfL%R`y@FPZZ zMlR1ktShsQ5O^!MVw>|P;rY8dA$^8MzKpX~M5{T+Syr-+@N#&Ihq<+%+ARYeSPHB| zX&jud|Jc`1dEJJUeNT(xj1#j8(NWe_lx0?kD9wJ+yCf?&O5lG>btaz9m$;~VeA=+1V68QI=j&5%LN0&!fGyb$U$-ru_wX_Iu~*1W zzxnOdH}oGJH~V{P1BwsN^xPJao*O#{V#w?pHVSN=bN_pHdaIa;fPnoi%geOIXU~dA zzkdt1ZFuF}T=F`8OdwOL=c;|;7n$Su;BNjjB6>Ref~Un~c{mAX88R zCjr?0Gt0*v`qdk=SMzz3y5i$1wds>gW%9}5c>29QKa1FXrp%51LduUEVTkXN(}{^8 z#R&JaVS`M_BnC? z5&bWZe?{y*Q|8WpAw>xZ0*i?IfhSd}P_06-?Ra!_q9!Ve&5w*M%#VmDB5-U(#L>)1 z#VSVj{a9YDO765nOS_cer2RxTG< zOIVpJj|}`FhLZ*>&aRTh8p4V9YY9?%*5^MFyU&!l^?xeF{jWqtF~om{okA}EAL2hl q{AY;&4Dp{K?tg{4?>7;<&y@M`pN8gpB6goC)8h*vR~YF400aQ|(WNZ_ diff --git a/ILSpy/Images/Images.cs b/ILSpy/Images/Images.cs deleted file mode 100644 index 5d5fd9249..000000000 --- a/ILSpy/Images/Images.cs +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Windows; -using System.Windows.Media; -using System.Windows.Media.Imaging; - -namespace ICSharpCode.ILSpy -{ - using ICSharpCode.Decompiler.TypeSystem; - - static class Images - { - private static readonly Rect iconRect = new Rect(0, 0, 16, 16); - - static ImageSource Load(string icon) - { - var image = new DrawingImage(LoadDrawingGroup(null, "Images/" + icon)); - if (image.CanFreeze) - { - image.Freeze(); - } - - return image; - } - - public static readonly ImageSource ILSpyIcon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico")); - - public static readonly ImageSource ViewCode = Load("ViewCode"); - public static readonly ImageSource Save = Load("Save"); - public static readonly ImageSource OK = Load("OK"); - - public static readonly ImageSource Delete = Load("Delete"); - public static readonly ImageSource Search = Load("Search"); - - public static readonly ImageSource Assembly = Load("Assembly"); - public static readonly ImageSource AssemblyWarning = Load("AssemblyWarning"); - public static readonly ImageSource AssemblyLoading = Load(nameof(AssemblyLoading)); - public static readonly ImageSource FindAssembly = Load("FindAssembly"); - - public static readonly ImageSource Library = Load("Library"); - public static readonly ImageSource Namespace = Load("Namespace"); - - public static readonly ImageSource ReferenceFolder = Load("ReferenceFolder"); - public static readonly ImageSource NuGet = Load(null, "Images/NuGet.png"); - public static readonly ImageSource MetadataFile = Load("MetadataFile"); - public static readonly ImageSource WebAssemblyFile = Load("WebAssembly"); - public static readonly ImageSource ProgramDebugDatabase = Load("ProgramDebugDatabase"); - - public static readonly ImageSource Metadata = Load("Metadata"); - public static readonly ImageSource Heap = Load("Heap"); - public static readonly ImageSource Header = Load("Header"); - public static readonly ImageSource MetadataTable = Load("MetadataTable"); - public static readonly ImageSource MetadataTableGroup = Load("MetadataTableGroup"); - public static readonly ImageSource ListFolder = Load("ListFolder"); - public static readonly ImageSource ListFolderOpen = Load("ListFolder.Open"); - - public static readonly ImageSource SubTypes = Load("SubTypes"); - public static readonly ImageSource SuperTypes = Load("SuperTypes"); - - public static readonly ImageSource FolderOpen = Load("Folder.Open"); - public static readonly ImageSource FolderClosed = Load("Folder.Closed"); - - public static readonly ImageSource Resource = Load("Resource"); - public static readonly ImageSource ResourceImage = Load("ResourceImage"); - public static readonly ImageSource ResourceResourcesFile = Load("ResourceResourcesFile"); - public static readonly ImageSource ResourceXml = Load("ResourceXml"); - public static readonly ImageSource ResourceXsd = Load("ResourceXslt"); - public static readonly ImageSource ResourceXslt = Load("ResourceXslt"); - - public static readonly ImageSource Class = Load("Class"); - public static readonly ImageSource Struct = Load("Struct"); - public static readonly ImageSource Interface = Load("Interface"); - public static readonly ImageSource Delegate = Load("Delegate"); - public static readonly ImageSource Enum = Load("Enum"); - public static readonly ImageSource Type = Load("ShowPublicOnly"); - - public static readonly ImageSource Field = Load("Field"); - public static readonly ImageSource FieldReadOnly = Load("FieldReadOnly"); - public static readonly ImageSource Literal = Load("Literal"); - public static readonly ImageSource EnumValue = Load("EnumValue"); - - public static readonly ImageSource Method = Load("Method"); - public static readonly ImageSource Constructor = Load("Constructor"); - public static readonly ImageSource VirtualMethod = Load("VirtualMethod"); - public static readonly ImageSource Operator = Load("Operator"); - public static readonly ImageSource ExtensionMethod = Load("ExtensionMethod"); - public static readonly ImageSource PInvokeMethod = Load("PInvokeMethod"); - - public static readonly ImageSource Property = Load("Property"); - public static readonly ImageSource Indexer = Load("Indexer"); - - public static readonly ImageSource Event = Load("Event"); - - private static readonly ImageSource OverlayProtected = Load("OverlayProtected"); - private static readonly ImageSource OverlayInternal = Load("OverlayInternal"); - private static readonly ImageSource OverlayProtectedInternal = Load("OverlayProtectedInternal"); - private static readonly ImageSource OverlayPrivate = Load("OverlayPrivate"); - private static readonly ImageSource OverlayPrivateProtected = Load("OverlayPrivateProtected"); - private static readonly ImageSource OverlayCompilerControlled = Load("OverlayCompilerControlled"); - private static readonly ImageSource OverlayReference = Load("ReferenceOverlay"); - - private static readonly ImageSource OverlayStatic = Load("OverlayStatic"); - private static readonly ImageSource OverlayExtension = Load("OverlayExtension"); - - public static readonly ImageSource TypeReference = GetIcon("ShowPublicOnly", "ReferenceOverlay"); - public static readonly ImageSource MethodReference = GetIcon("Method", "ReferenceOverlay"); - public static readonly ImageSource FieldReference = GetIcon("Field", "ReferenceOverlay"); - public static readonly ImageSource ExportedType = GetIcon("ShowPublicOnly", "ExportOverlay"); - - public static ImageSource Load(object part, string icon) - { - if (icon.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) - return LoadImage(part, icon); - Uri uri = GetUri(part, icon + ".xaml"); - if (ResourceExists(uri)) - { - var image = new DrawingImage(LoadDrawingGroup(part, icon)); - if (image.CanFreeze) - { - image.Freeze(); - } - return image; - } - return LoadImage(part, icon + ".png"); - } - - static BitmapImage LoadImage(object part, string icon) - { - Uri uri = GetUri(part, icon); - BitmapImage image = new BitmapImage(uri); - if (image.CanFreeze) - { - image.Freeze(); - } - return image; - } - - public static Drawing LoadDrawingGroup(object part, string icon) - { - return (Drawing)Application.LoadComponent(GetUri(part, icon + ".xaml", absolute: false)); - } - - private static Uri GetUri(object part, string icon, bool absolute = true) - { - Uri uri; - var assembly = part?.GetType().Assembly; - string prefix; - UriKind kind; - if (absolute) - { - prefix = "pack://application:,,,/"; - kind = UriKind.Absolute; - } - else - { - prefix = "/"; - kind = UriKind.Relative; - } - if (part == null || assembly == typeof(Images).Assembly) - { - uri = new Uri(prefix + icon, kind); - } - else - { - var name = assembly.GetName(); - uri = new Uri(prefix + name.Name + ";v" + name.Version + ";component/" + icon, kind); - } - - return uri; - } - - private static bool ResourceExists(Uri uri) - { - try - { - Application.GetResourceStream(uri); - return true; - } - catch (IOException) - { - return false; - } - } - - private static readonly TypeIconCache typeIconCache = new TypeIconCache(); - private static readonly MemberIconCache memberIconCache = new MemberIconCache(); - - public static ImageSource GetIcon(TypeIcon icon, AccessOverlayIcon overlay, bool isStatic = false, bool isExtension = false) - { - lock (typeIconCache) - return typeIconCache.GetIcon(icon, overlay, isStatic, isExtension); - } - - public static ImageSource GetIcon(MemberIcon icon, AccessOverlayIcon overlay, bool isStatic, bool isExtension) - { - lock (memberIconCache) - return memberIconCache.GetIcon(icon, overlay, isStatic, isExtension); - } - - public static AccessOverlayIcon GetOverlayIcon(Accessibility accessibility) - { - switch (accessibility) - { - case Accessibility.Public: - return AccessOverlayIcon.Public; - case Accessibility.Internal: - return AccessOverlayIcon.Internal; - case Accessibility.ProtectedAndInternal: - return AccessOverlayIcon.PrivateProtected; - case Accessibility.Protected: - return AccessOverlayIcon.Protected; - case Accessibility.ProtectedOrInternal: - return AccessOverlayIcon.ProtectedInternal; - case Accessibility.Private: - return AccessOverlayIcon.Private; - default: - return AccessOverlayIcon.CompilerControlled; - } - } - - private static ImageSource GetIcon(string baseImage, string overlay = null, bool isStatic = false, bool isExtension = false) - { - ImageSource baseImageSource = Load(baseImage); - ImageSource overlayImageSource = overlay != null ? Load(overlay) : null; - - return CreateOverlayImage(baseImageSource, overlayImageSource, isStatic, isExtension); - } - - private static ImageSource CreateOverlayImage(ImageSource baseImage, ImageSource overlay, bool isStatic, bool isExtension) - { - var group = new DrawingGroup(); - var baseDrawingGroup = new DrawingGroup(); - - Drawing baseDrawing = new ImageDrawing(baseImage, iconRect); - - baseDrawingGroup.Children.Add(baseDrawing); - - if (isExtension) - { - var extensionGroup = new DrawingGroup(); - extensionGroup.Children.Add(baseDrawingGroup); - baseDrawingGroup.Transform = new ScaleTransform(0.8, 0.8); - extensionGroup.Children.Add(new ImageDrawing(Images.OverlayExtension, iconRect)); - baseDrawingGroup = extensionGroup; - } - - group.Children.Add(baseDrawingGroup); - - if (isStatic) - { - group.Children.Add(new ImageDrawing(Images.OverlayStatic, iconRect)); - } - - if (overlay != null) - { - baseDrawingGroup.Transform = new ScaleTransform(0.8, 0.8); - group.Children.Add(new ImageDrawing(overlay, iconRect)); - } - - var image = new DrawingImage(group); - if (image.CanFreeze) - { - image.Freeze(); - } - return image; - } - - #region icon caches & overlay management - - private class TypeIconCache : IconCache - { - public TypeIconCache() - { - PreloadPublicIconToCache(TypeIcon.Class, Images.Class); - PreloadPublicIconToCache(TypeIcon.Enum, Images.Enum); - PreloadPublicIconToCache(TypeIcon.Struct, Images.Struct); - PreloadPublicIconToCache(TypeIcon.Interface, Images.Interface); - PreloadPublicIconToCache(TypeIcon.Delegate, Images.Delegate); - } - - protected override ImageSource GetBaseImage(TypeIcon icon) - { - ImageSource baseImage; - switch (icon) - { - case TypeIcon.Class: - baseImage = Images.Class; - break; - case TypeIcon.Enum: - baseImage = Images.Enum; - break; - case TypeIcon.Struct: - baseImage = Images.Struct; - break; - case TypeIcon.Interface: - baseImage = Images.Interface; - break; - case TypeIcon.Delegate: - baseImage = Images.Delegate; - break; - default: - throw new ArgumentOutOfRangeException(nameof(icon), $"TypeIcon.{icon} is not supported!"); - } - - return baseImage; - } - } - - private class MemberIconCache : IconCache - { - public MemberIconCache() - { - PreloadPublicIconToCache(MemberIcon.Field, Images.Field); - PreloadPublicIconToCache(MemberIcon.FieldReadOnly, Images.FieldReadOnly); - PreloadPublicIconToCache(MemberIcon.Literal, Images.Literal); - PreloadPublicIconToCache(MemberIcon.EnumValue, Images.EnumValue); - PreloadPublicIconToCache(MemberIcon.Property, Images.Property); - PreloadPublicIconToCache(MemberIcon.Indexer, Images.Indexer); - PreloadPublicIconToCache(MemberIcon.Method, Images.Method); - PreloadPublicIconToCache(MemberIcon.Constructor, Images.Constructor); - PreloadPublicIconToCache(MemberIcon.VirtualMethod, Images.VirtualMethod); - PreloadPublicIconToCache(MemberIcon.Operator, Images.Operator); - PreloadPublicIconToCache(MemberIcon.PInvokeMethod, Images.PInvokeMethod); - PreloadPublicIconToCache(MemberIcon.Event, Images.Event); - } - - protected override ImageSource GetBaseImage(MemberIcon icon) - { - ImageSource baseImage; - switch (icon) - { - case MemberIcon.Field: - baseImage = Images.Field; - break; - case MemberIcon.FieldReadOnly: - baseImage = Images.FieldReadOnly; - break; - case MemberIcon.Literal: - baseImage = Images.Literal; - break; - case MemberIcon.EnumValue: - baseImage = Images.EnumValue; - break; - case MemberIcon.Property: - baseImage = Images.Property; - break; - case MemberIcon.Indexer: - baseImage = Images.Indexer; - break; - case MemberIcon.Method: - baseImage = Images.Method; - break; - case MemberIcon.Constructor: - baseImage = Images.Constructor; - break; - case MemberIcon.VirtualMethod: - baseImage = Images.VirtualMethod; - break; - case MemberIcon.Operator: - baseImage = Images.Operator; - break; - case MemberIcon.PInvokeMethod: - baseImage = Images.PInvokeMethod; - break; - case MemberIcon.Event: - baseImage = Images.Event; - break; - default: - throw new ArgumentOutOfRangeException(nameof(icon), $"MemberIcon.{icon} is not supported!"); - } - - return baseImage; - } - } - - private abstract class IconCache - { - private readonly Dictionary<(T, AccessOverlayIcon, bool, bool), ImageSource> cache = new Dictionary<(T, AccessOverlayIcon, bool, bool), ImageSource>(); - - protected void PreloadPublicIconToCache(T icon, ImageSource image) - { - var iconKey = (icon, AccessOverlayIcon.Public, false, false); - cache.Add(iconKey, image); - } - - public ImageSource GetIcon(T icon, AccessOverlayIcon overlay, bool isStatic, bool isExtension) - { - var iconKey = (icon, overlay, isStatic, isExtension); - if (cache.ContainsKey(iconKey)) - { - return cache[iconKey]; - } - else - { - ImageSource result = BuildMemberIcon(icon, overlay, isStatic, isExtension); - cache.Add(iconKey, result); - return result; - } - } - - private ImageSource BuildMemberIcon(T icon, AccessOverlayIcon overlay, bool isStatic, bool isExtension) - { - ImageSource baseImage = GetBaseImage(icon); - ImageSource overlayImage = GetOverlayImage(overlay); - - return CreateOverlayImage(baseImage, overlayImage, isStatic, isExtension); - } - - protected abstract ImageSource GetBaseImage(T icon); - - private static ImageSource GetOverlayImage(AccessOverlayIcon overlay) - { - ImageSource overlayImage; - switch (overlay) - { - case AccessOverlayIcon.Public: - overlayImage = null; - break; - case AccessOverlayIcon.Protected: - overlayImage = Images.OverlayProtected; - break; - case AccessOverlayIcon.Internal: - overlayImage = Images.OverlayInternal; - break; - case AccessOverlayIcon.ProtectedInternal: - overlayImage = Images.OverlayProtectedInternal; - break; - case AccessOverlayIcon.Private: - overlayImage = Images.OverlayPrivate; - break; - case AccessOverlayIcon.PrivateProtected: - overlayImage = Images.OverlayPrivateProtected; - break; - case AccessOverlayIcon.CompilerControlled: - overlayImage = Images.OverlayCompilerControlled; - break; - default: - throw new ArgumentOutOfRangeException(nameof(overlay), $"AccessOverlayIcon.{overlay} is not supported!"); - } - return overlayImage; - } - } - - #endregion - } -} diff --git a/ILSpy/Images/Indexer.svg b/ILSpy/Images/Indexer.svg deleted file mode 100644 index ff55f31ff..000000000 --- a/ILSpy/Images/Indexer.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Indexer.xaml b/ILSpy/Images/Indexer.xaml deleted file mode 100644 index 053a93e5d..000000000 --- a/ILSpy/Images/Indexer.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ILSpy/Images/Interface.svg b/ILSpy/Images/Interface.svg deleted file mode 100644 index 0c08c8d50..000000000 --- a/ILSpy/Images/Interface.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Interface.xaml b/ILSpy/Images/Interface.xaml deleted file mode 100644 index 86ca1ef23..000000000 --- a/ILSpy/Images/Interface.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Library.svg b/ILSpy/Images/Library.svg deleted file mode 100644 index 0ffa85f60..000000000 --- a/ILSpy/Images/Library.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Library.xaml b/ILSpy/Images/Library.xaml deleted file mode 100644 index d1a8a5f86..000000000 --- a/ILSpy/Images/Library.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/ILSpy/Images/ListFolder.Open.svg b/ILSpy/Images/ListFolder.Open.svg deleted file mode 100644 index b7b5c2bdc..000000000 --- a/ILSpy/Images/ListFolder.Open.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ListFolder.Open.xaml b/ILSpy/Images/ListFolder.Open.xaml deleted file mode 100644 index e76083235..000000000 --- a/ILSpy/Images/ListFolder.Open.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ListFolder.svg b/ILSpy/Images/ListFolder.svg deleted file mode 100644 index b9c47a7dd..000000000 --- a/ILSpy/Images/ListFolder.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ListFolder.xaml b/ILSpy/Images/ListFolder.xaml deleted file mode 100644 index a154bef40..000000000 --- a/ILSpy/Images/ListFolder.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Literal.svg b/ILSpy/Images/Literal.svg deleted file mode 100644 index 45c0171e7..000000000 --- a/ILSpy/Images/Literal.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Literal.xaml b/ILSpy/Images/Literal.xaml deleted file mode 100644 index 693bba38e..000000000 --- a/ILSpy/Images/Literal.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/ILSpy/Images/MemberIcon.cs b/ILSpy/Images/MemberIcon.cs deleted file mode 100644 index 71214e7e0..000000000 --- a/ILSpy/Images/MemberIcon.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -namespace ICSharpCode.ILSpy -{ - internal enum MemberIcon - { - Literal, - FieldReadOnly, - Field, - EnumValue, - Property, - Indexer, - Method, - Constructor, - VirtualMethod, - Operator, - PInvokeMethod, - Event - } -} diff --git a/ILSpy/Images/Metadata.svg b/ILSpy/Images/Metadata.svg deleted file mode 100644 index eb8ff3865..000000000 --- a/ILSpy/Images/Metadata.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Metadata.xaml b/ILSpy/Images/Metadata.xaml deleted file mode 100644 index 53d0ab957..000000000 --- a/ILSpy/Images/Metadata.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/MetadataFile.svg b/ILSpy/Images/MetadataFile.svg deleted file mode 100644 index ce9cb449e..000000000 --- a/ILSpy/Images/MetadataFile.svg +++ /dev/null @@ -1,73 +0,0 @@ - - diff --git a/ILSpy/Images/MetadataFile.xaml b/ILSpy/Images/MetadataFile.xaml deleted file mode 100644 index 5122e7d20..000000000 --- a/ILSpy/Images/MetadataFile.xaml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/MetadataTable.svg b/ILSpy/Images/MetadataTable.svg deleted file mode 100644 index b333a0a25..000000000 --- a/ILSpy/Images/MetadataTable.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/MetadataTable.xaml b/ILSpy/Images/MetadataTable.xaml deleted file mode 100644 index 4866c51a2..000000000 --- a/ILSpy/Images/MetadataTable.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/MetadataTableGroup.svg b/ILSpy/Images/MetadataTableGroup.svg deleted file mode 100644 index 9af5cdc53..000000000 --- a/ILSpy/Images/MetadataTableGroup.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/MetadataTableGroup.xaml b/ILSpy/Images/MetadataTableGroup.xaml deleted file mode 100644 index df2cc7490..000000000 --- a/ILSpy/Images/MetadataTableGroup.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Method.svg b/ILSpy/Images/Method.svg deleted file mode 100644 index 9706fa408..000000000 --- a/ILSpy/Images/Method.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Method.xaml b/ILSpy/Images/Method.xaml deleted file mode 100644 index 784ade333..000000000 --- a/ILSpy/Images/Method.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/Namespace.svg b/ILSpy/Images/Namespace.svg deleted file mode 100644 index 772b9152c..000000000 --- a/ILSpy/Images/Namespace.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Namespace.xaml b/ILSpy/Images/Namespace.xaml deleted file mode 100644 index 9b3348860..000000000 --- a/ILSpy/Images/Namespace.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ILSpy/Images/NuGet.png b/ILSpy/Images/NuGet.png deleted file mode 100644 index 0f7717cf585287b7076153919481e13c5f1b1d63..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13750 zcmV;nHA%{eP)agRh9R-Z>g%@JL&8R z350zOpr|oOqOyoG;5aHSe4^q8sNjg`pn~9hexD;FZu7Y?3ND|>C$b5nsGtaf29kgR z35h`VgzhBWUEN*ld-s0luJ68Aud2J#U7a|l^1FGjUM>CVo^$?Zx#yfq7-MkY@%Q^6 z2N>W0100xz0}OEB@psDrhaYj&fm!%Fet4t3;r2hRJQy+Jjf}GM@VJ6%z(C}n6n;k; zy9*e(^JR0pHy)VIseepVfa@Xv622R0d_%zKyQ@g)5Gl_n0F|^?|KS%90xl4sA^pAs z&gHK>X!^hbviyxRz@2}3Y(t~P&mAe!SU@3 zj=|vqk{@6YLiUf#7tj3d0n+@9GQgcHAAfg1=}n~|gcn9A{9rSK=Y|1FA%kj&2*9N9 zJIDnYe18_HzPJtG{CNx(v=H!!13|g+=1b0f&Fvf3uRCC2?&l2P_Vmm!PwrUx*og@B zw;=Iz5BG)e)eRK33{%LLDU9GKAO{pH6v|-;)hdHBGD!s)qrXJq=|Kh^Xi?0}AR4&t zS<7F4?gOhIynp+i-MbD@sfiDpetYw9>?f468<4o&>jp!(>A3*<3jySd0Sw_7DF;w0 zg;1^pP{w1iRD}Y6tx$zLzHdi9gj=2uU;`e}PUvdy>i#l*rH>p+4v=a8eHaF~{f{fT zvA1Hd62iCESE0Wc3gVBH0;u4%5T&1@#Iq{Jf#)~^yk5cAM~YR!2m{CnKiwF@a6rNF z{bm35qubufQRcuj{|zue$k=(+5dFIC0rZUoDBV>kl_lX>5C9_2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iQj){w)tjr@y(jhvA@Z&%vSd z_{gGxC%1!RR1*H?8~**4wNI?cbI4ago;>>b!!u^|R5owk5>909_X`F{sDu{92yJJ- z^=*f|{`_}b(mkVRh2yv#+8nD?7;M>9fnCT5TM!vaWeUB6K`rzHYuImsK?5d8t4d{c z`tY+_;zM%X!HEpQgJxv}k!N*hV8JXO4w{)Y%p$UBg6fXmZCmfT`GzmwvUbgyJibsx zcdv-(G2*!Ha7#-|Y2m_yg4=&~8=WZq_8SIBL=Cfw5x8n-<vz7jUdEm!;qg5M)b%62@0WUdrdLm0wv1k@w(0wC#{d=@a7M@|)zGRKfqg*Pi4})-c z&#t~zy<4|!_{(D}*WZ8lUEAflkj^#b0KYXZGtDN|hk8Cy@wzs#@uC6Yoi4Jun{_mCn zQkWrxlr-nbdR%?=HKP*xsi&S6@9FI7B#jJ!e15RT&OGk8V_7|0 \ No newline at end of file diff --git a/ILSpy/Images/OK.xaml b/ILSpy/Images/OK.xaml deleted file mode 100644 index c560e5bca..000000000 --- a/ILSpy/Images/OK.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Open.svg b/ILSpy/Images/Open.svg deleted file mode 100644 index 8284b8ba4..000000000 --- a/ILSpy/Images/Open.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Open.xaml b/ILSpy/Images/Open.xaml deleted file mode 100644 index 7c2b6b50e..000000000 --- a/ILSpy/Images/Open.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Operator.svg b/ILSpy/Images/Operator.svg deleted file mode 100644 index 806381c45..000000000 --- a/ILSpy/Images/Operator.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Operator.xaml b/ILSpy/Images/Operator.xaml deleted file mode 100644 index 45da6efb0..000000000 --- a/ILSpy/Images/Operator.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/OverlayCompilerControlled.svg b/ILSpy/Images/OverlayCompilerControlled.svg deleted file mode 100644 index b2ef0e8e3..000000000 --- a/ILSpy/Images/OverlayCompilerControlled.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayCompilerControlled.xaml b/ILSpy/Images/OverlayCompilerControlled.xaml deleted file mode 100644 index a49ec5a26..000000000 --- a/ILSpy/Images/OverlayCompilerControlled.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/OverlayExtension.svg b/ILSpy/Images/OverlayExtension.svg deleted file mode 100644 index 231935c44..000000000 --- a/ILSpy/Images/OverlayExtension.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - diff --git a/ILSpy/Images/OverlayExtension.xaml b/ILSpy/Images/OverlayExtension.xaml deleted file mode 100644 index 94370168f..000000000 --- a/ILSpy/Images/OverlayExtension.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayInternal.svg b/ILSpy/Images/OverlayInternal.svg deleted file mode 100644 index 354024b95..000000000 --- a/ILSpy/Images/OverlayInternal.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayInternal.xaml b/ILSpy/Images/OverlayInternal.xaml deleted file mode 100644 index ae2a37ff59855a5123b89d4279d2fa2e5f067661..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2976 zcmcJROK;Oa6ou~^iT_~1wo3d?fPz|?|!~NV}Y+7*<9W);KRbQ*2gQ@vepZZmx)QqCLFD5s5qPN>aMgbY**Q^WR?72QS@E2t!Y0aT6LCLn z+KX#D?!(qD#njDwdtYj@YQ;0t(?m5{ z>aA$uD&b~YsdZ0;o@iI9Ic5vpsjDLJ&$Lno4#$;&4Zc(uaGWvIRqMIjvSoUnhvBw? zDS~CxXeCs)-eAgt9fj;Eg>!kb(?nb?N8(qMfpmO>b~@RGQsAwGD!7v|_A{F#ZZ z5YFx3dA9ZSAzURkcGSX-;XDg;CR!BFC4$Tl`8=Ep&T~a9iLPgcykI%Ldb}5bhm(mf zs6HF{BXfAn{xR#ok>!Q%c>Co6aBV;}l_X-AstXBMB)*tT{(O;bwo#{uKhH3i#U1s3}C{_f@rT^YmCF}XbRJ_1Dr z5VH`e1RirbB8*}sx z{~ai#YXAy^UzzNg2OKriSI}XcYY%aV+SA9;KXff;qm5KZH|Aq`1?Spc1sfxdZzWEp zo5%QE8#t35kBZ#4Z&*Y7I4YQ|VLjD87QdnXYVzS4i629_ZojrwhA*7<7ftg8zHfg3 D5|~*d diff --git a/ILSpy/Images/OverlayPrivate.svg b/ILSpy/Images/OverlayPrivate.svg deleted file mode 100644 index 1d2c52d96..000000000 --- a/ILSpy/Images/OverlayPrivate.svg +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayPrivate.xaml b/ILSpy/Images/OverlayPrivate.xaml deleted file mode 100644 index c05c10fde1657998f8e7d1c2ee2afb6b7da8b79b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1438 zcmchX%}yIZ5QOW@Q>@_3+WYG@A{-zJIfQHOmIJXRY>*uc$-^i4s>f?23+E6;(WpH= zHQhDUJ+uDx^IY$>(nQaiYpJigX7!*aJu1_S7P<#r>z$4@(>KPW&NN`GH3hjPVuGJD z&q18K#_ovBSwDaew%m8{4OD8#Xz^aiH2(n36-;YvN!|pTley%~3mu^&(_xjluFx@u z=S#3GcR4BV8dj^gg>|Lxd(~#T1byP{S=4wE>a4II$DF>;;cnchpo%PhXF82}vz=$# zl_P!-n^9w5$=|8^Adhxuhg2=Lima=^-(U^)5gTKlv4YxiR%3RC5tVlH@UJ2==boyF zY}5rlCZ_`(gLe$G8Y@v{w8cuW4$Qq9#YrWr8hn4}({8sRua3No_mUBrliT49u_{h* zB?X?(H?PqO-xXEZzw2>->z)tw*f;MEx_8#;PUrN){hHzxczzG|N^s8|h$~A`smg|0 z+Ba}_%T>C5=agi-+h(kTGvQT4y|Vfh`d(YcG<++p!y7UCENf{PNnaCu$*(!jv8fiH zll(Gbtft@dtM*;Ex*i+t6eiB}MWmNda6b!Jtj#y*D*ReD^vQ7z-f8$vM7mS1HgRmi mD41|EWJ^T - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayPrivateProtected.xaml b/ILSpy/Images/OverlayPrivateProtected.xaml deleted file mode 100644 index ee0b0c8278cb29a2295ed2c03270266e9ce6e4ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2826 zcmchZO>YxH42FG1;y;YanPk5=iwXydC`LKPa# zet6!oUwdrt{`z@n@9f5=_TA>TurGG3w=27~YYTR7m-bcCrMAaDqrRGBWrkZo@T*&4d zdv4FfB-k*|ksXQ2T$(;dJ&UznzVld`VRA0bH}+%8<6v(ky_Nl0^z%hz2+K4MWPe)+ z5jnA3o`iUv*~@spTis`?HxLiP2Km{0^KZP~8>9I%hk3y%*9o*%3STPf6EWyCKSsW+ z<#Dam9Xa^4nrSud%C$GG9>phCE1_$}r_x{*StbecEbizendq(6=pqvPpfX8VDTEJt z2FE^dP2{o<2XC+-a^cA#m^pUS7kE~}cJeTbmI|TwV;u*oi33jVPZMpRnfQQ%H}T3O zaleTpJlF+8P%!Ky%Y`QDeiDC2!4MsIMD!=R_NS9pog49+2vZASc^Ae)L}YnS|I! zJQj48{*3(1^R$;zfwczyJA(XZ^_Fs~w?L(0h4cRqpU_XXI^&>T8g%;PA=<#DH=bvj z>>&3*CPr@Exst)*NjqPPCHKeTNmiu{q%w&CzS4W>2#x%N+nFX_QJ<+x;tMijRces6 z356zP^a+p3NLtZMHDCoBSoB`vC*iVnlt-?LdZ;kCWSTDTq80j)*De~%m`7B++n|F| z8}u1ayEZsg?~Hg0+AA2J-NV!u@y{jH314TtOfpyy18Nx=9AQI`YgchVMxD_M$RDy| z7@0*~ZPZDG@I0YCcKAzvat^JoZpk^heJsPkZS8WRj;Snqk@JU}`-N7%9>mV~-w8wO;5B{n&evqK&Z#p86RBOmHdYUrPJ=wI-$J^okr E8y}EJH2?qr diff --git a/ILSpy/Images/OverlayProtected.svg b/ILSpy/Images/OverlayProtected.svg deleted file mode 100644 index 931b970ee..000000000 --- a/ILSpy/Images/OverlayProtected.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayProtected.xaml b/ILSpy/Images/OverlayProtected.xaml deleted file mode 100644 index 399719a34993bf7fc046098656ab345384858114..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1290 zcmb_cO;3YB5PfG8{{yM#Lg@zuQ$47$9`x$H(N;+Mm14E}oo_I@eeX|a>V zJ8eDISyl75ysn`UZRftcW|mWr9Y_#U@h+#bY!m5mrA&Qvc-k@CXQf>`X%X)e?Gu-^ zPEw`3=+!7CsL-D(IBBVpxo@L_E zzFw2_tLnNphLBIi2(3!_i>+lExEQM5RVfD9JKn_flAkaaxlO;Q$R#1Fx>b$(E>)$B zlnTit>_2<0zLoQEucguVURQmtR#K|kX(c5}R8^_ls@>g?xVQ;YO&zNuRLa-2j;UjL n+v++siT+egu}ei=yfV7WO84V8JqP@f_WiT={RL< diff --git a/ILSpy/Images/OverlayProtectedInternal.svg b/ILSpy/Images/OverlayProtectedInternal.svg deleted file mode 100644 index 17bb1986f..000000000 --- a/ILSpy/Images/OverlayProtectedInternal.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayProtectedInternal.xaml b/ILSpy/Images/OverlayProtectedInternal.xaml deleted file mode 100644 index b5d2a81d4bc339e7409497c0faa4822d26aff60b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3318 zcmb`KUr!TJ5XI-&#P6`dXWDMN+ZKa9h>;il5JbT?kwQQe`S9xb-NWtOLKo1G&C=bu zXJ*d)yLb8Xdq3XCMI6P?SjH;8#-ZNM;wsLgit9LyZ<1cdo7jm(eAjgzuVbj|GCoUk zEX0wX2l`z~g6^g66CnqBKa+fTYx_j@hB1zjuBo1`rHTEaY+lIHrS6sVj&v`jxsuPf z@iJbBNfrG(2XP=KOIiAo?5sLk);yGDm>kRUMf|!GaTV_*y^{Y$it|-s2+Mr!$p2j% zWaLxSilj<^7qOduf872qZr?!M2wN%663zed`Vd^x_1(`4P7_sN6pb>zC!IYpm`k!3 ztyXGDTS*QQ`?2Knm*U3_M$cdh4%EDZE52da zBvz9Rn{CpExowVwqjwrfaxASRGrhqEUV~0_+c5Sz60Vgs@=~WvY{L>Ad78*0agYUM z^W+o#iPm!#CVGdRGYgk0KI*n*;+rI&u-{z8{zOsOzO|;wPb*m?n{!?GDQkFXC56SN z#YUQBis<-#$|{w`JA7L`Q@ycR(iN^f-2@k}5H(nQf!JiiOt4A}C2p!u^u$5zp-?{O#Y_2(C@<%>sZ)s z*O)8WV;0eO{7=K$*GM__6nRFSQ`d~{&77E@Mt-OiGH}dOu1NL`rZ2lM2xOp zwn^2x^#n&XTped(6TuErrqR)E!@2KZhc9YRl+**xdFo3=N=(!!?-ko|CCBWmKPE^>hX0zH0~WH z#5HOp_4nxgJojOq^II;@2EPx@2eZIb - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/ILSpy/Images/OverlayStatic.xaml b/ILSpy/Images/OverlayStatic.xaml deleted file mode 100644 index fee145f39e38a72bfc13fb79d3fa289286929bb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 944 zcmb`G%}>HW5XIlw#Q&kedp{5~8uZ{t@#573w?;vlU?HtU^p976({>dKuG7~wN>Z4fN}g;D zRUwBko02iix!xNcd%7aKd=TWIJMx(P1_cu9gBKPFO+V1cX7*7vBk>%`sM6E}k zzuo*zSB#<<#@o_IC2O0mW9HxI*3(*p+dFT%?9A;)#MVzA+}XyeYI-|z#vj#YJk6RJ zXWd$d^B?~>iyrLG_PtSCPp04XzpEzPn#DT8A#DQNFFfGA+y1P!FLocM`gXnnC4q$) diff --git a/ILSpy/Images/PInvokeMethod.svg b/ILSpy/Images/PInvokeMethod.svg deleted file mode 100644 index 4db51d198..000000000 --- a/ILSpy/Images/PInvokeMethod.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/ILSpy/Images/PInvokeMethod.xaml b/ILSpy/Images/PInvokeMethod.xaml deleted file mode 100644 index 12c70e437..000000000 --- a/ILSpy/Images/PInvokeMethod.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ProgramDebugDatabase.svg b/ILSpy/Images/ProgramDebugDatabase.svg deleted file mode 100644 index 4c4e7b241..000000000 --- a/ILSpy/Images/ProgramDebugDatabase.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ProgramDebugDatabase.xaml b/ILSpy/Images/ProgramDebugDatabase.xaml deleted file mode 100644 index 098b63518..000000000 --- a/ILSpy/Images/ProgramDebugDatabase.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Property.svg b/ILSpy/Images/Property.svg deleted file mode 100644 index 6b5b18a08..000000000 --- a/ILSpy/Images/Property.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Property.xaml b/ILSpy/Images/Property.xaml deleted file mode 100644 index a7ced2d70..000000000 --- a/ILSpy/Images/Property.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ILSpy/Images/README.md b/ILSpy/Images/README.md deleted file mode 100644 index 6d78750cc..000000000 --- a/ILSpy/Images/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Icons used in ILSpy: --------------------- - -| | SVG | XAML | Origin | Notes | -|---------------------------|-----|------|---------------------------------------------------------------------------------|---------| -| Assembly | x | x | VS 2017 Icon Pack (Reference) | | -| AssemblyList | x | x | VS 2017 Icon Pack (AddReference) | | -| AssemblyListGAC | x | x | based on VS 2017 Icon Pack (AddReference) + "GAC" text | | -| AssemblyWarning | x | x | VS 2017 Icon Pack (ReferenceWarning) | | -| Back | x | x | VS 2017 Icon Pack (Backward) | | -| Class | x | x | VS 2017 Icon Pack (Class) | | -| Close | x | x | VS 2017 Icon Pack (Clear) | | -| CollapseAll | x | x | VS 2017 Icon Pack (CollapseAll) | | -| Constructor | x | x | based on VS 2017 Icon Pack (Method) using a different colour | | -| Copy | x | x | VS 2017 Icon Pack (Copy) | | -| Delegate | x | x | VS 2017 Icon Pack (Delegate) | | -| Delete | x | x | VS 2017 Icon Pack (Remove_color) | | -| DictionaryContain | x | x | VS 2017 Icon Pack (DictionaryContain) | | -| Enum | x | x | VS 2017 Icon Pack (Enumerator) | | -| EnumValue | x | x | VS 2017 Icon Pack (EnumItem) | | -| Event | x | x | VS 2017 Icon Pack (Event) | | -| ExpandAll | x | x | VS 2017 Icon Pack (ExpandAll) | | -| ExportOverlay | x | x | slightly modified VS 2017 Icon Pack (Export) | | -| ExtensionMethod | x | x | VS 2017 Icon Pack (ExtensionMethod) | | -| Field | x | x | VS 2017 Icon Pack (Field) | | -| FieldReadOnly | x | x | VS 2017 Icon Pack (Field) with different color | | -| FindAssembly | x | x | based on VS 2017 Icon Pack (Reference + Search) with transparency modifications | | -| Folder.Closed | x | x | VS 2017 Icon Pack (Folder) | | -| Folder.Open | x | x | VS 2017 Icon Pack (FolderOpen) | | -| Forward | x | x | VS 2017 Icon Pack (Forward) | | -| Header | x | x | VS 2017 Icon Pack (PageHeader) | | -| Heap | x | x | VS 2017 Icon Pack (Datalist) | | -| Indexer | x | x | VS 2017 Icon Pack (Indexer) | | -| Interface | x | x | VS 2017 Icon Pack (Interface) | | -| Library | x | x | VS 2017 Icon Pack (Library) | | -| ListFolder | x | x | VS 2017 Icon Pack (ListFolder) | | -| ListFolder.Open | x | x | VS 2017 Icon Pack (ListFolderOpen) | | -| Literal | x | x | VS 2017 Icon Pack (Literal) | | -| Metadata | x | x | VS 2017 Icon Pack (Metadata) | | -| MetadataFile | x | x | combined ProgramDebugDatabase + Metadata | | -| MetadataTable | x | x | VS 2017 Icon Pack (LinkedTable) | | -| MetadataTableGroup | x | x | VS 2017 Icon Pack (LinkedTableGroup) | | -| Method | x | x | VS 2017 Icon Pack (Method) | | -| Namespace | x | x | VS 2017 Icon Pack (Namespace) | | -| OK | x | x | VS 2017 Icon Pack (StatusOK) | | -| Open | x | x | VS 2017 Icon Pack (Open) | | -| Operator | x | x | VS 2017 Icon Pack (Operator) | | -| OverlayCompilerControlled | x | x | based on VS 2017 Icon Pack (StatusBlocked) | | -| OverlayInternal | x | x | based on VS 2017 Icon Pack (Friend) | | -| OverlayPrivate | x | x | extracted from VS 2017 Icon Pack (ActionPrivate) | | -| OverlayPrivateProtected | x | x | combined OverlayPrivate and OverlayProtected | | -| OverlayProtected | x | x | extracted from VS 2017 Icon Pack (ActionProtected) | | -| OverlayProtectedInternal | x | x | combined OverlayProtected and OverlayInternal | | -| OverlayStatic | x | x | custom | | -| PInvokeMethod | x | x | based on VS 2017 Icon Pack (ExtensionMethod) with rotated arrow | | -| ProgramDebugDatabase | x | x | VS 2017 Icon Pack (ProgramDebugDatabase) | | -| Property | x | x | VS 2017 Icon Pack (Property) | | -| ReferenceFolder | x | x | combined VS 2017 Icon Pack (Reference) two times | | -| ReferenceOverlay | x | x | extracted arrow from VS 2017 Icon Pack (TypeShortcut) | | -| Refresh | x | x | VS 2017 Icon Pack (Refresh) | | -| Resource | x | x | VS 2017 Icon Pack (Document) | | -| ResourceImage | x | x | VS 2017 Icon Pack (Image) | | -| ResourceResourcesFile | x | x | VS 2017 Icon Pack (LocalResources) | | -| ResourceXml | x | x | VS 2017 Icon Pack (XMLFile) | | -| ResourceXsd | x | x | combined VS 2017 Icon Pack (XMLSchema) with the file symbol in ResourceXslt | | -| ResourceXsl | x | x | VS 2017 Icon Pack (XMLTransformation) | | -| ResultToJSON | x | x | VS 2017 Icon Pack (ResultToJSON) | | -| ResourceXslt | x | x | VS 2017 Icon Pack (XSLTTemplate) | | -| Save | x | x | VS 2017 Icon Pack (Save) | | -| Search | x | x | VS 2017 Icon Pack (Search) | | -| SearchMsdn | x | x | based on VS 2017 Icon Pack (Search) + Microsoft Logo | | -| ShowAll | x | x | combined PublicOnly, OverlayPrivate, OverlayProtected, OverlayInternal | | -| ShowPrivateInternal | x | x | combined OverlayPrivate and OverlayInternal | | -| ShowPublicOnly | x | x | VS 2017 Icon Pack (Type) | | -| Sort | x | x | VS 2017 Icon Pack (SortAscending) | | -| Struct | x | x | VS 2017 Icon Pack (Structure) | | -| SubTypes | x | x | based on VS 2017 Icon Pack (BaseType) rotated +90° | | -| SuperTypes | x | x | based on VS 2017 Icon Pack (BaseType) rotated -90° | | -| SwitchSourceOrTarget | x | x | VS 2017 Icon Pack (SwitchSourceOrTarget) | | -| ViewCode | x | x | VS 2017 Icon Pack (GoToSourceCode) | | -| VirtualMethod | x | x | combined VS 2017 Icon Pack (Method) two times | | -| Warning | x | x | VS 2017 Icon Pack (StatusWarning) | | - -Note: All XAML icons from VS 2017 Icon Pack are modified to not include a `Viewbox` XAML root element. We always use a `Drawing`-derived root element. -Note: When changing an icon, start with SVG and use https://github.com/BerndK/SvgToXaml to generate the XAML. The result is much better XAML than what Inkscape produces. \ No newline at end of file diff --git a/ILSpy/Images/ReferenceFolder.svg b/ILSpy/Images/ReferenceFolder.svg deleted file mode 100644 index 469268e6c..000000000 --- a/ILSpy/Images/ReferenceFolder.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/ReferenceFolder.xaml b/ILSpy/Images/ReferenceFolder.xaml deleted file mode 100644 index de230e5ad63f099d3f46a8b4019a119e063539dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2824 zcmc&$O>fgc5S=p;|G_F}JMq^#Mx_Tplnd7$dW%X+BGI%;C=`A?@ZOHsYp=agg({)d zD&Ex$TzHec`Xa9gIs}f z4URRwGyHBrq3i+s2Amnrcc3pi>>J=Mq>v?+!Pg@siN65m9!Ll59pu*7TS)Gp^GsgK z3s{m!+|Eqi!ICYIK3kmKKuRUgflN!TfxMTWfyarw1@!^?H`dQr)vj# z(3jo*h~FH3C34Y!k;eN=@Fwund-HF0eGo3w@0eY;)`AKdXr+P$MjBaxR)EsL${Z(y zn+mimY}%Mx?v<1{)!5`Gy|i=#{v78V@=C8e^cJ)l$n-q5C=I>~tEcFAQ;R~b8afNB zm)I%J8O|%L96Yr};f>xdaXZzlT1v>VmP)L)mk7P!O$x5edg~+M@xAUkz?svaw#}hY z#}LcKi57)O$2?$;G&iBOu}r8h)T7ZY5&L4`3+0&43iJv*F0(04)TO!7n$S83?WKm8 zUB|2%$Gz!o3S;H+7sg60eM+=r2#)Ua?d!?(_Du8PV-!{tZ%Ff1u3b+JjD@fAvajY? zmH&FixuAW;-YP6=Y+lipC3t+TB(@H;lU9fcXFwvHU5%{|#;L+)pX+oZoqgxH^NxQG z`x1AYlbjxu(mvN-W4yFlwR1R+HrV5u;uPUbW#o0rPLZ6JRcD!-VYHZ5akfyWR<`1_ zpc_zKEU2A&4CtJ6-f!if!~Q>$o%Lr1KB>)|^6W8Icp~3B&wcJ(R_R}fjOsLC9lJM+ zarLvu#d|KRL?3r6qo>(n^oFs%z)e^&$~%WlZbmxnQ)0&~Cw=VwbLQo#ouyM@_$JZo zcC^%Q&RtFizQCOFj5Ph`%gmc$^}3jHru)~<)jKutUy7UV1}M{5Z$KUQR1VErBjY!K s^O73paGlP%tg)BESL0a5$gh*e`5Lc?X)aIkUn=&mHTG}tn9P~{1-Uat_W%F@ diff --git a/ILSpy/Images/ReferenceOverlay.svg b/ILSpy/Images/ReferenceOverlay.svg deleted file mode 100644 index 8d6a8ef7a..000000000 --- a/ILSpy/Images/ReferenceOverlay.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - diff --git a/ILSpy/Images/ReferenceOverlay.xaml b/ILSpy/Images/ReferenceOverlay.xaml deleted file mode 100644 index a07e0cb79..000000000 --- a/ILSpy/Images/ReferenceOverlay.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Refresh.svg b/ILSpy/Images/Refresh.svg deleted file mode 100644 index a6f09ee5f..000000000 --- a/ILSpy/Images/Refresh.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Refresh.xaml b/ILSpy/Images/Refresh.xaml deleted file mode 100644 index e6e13697a..000000000 --- a/ILSpy/Images/Refresh.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Resource.svg b/ILSpy/Images/Resource.svg deleted file mode 100644 index 7b36178ab..000000000 --- a/ILSpy/Images/Resource.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Resource.xaml b/ILSpy/Images/Resource.xaml deleted file mode 100644 index 4e973ba91..000000000 --- a/ILSpy/Images/Resource.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/ResourceImage.svg b/ILSpy/Images/ResourceImage.svg deleted file mode 100644 index bfbc17d70..000000000 --- a/ILSpy/Images/ResourceImage.svg +++ /dev/null @@ -1 +0,0 @@ -Image_16x \ No newline at end of file diff --git a/ILSpy/Images/ResourceImage.xaml b/ILSpy/Images/ResourceImage.xaml deleted file mode 100644 index 47f992d43..000000000 --- a/ILSpy/Images/ResourceImage.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/ILSpy/Images/ResourceResourcesFile.svg b/ILSpy/Images/ResourceResourcesFile.svg deleted file mode 100644 index 7f463d7ef..000000000 --- a/ILSpy/Images/ResourceResourcesFile.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ResourceResourcesFile.xaml b/ILSpy/Images/ResourceResourcesFile.xaml deleted file mode 100644 index 22555471b..000000000 --- a/ILSpy/Images/ResourceResourcesFile.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/ResourceXml.svg b/ILSpy/Images/ResourceXml.svg deleted file mode 100644 index c7878bf42..000000000 --- a/ILSpy/Images/ResourceXml.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ResourceXml.xaml b/ILSpy/Images/ResourceXml.xaml deleted file mode 100644 index b20527426..000000000 --- a/ILSpy/Images/ResourceXml.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/ResourceXsd.svg b/ILSpy/Images/ResourceXsd.svg deleted file mode 100644 index 51d6cadac..000000000 --- a/ILSpy/Images/ResourceXsd.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/ResourceXsd.xaml b/ILSpy/Images/ResourceXsd.xaml deleted file mode 100644 index 094c64210..000000000 --- a/ILSpy/Images/ResourceXsd.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ResourceXsl.svg b/ILSpy/Images/ResourceXsl.svg deleted file mode 100644 index 1f67bef05..000000000 --- a/ILSpy/Images/ResourceXsl.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ResourceXsl.xaml b/ILSpy/Images/ResourceXsl.xaml deleted file mode 100644 index c0973b2d3..000000000 --- a/ILSpy/Images/ResourceXsl.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ResourceXslt.svg b/ILSpy/Images/ResourceXslt.svg deleted file mode 100644 index b53ffb0ca..000000000 --- a/ILSpy/Images/ResourceXslt.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ResourceXslt.xaml b/ILSpy/Images/ResourceXslt.xaml deleted file mode 100644 index 91a0b26a4..000000000 --- a/ILSpy/Images/ResourceXslt.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ILSpy/Images/ResultToJSON.svg b/ILSpy/Images/ResultToJSON.svg deleted file mode 100644 index 9057dc768..000000000 --- a/ILSpy/Images/ResultToJSON.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ResultToJSON.xaml b/ILSpy/Images/ResultToJSON.xaml deleted file mode 100644 index 1dfb33662..000000000 --- a/ILSpy/Images/ResultToJSON.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Save.svg b/ILSpy/Images/Save.svg deleted file mode 100644 index e2a1dec56..000000000 --- a/ILSpy/Images/Save.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Save.xaml b/ILSpy/Images/Save.xaml deleted file mode 100644 index 2a74dc9d4..000000000 --- a/ILSpy/Images/Save.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Search.svg b/ILSpy/Images/Search.svg deleted file mode 100644 index 1b80bf68c..000000000 --- a/ILSpy/Images/Search.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Search.xaml b/ILSpy/Images/Search.xaml deleted file mode 100644 index f1bb3be67..000000000 --- a/ILSpy/Images/Search.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/SearchMsdn.svg b/ILSpy/Images/SearchMsdn.svg deleted file mode 100644 index 3ab277f7e..000000000 --- a/ILSpy/Images/SearchMsdn.svg +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/SearchMsdn.xaml b/ILSpy/Images/SearchMsdn.xaml deleted file mode 100644 index c568e1660..000000000 --- a/ILSpy/Images/SearchMsdn.xaml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ShowAll.svg b/ILSpy/Images/ShowAll.svg deleted file mode 100644 index 1d7c4fc4c..000000000 --- a/ILSpy/Images/ShowAll.svg +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/ShowAll.xaml b/ILSpy/Images/ShowAll.xaml deleted file mode 100644 index 45038378833d151eb825109566aa881d5d29e71a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9342 zcmeI2OK%)S6oqSz#D8eP*0JaPKp_i49t%e-KoPLBAR(556WK(B{CLRu>dd8I)jgAO zBv?dNdwObaRo%zA=icg>fBwFkzD?KZBK?^z(^dK{J<_{Z=}mf_s`NJfo?dG7CVid0 zNH5YK`g@(eN@x1JNxx|1nItZBf2!9@jWG8{*KisK?pY7IuuJz8+EKT&c(%oCl zWc@R(d99UhbX{rQg|17@ywaXkx-W@KNj%c0toBTwUZ=mZMo+ZTiLNR=O;fE|rN_J1 zr+M^o{{OSqxtBgqpXu`|4cmK~e$dJn+1}^c>sq_j^E|hfc$xKlR+v+zAG3B7c>r4{ zX_J;|k*`hK>Te@0*ZP}iY?{Zh^rt*)tyx=rw$dltG}krJ+)W-~#x{H9tfARmd2lF( z<2K#xd9}SxmA;V|-Y7CJvTk3dhxu=k9^}_))}<7ghtj@EPxODK2=V`2e(!kseyZ_P z;bA5Zth0?Ly2E;GUS_{c)48N(8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~~7#g)l1vEA514ihQzn7k$~B`z+>x%W4Y$WHJuB*!xiFcRH3a^_+`qZz^jcF@83 z6bCwu2bh^!O=iOZ-yt%6uN;&ArLN{!uq!Y_3tO*7Zy|u zcNJZq`?muAronZ!iG=Z-?`GVGJ{2i{k3dI3N43>c+}rfiM2ufH@aj`*{YppYXJ*JW z@A;hzBktkq`*>=Hzd-T1qUt+Xi(EjKPuII&VIakKf#(`0Tj+azhc - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/ShowPrivateInternal.xaml b/ILSpy/Images/ShowPrivateInternal.xaml deleted file mode 100644 index a7c859d1cfa9957455d6c974b7679010eb2c65fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5948 zcmeI0&2QUA5XI+Qp#KBWUL8xKB#J8B9O~xdkf4VaLDHMh+KqtJ3G4<<^T)S+zkOOu zBv-QFF>bCccfY z;&uF?>s@>kBV9M~i&id#Sn2zzKG#}7_D1)mkf-|nR_mjU?n~(#MIB>ZjlO-5B>G3v zc`Z#hy00X+(!G}CmG-RST!^(0PxKUR7kYXfesXk#9;bhok8 z)ym3+uCdl8X&p~rC8>p^mU`Cc$ug$8$C7Q+3KGi{mC=r6XNusy93J-RY!KD1o@($M z9z2$1RXo?$*m9`g-WZ6#oLUL~?$E4EzC z?F}z}5c^lErL~xE-j4?y@NT0)zK*dL{v7slTLpJBX6xO4kNUfP3ah5dcOw?Ts(Ip6 zDceh-=BeVq){>|aQ<_wlP2y=S#vO}e*SXLO-BftJ(MR3RlQlE3?nGAgapxO`)~PP0 zk_1-^M`y$mx&rJsli7tXF-5I%Q?DMn;1qUmdTS@%GOkVur}4xb3LJt5sOCGOwSwzIzEgbt25bQ9FkLA&OX`W z+hQY6$6~FUrxFTF$RpCs2%O9ucg;ytO1rN8L!Xal3 zR>0U23jSp7<0sy_8sI1SZ}quMyMiNAM9F-HJxo3-8f-ZpB@|p{(qcVTV^90KKuyw) zOxA2yle{Dco*AwSVq?aZ{LIsi$T8KhcX=BVzGFWVoN4C>cX9BG__`*j@=BV}wmbVh zJ&(aThr9b`8;KXafxPqlL^gRwV>j%aBpb~j^0Ckw@fqTBM(PyBjH6=_JzGu=zzz2u z;yzc^KbCKg(hQxXK62lxcl~v}8%BYQ4!s-Vj*Y^xQN2&J?i&fX2n#$TVG2E_(JI{o zZo?%`a`1+@QAh6bkJ4$)U8yg@N$!vY9HEY>VxJaW7kyiXxc^Ua`5mb{C;uy_IQqRi zJCgxk!6>SR36)Pl=X%C8Vlr^HU{+=vlLIDl{-I{zB3yxq^ea~-GTiRxbaT!j=wa38 zDI?h(EYq-(E+#0mo_-DU{hq@hUZIxyII@5zM2%B6)w~bK?4)8_T^Yv|Ctp6@ zRQir}GvQd>z8P|6;-us^W#gEN;5f7F(+6*`3XM5eCHufJnaC(?$@=>KB8z?OOx{bn zN^mAOsnb%~C9t#)1c`n0VVhz`aytK`DK<$v@ToXP4;+fxnh#G6Ix{QK1 zM2I}*Ou$AM1b@I0PuC&cIpdHdTSVHGnCsd#)@o9e7%-eD_nC2}cTcR&_ouuE5L5W+ z)3PJq&t!hL8=~Mp+@ohX^7J(L4YS<=$s_roZpm5Bkl!bW>+Ck)aF}W&1IF=-oRLlI zqr!cX_kWPewdYI{BRU&zE1w@{&#()o;A3W5*FH0z6DnBH;8^YYOWb`^TJN^fzHgVrm~54NguUNZ}k-Ln`X(rQZFvy kI5UzZx(Zc5?n<~}ZEmwc{FySYlDjIn+jS28XZ2zH3v;5h%K!iX diff --git a/ILSpy/Images/ShowPublicOnly.svg b/ILSpy/Images/ShowPublicOnly.svg deleted file mode 100644 index 24baa490d..000000000 --- a/ILSpy/Images/ShowPublicOnly.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ShowPublicOnly.xaml b/ILSpy/Images/ShowPublicOnly.xaml deleted file mode 100644 index e13198fbc..000000000 --- a/ILSpy/Images/ShowPublicOnly.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Sort.svg b/ILSpy/Images/Sort.svg deleted file mode 100644 index 75830ceb6..000000000 --- a/ILSpy/Images/Sort.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Sort.xaml b/ILSpy/Images/Sort.xaml deleted file mode 100644 index 7c8ebee2e..000000000 --- a/ILSpy/Images/Sort.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Struct.svg b/ILSpy/Images/Struct.svg deleted file mode 100644 index 811f389f8..000000000 --- a/ILSpy/Images/Struct.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Struct.xaml b/ILSpy/Images/Struct.xaml deleted file mode 100644 index b5142701b..000000000 --- a/ILSpy/Images/Struct.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/SubTypes.svg b/ILSpy/Images/SubTypes.svg deleted file mode 100644 index fbe0b6840..000000000 --- a/ILSpy/Images/SubTypes.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/SubTypes.xaml b/ILSpy/Images/SubTypes.xaml deleted file mode 100644 index f04b0a283..000000000 --- a/ILSpy/Images/SubTypes.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/ILSpy/Images/SuperTypes.svg b/ILSpy/Images/SuperTypes.svg deleted file mode 100644 index 201af86b7..000000000 --- a/ILSpy/Images/SuperTypes.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/SuperTypes.xaml b/ILSpy/Images/SuperTypes.xaml deleted file mode 100644 index 9563b07e1..000000000 --- a/ILSpy/Images/SuperTypes.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/ILSpy/Images/SwitchSourceOrTarget.svg b/ILSpy/Images/SwitchSourceOrTarget.svg deleted file mode 100644 index b51f87a9e..000000000 --- a/ILSpy/Images/SwitchSourceOrTarget.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/SwitchSourceOrTarget.xaml b/ILSpy/Images/SwitchSourceOrTarget.xaml deleted file mode 100644 index 5a72dc2c1..000000000 --- a/ILSpy/Images/SwitchSourceOrTarget.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/TypeIcon.cs b/ILSpy/Images/TypeIcon.cs deleted file mode 100644 index a3c46212a..000000000 --- a/ILSpy/Images/TypeIcon.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -namespace ICSharpCode.ILSpy -{ - internal enum TypeIcon - { - Class, - Enum, - Struct, - Interface, - Delegate - } -} diff --git a/ILSpy/Images/ViewCode.svg b/ILSpy/Images/ViewCode.svg deleted file mode 100644 index 7c0f3e087..000000000 --- a/ILSpy/Images/ViewCode.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/ViewCode.xaml b/ILSpy/Images/ViewCode.xaml deleted file mode 100644 index e999a54fe..000000000 --- a/ILSpy/Images/ViewCode.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/VirtualMethod.svg b/ILSpy/Images/VirtualMethod.svg deleted file mode 100644 index dfb0aeba5..000000000 --- a/ILSpy/Images/VirtualMethod.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/ILSpy/Images/VirtualMethod.xaml b/ILSpy/Images/VirtualMethod.xaml deleted file mode 100644 index b04ec8314..000000000 --- a/ILSpy/Images/VirtualMethod.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/Warning.svg b/ILSpy/Images/Warning.svg deleted file mode 100644 index 190b9e3e0..000000000 --- a/ILSpy/Images/Warning.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ILSpy/Images/Warning.xaml b/ILSpy/Images/Warning.xaml deleted file mode 100644 index e9e723ccc..000000000 --- a/ILSpy/Images/Warning.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/WebAssembly.svg b/ILSpy/Images/WebAssembly.svg deleted file mode 100644 index f2d67d77a..000000000 --- a/ILSpy/Images/WebAssembly.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/WebAssembly.xaml b/ILSpy/Images/WebAssembly.xaml deleted file mode 100644 index 302c83825..000000000 --- a/ILSpy/Images/WebAssembly.xaml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/ILSpy/Images/WpfWindowsTreeNodeImagesProvider.cs b/ILSpy/Images/WpfWindowsTreeNodeImagesProvider.cs deleted file mode 100644 index a9b3bfce1..000000000 --- a/ILSpy/Images/WpfWindowsTreeNodeImagesProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; - -namespace ICSharpCode.ILSpy -{ - public class WpfWindowsTreeNodeImagesProvider : ITreeNodeImagesProvider - { - public object Assembly => Images.Assembly; - } -} diff --git a/ILSpy/Images/ZoomIn.svg b/ILSpy/Images/ZoomIn.svg deleted file mode 100644 index e57d1d9fd..000000000 --- a/ILSpy/Images/ZoomIn.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - diff --git a/ILSpy/Images/ZoomIn.xaml b/ILSpy/Images/ZoomIn.xaml deleted file mode 100644 index 693be3b62..000000000 --- a/ILSpy/Images/ZoomIn.xaml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Images/ZoomOut.svg b/ILSpy/Images/ZoomOut.svg deleted file mode 100644 index 5a7e7bd20..000000000 --- a/ILSpy/Images/ZoomOut.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - diff --git a/ILSpy/Images/ZoomOut.xaml b/ILSpy/Images/ZoomOut.xaml deleted file mode 100644 index 48120672e..000000000 --- a/ILSpy/Images/ZoomOut.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/LanguageSettings.cs b/ILSpy/LanguageSettings.cs deleted file mode 100644 index 96dfd1f77..000000000 --- a/ILSpy/LanguageSettings.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Xml.Linq; - -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Settings; - -using TomsToolbox.Wpf; - -#nullable enable - -namespace ICSharpCode.ILSpy -{ - /// - /// Represents the filters applied to the tree view. - /// - public class LanguageSettings : ObservableObjectBase, IChildSettings - { - /// - /// This dictionary is necessary to remember language versions across language changes. For example, - /// the user first select C# 10, then switches to IL, then switches back to C#. After that we must be - /// able to restore the original selection (i.e., C# 10). - /// - private readonly Dictionary languageVersionHistory = new Dictionary(); - - public LanguageSettings(XElement element, ISettingsSection parent) - { - Parent = parent; - this.ShowApiLevel = (ApiVisibility?)(int?)element.Element("ShowAPILevel") ?? ApiVisibility.PublicAndInternal; - this.LanguageId = (string?)element.Element("Language"); - this.LanguageVersionId = (string?)element.Element("LanguageVersion"); - } - - public ISettingsSection Parent { get; } - - public XElement SaveAsXml() - { - return new XElement( - "FilterSettings", - new XElement("ShowAPILevel", (int)this.ShowApiLevel), - new XElement("Language", this.LanguageId), - new XElement("LanguageVersion", this.LanguageVersionId) - ); - } - - ApiVisibility showApiLevel; - - /// - /// Gets/Sets whether public, internal or all API members should be shown. - /// - public ApiVisibility ShowApiLevel { - get { return showApiLevel; } - set { - if (showApiLevel != value) - { - showApiLevel = value; - OnPropertyChanged(nameof(ShowApiLevel)); - } - } - } - - public bool ApiVisPublicOnly { - get { return showApiLevel == ApiVisibility.PublicOnly; } - set { - if (value == (showApiLevel == ApiVisibility.PublicOnly)) - return; - ShowApiLevel = ApiVisibility.PublicOnly; - OnPropertyChanged(nameof(ApiVisPublicOnly)); - OnPropertyChanged(nameof(ApiVisPublicAndInternal)); - OnPropertyChanged(nameof(ApiVisAll)); - } - } - - public bool ApiVisPublicAndInternal { - get { return showApiLevel == ApiVisibility.PublicAndInternal; } - set { - if (value == (showApiLevel == ApiVisibility.PublicAndInternal)) - return; - ShowApiLevel = ApiVisibility.PublicAndInternal; - OnPropertyChanged(nameof(ApiVisPublicOnly)); - OnPropertyChanged(nameof(ApiVisPublicAndInternal)); - OnPropertyChanged(nameof(ApiVisAll)); - } - } - - public bool ApiVisAll { - get { return showApiLevel == ApiVisibility.All; } - set { - if (value == (showApiLevel == ApiVisibility.All)) - return; - ShowApiLevel = ApiVisibility.All; - OnPropertyChanged(nameof(ApiVisPublicOnly)); - OnPropertyChanged(nameof(ApiVisPublicAndInternal)); - OnPropertyChanged(nameof(ApiVisAll)); - } - } - - string? languageId; - - /// - /// Gets/Sets the current language. - /// - /// - /// While this isn't related to filtering, having it as part of the FilterSettings - /// makes it easy to pass it down into all tree nodes. - /// - public string? LanguageId { - get => languageId; - set => SetProperty(ref languageId, value); - } - - string? languageVersionId; - - /// - /// Gets/Sets the current language version. - /// - /// - /// While this isn't related to filtering, having it as part of the FilterSettings - /// makes it easy to pass it down into all tree nodes. - /// - public string? LanguageVersionId { - get { return languageVersionId; } - set => SetProperty(ref languageVersionId, value); - } - - // This class has been initially called FilterSettings, but then has been Hijacked to store language settings as well. - // While the filter settings were some sort of local, the language settings are global. This is a bit of a mess. - // There has been a lot of workarounds cloning the FilterSettings to pass them down to the tree nodes, without messing up the global language settings. - // Finally, this filtering was not used at all, so this SearchTerm is just a placeholder to make the filtering code compile, in case someone wants to reactivate filtering in the future. - public string SearchTerm => string.Empty; - - public bool SearchTermMatches(string value) - { - return true; - } - } -} diff --git a/ILSpy/Languages/CSharpBracketSearcher.cs b/ILSpy/Languages/CSharpBracketSearcher.cs deleted file mode 100644 index 278972a1e..000000000 --- a/ILSpy/Languages/CSharpBracketSearcher.cs +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright (c) 2018 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Diagnostics; - -using ICSharpCode.AvalonEdit.Document; -using ICSharpCode.ILSpy.TextView; - -namespace ICSharpCode.ILSpy -{ - /// - /// Searches matching brackets for C#. - /// - class CSharpBracketSearcher : IBracketSearcher - { - string openingBrackets = "([{"; - string closingBrackets = ")]}"; - - public BracketSearchResult SearchBracket(IDocument document, int offset) - { - if (offset > 0) - { - char c = document.GetCharAt(offset - 1); - int index = openingBrackets.IndexOf(c); - int otherOffset = -1; - if (index > -1) - otherOffset = SearchBracketForward(document, offset, openingBrackets[index], closingBrackets[index]); - - index = closingBrackets.IndexOf(c); - if (index > -1) - otherOffset = SearchBracketBackward(document, offset - 2, openingBrackets[index], closingBrackets[index]); - - if (otherOffset > -1) - { - var result = new BracketSearchResult(Math.Min(offset - 1, otherOffset), 1, - Math.Max(offset - 1, otherOffset), 1); - return result; - } - } - - return null; - } - - #region SearchBracket helper functions - static int ScanLineStart(IDocument document, int offset) - { - for (int i = offset - 1; i > 0; --i) - { - if (document.GetCharAt(i) == '\n') - return i + 1; - } - return 0; - } - - /// - /// Gets the type of code at offset.
- /// 0 = Code,
- /// 1 = Comment,
- /// 2 = String
- /// Block comments and multiline strings are not supported. - ///
- static int GetStartType(IDocument document, int linestart, int offset) - { - bool inString = false; - bool inChar = false; - bool verbatim = false; - int result = 0; - for (int i = linestart; i < offset; i++) - { - switch (document.GetCharAt(i)) - { - case '/': - if (!inString && !inChar && i + 1 < document.TextLength) - { - if (document.GetCharAt(i + 1) == '/') - { - result = 1; - } - } - break; - case '"': - if (!inChar) - { - if (inString && verbatim) - { - if (i + 1 < document.TextLength && document.GetCharAt(i + 1) == '"') - { - ++i; // skip escaped quote - inString = false; // let the string go on - } - else - { - verbatim = false; - } - } - else if (!inString && i > 0 && document.GetCharAt(i - 1) == '@') - { - verbatim = true; - } - inString = !inString; - } - break; - case '\'': - if (!inString) - inChar = !inChar; - break; - case '\\': - if ((inString && !verbatim) || inChar) - ++i; // skip next character - break; - } - } - - return (inString || inChar) ? 2 : result; - } - #endregion - - #region SearchBracketBackward - int SearchBracketBackward(IDocument document, int offset, char openBracket, char closingBracket) - { - if (offset + 1 >= document.TextLength) - return -1; - // this method parses a c# document backwards to find the matching bracket - - // first try "quick find" - find the matching bracket if there is no string/comment in the way - int quickResult = QuickSearchBracketBackward(document, offset, openBracket, closingBracket); - if (quickResult >= 0) - return quickResult; - - // we need to parse the line from the beginning, so get the line start position - int linestart = ScanLineStart(document, offset + 1); - - // we need to know where offset is - in a string/comment or in normal code? - // ignore cases where offset is in a block comment - int starttype = GetStartType(document, linestart, offset + 1); - if (starttype == 1) - { - return -1; // start position is in a comment - } - - // I don't see any possibility to parse a C# document backwards... - // We have to do it forwards and push all bracket positions on a stack. - Stack bracketStack = new Stack(); - bool blockComment = false; - bool lineComment = false; - bool inChar = false; - bool inString = false; - bool verbatim = false; - - for (int i = 0; i <= offset; ++i) - { - char ch = document.GetCharAt(i); - switch (ch) - { - case '\r': - case '\n': - lineComment = false; - inChar = false; - if (!verbatim) - inString = false; - break; - case '/': - if (blockComment) - { - Debug.Assert(i > 0); - if (document.GetCharAt(i - 1) == '*') - { - blockComment = false; - } - } - if (!inString && !inChar && i + 1 < document.TextLength) - { - if (!blockComment && document.GetCharAt(i + 1) == '/') - { - lineComment = true; - } - if (!lineComment && document.GetCharAt(i + 1) == '*') - { - blockComment = true; - } - } - break; - case '"': - if (!(inChar || lineComment || blockComment)) - { - if (inString && verbatim) - { - if (i + 1 < document.TextLength && document.GetCharAt(i + 1) == '"') - { - ++i; // skip escaped quote - inString = false; // let the string go - } - else - { - verbatim = false; - } - } - else if (!inString && offset > 0 && document.GetCharAt(i - 1) == '@') - { - verbatim = true; - } - inString = !inString; - } - break; - case '\'': - if (!(inString || lineComment || blockComment)) - { - inChar = !inChar; - } - break; - case '\\': - if ((inString && !verbatim) || inChar) - ++i; // skip next character - break; - default: - if (ch == openBracket) - { - if (!(inString || inChar || lineComment || blockComment)) - { - bracketStack.Push(i); - } - } - else if (ch == closingBracket) - { - if (!(inString || inChar || lineComment || blockComment)) - { - if (bracketStack.Count > 0) - bracketStack.Pop(); - } - } - break; - } - } - if (bracketStack.Count > 0) - return (int)bracketStack.Pop(); - return -1; - } - #endregion - - #region SearchBracketForward - int SearchBracketForward(IDocument document, int offset, char openBracket, char closingBracket) - { - bool inString = false; - bool inChar = false; - bool verbatim = false; - - bool lineComment = false; - bool blockComment = false; - - if (offset < 0) - return -1; - - // first try "quick find" - find the matching bracket if there is no string/comment in the way - int quickResult = QuickSearchBracketForward(document, offset, openBracket, closingBracket); - if (quickResult >= 0) - return quickResult; - - // we need to parse the line from the beginning, so get the line start position - int linestart = ScanLineStart(document, offset); - - // we need to know where offset is - in a string/comment or in normal code? - // ignore cases where offset is in a block comment - int starttype = GetStartType(document, linestart, offset); - if (starttype != 0) - return -1; // start position is in a comment/string - - int brackets = 1; - - while (offset < document.TextLength) - { - char ch = document.GetCharAt(offset); - switch (ch) - { - case '\r': - case '\n': - lineComment = false; - inChar = false; - if (!verbatim) - inString = false; - break; - case '/': - if (blockComment) - { - Debug.Assert(offset > 0); - if (document.GetCharAt(offset - 1) == '*') - { - blockComment = false; - } - } - if (!inString && !inChar && offset + 1 < document.TextLength) - { - if (!blockComment && document.GetCharAt(offset + 1) == '/') - { - lineComment = true; - } - if (!lineComment && document.GetCharAt(offset + 1) == '*') - { - blockComment = true; - } - } - break; - case '"': - if (!(inChar || lineComment || blockComment)) - { - if (inString && verbatim) - { - if (offset + 1 < document.TextLength && document.GetCharAt(offset + 1) == '"') - { - ++offset; // skip escaped quote - inString = false; // let the string go - } - else - { - verbatim = false; - } - } - else if (!inString && offset > 0 && document.GetCharAt(offset - 1) == '@') - { - verbatim = true; - } - inString = !inString; - } - break; - case '\'': - if (!(inString || lineComment || blockComment)) - { - inChar = !inChar; - } - break; - case '\\': - if ((inString && !verbatim) || inChar) - ++offset; // skip next character - break; - default: - if (ch == openBracket) - { - if (!(inString || inChar || lineComment || blockComment)) - { - ++brackets; - } - } - else if (ch == closingBracket) - { - if (!(inString || inChar || lineComment || blockComment)) - { - --brackets; - if (brackets == 0) - { - return offset; - } - } - } - break; - } - ++offset; - } - return -1; - } - #endregion - - int QuickSearchBracketBackward(IDocument document, int offset, char openBracket, char closingBracket) - { - int brackets = -1; - // first try "quick find" - find the matching bracket if there is no string/comment in the way - for (int i = offset; i >= 0; --i) - { - char ch = document.GetCharAt(i); - if (ch == openBracket) - { - ++brackets; - if (brackets == 0) - return i; - } - else if (ch == closingBracket) - { - --brackets; - } - else if (ch == '"') - { - break; - } - else if (ch == '\'') - { - break; - } - else if (ch == '/' && i > 0) - { - if (document.GetCharAt(i - 1) == '/') - break; - if (document.GetCharAt(i - 1) == '*') - break; - } - } - return -1; - } - - int QuickSearchBracketForward(IDocument document, int offset, char openBracket, char closingBracket) - { - int brackets = 1; - // try "quick find" - find the matching bracket if there is no string/comment in the way - for (int i = offset; i < document.TextLength; ++i) - { - char ch = document.GetCharAt(i); - if (ch == openBracket) - { - ++brackets; - } - else if (ch == closingBracket) - { - --brackets; - if (brackets == 0) - return i; - } - else if (ch == '"') - { - break; - } - else if (ch == '\'') - { - break; - } - else if (ch == '/' && i > 0) - { - if (document.GetCharAt(i - 1) == '/') - break; - } - else if (ch == '*' && i > 0) - { - if (document.GetCharAt(i - 1) == '/') - break; - } - } - return -1; - } - } -} diff --git a/ILSpy/Languages/CSharpHighlightingTokenWriter.cs b/ILSpy/Languages/CSharpHighlightingTokenWriter.cs deleted file mode 100644 index 548bb50f1..000000000 --- a/ILSpy/Languages/CSharpHighlightingTokenWriter.cs +++ /dev/null @@ -1,568 +0,0 @@ -// Copyright (c) 2018 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Linq; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.Decompiler.CSharp; -using ICSharpCode.Decompiler.CSharp.OutputVisitor; -using ICSharpCode.Decompiler.CSharp.Syntax; -using ICSharpCode.Decompiler.IL; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpyX.Extensions; - -namespace ICSharpCode.ILSpy -{ - class CSharpHighlightingTokenWriter : DecoratingTokenWriter - { - HighlightingColor visibilityKeywordsColor; - HighlightingColor namespaceKeywordsColor; - HighlightingColor structureKeywordsColor; - HighlightingColor gotoKeywordsColor; - HighlightingColor queryKeywordsColor; - HighlightingColor exceptionKeywordsColor; - HighlightingColor checkedKeywordColor; - HighlightingColor unsafeKeywordsColor; - HighlightingColor valueTypeKeywordsColor; - HighlightingColor referenceTypeKeywordsColor; - HighlightingColor operatorKeywordsColor; - HighlightingColor parameterModifierColor; - HighlightingColor modifiersColor; - HighlightingColor accessorKeywordsColor; - HighlightingColor attributeKeywordsColor; - - HighlightingColor referenceTypeColor; - HighlightingColor valueTypeColor; - HighlightingColor interfaceTypeColor; - HighlightingColor enumerationTypeColor; - HighlightingColor typeParameterTypeColor; - HighlightingColor delegateTypeColor; - - HighlightingColor methodCallColor; - HighlightingColor methodDeclarationColor; - HighlightingColor fieldDeclarationColor; - HighlightingColor fieldAccessColor; - HighlightingColor propertyDeclarationColor; - HighlightingColor propertyAccessColor; - HighlightingColor eventDeclarationColor; - HighlightingColor eventAccessColor; - - HighlightingColor variableColor; - HighlightingColor parameterColor; - - HighlightingColor valueKeywordColor; - HighlightingColor thisKeywordColor; - HighlightingColor trueKeywordColor; - HighlightingColor typeKeywordsColor; - - public RichTextModel HighlightingModel { get; } = new RichTextModel(); - - public CSharpHighlightingTokenWriter(TokenWriter decoratedWriter, ISmartTextOutput textOutput = null, ILocatable locatable = null) - : base(decoratedWriter) - { - var highlighting = HighlightingManager.Instance.GetDefinition("C#"); - - this.locatable = locatable; - this.textOutput = textOutput; - - this.visibilityKeywordsColor = highlighting.GetNamedColor("Visibility"); - this.namespaceKeywordsColor = highlighting.GetNamedColor("NamespaceKeywords"); - this.structureKeywordsColor = highlighting.GetNamedColor("Keywords"); - this.gotoKeywordsColor = highlighting.GetNamedColor("GotoKeywords"); - this.queryKeywordsColor = highlighting.GetNamedColor("QueryKeywords"); - this.exceptionKeywordsColor = highlighting.GetNamedColor("ExceptionKeywords"); - this.checkedKeywordColor = highlighting.GetNamedColor("CheckedKeyword"); - this.unsafeKeywordsColor = highlighting.GetNamedColor("UnsafeKeywords"); - this.valueTypeKeywordsColor = highlighting.GetNamedColor("ValueTypeKeywords"); - this.referenceTypeKeywordsColor = highlighting.GetNamedColor("ReferenceTypeKeywords"); - this.operatorKeywordsColor = highlighting.GetNamedColor("OperatorKeywords"); - this.parameterModifierColor = highlighting.GetNamedColor("ParameterModifiers"); - this.modifiersColor = highlighting.GetNamedColor("Modifiers"); - this.accessorKeywordsColor = highlighting.GetNamedColor("GetSetAddRemove"); - - this.referenceTypeColor = highlighting.GetNamedColor("ReferenceTypes"); - this.valueTypeColor = highlighting.GetNamedColor("ValueTypes"); - this.interfaceTypeColor = highlighting.GetNamedColor("InterfaceTypes"); - this.enumerationTypeColor = highlighting.GetNamedColor("EnumTypes"); - this.typeParameterTypeColor = highlighting.GetNamedColor("TypeParameters"); - this.delegateTypeColor = highlighting.GetNamedColor("DelegateTypes"); - this.methodDeclarationColor = highlighting.GetNamedColor("MethodDeclaration"); - this.methodCallColor = highlighting.GetNamedColor("MethodCall"); - this.fieldDeclarationColor = highlighting.GetNamedColor("FieldDeclaration"); - this.fieldAccessColor = highlighting.GetNamedColor("FieldAccess"); - this.propertyDeclarationColor = highlighting.GetNamedColor("PropertyDeclaration"); - this.propertyAccessColor = highlighting.GetNamedColor("PropertyAccess"); - this.eventDeclarationColor = highlighting.GetNamedColor("EventDeclaration"); - this.eventAccessColor = highlighting.GetNamedColor("EventAccess"); - this.variableColor = highlighting.GetNamedColor("Variable"); - this.parameterColor = highlighting.GetNamedColor("Parameter"); - this.valueKeywordColor = highlighting.GetNamedColor("NullOrValueKeywords"); - this.thisKeywordColor = highlighting.GetNamedColor("ThisOrBaseReference"); - this.trueKeywordColor = highlighting.GetNamedColor("TrueFalse"); - this.typeKeywordsColor = highlighting.GetNamedColor("TypeKeywords"); - this.attributeKeywordsColor = highlighting.GetNamedColor("AttributeKeywords"); - //this.externAliasKeywordColor = ...; - } - - public override void WriteKeyword(Role role, string keyword) - { - HighlightingColor color = null; - switch (keyword) - { - case "namespace": - case "using": - if (role == UsingStatement.UsingKeywordRole) - color = structureKeywordsColor; - else - color = namespaceKeywordsColor; - break; - case "this": - case "base": - color = thisKeywordColor; - break; - case "true": - case "false": - color = trueKeywordColor; - break; - case "public": - case "internal": - case "protected": - case "private": - color = visibilityKeywordsColor; - break; - case "if": - case "else": - case "switch": - case "case": - case "default": - case "while": - case "do": - case "for": - case "foreach": - case "lock": - case "await": - color = structureKeywordsColor; - break; - case "where": - if (nodeStack.PeekOrDefault() is QueryClause) - color = queryKeywordsColor; - else - color = structureKeywordsColor; - break; - case "in": - if (nodeStack.PeekOrDefault() is ForeachStatement) - color = structureKeywordsColor; - else if (nodeStack.PeekOrDefault() is QueryClause) - color = queryKeywordsColor; - else - color = parameterModifierColor; - break; - case "as": - case "is": - case "new": - case "sizeof": - case "typeof": - case "nameof": - case "stackalloc": - color = typeKeywordsColor; - break; - case "with": - if (role == WithInitializerExpression.WithKeywordRole) - color = typeKeywordsColor; - break; - case "try": - case "throw": - case "catch": - case "finally": - color = exceptionKeywordsColor; - break; - case "when": - if (role == CatchClause.WhenKeywordRole) - color = exceptionKeywordsColor; - break; - case "get": - case "set": - case "add": - case "remove": - case "init": - if (role == PropertyDeclaration.GetKeywordRole || - role == PropertyDeclaration.SetKeywordRole || - role == PropertyDeclaration.InitKeywordRole || - role == CustomEventDeclaration.AddKeywordRole || - role == CustomEventDeclaration.RemoveKeywordRole) - color = accessorKeywordsColor; - break; - case "abstract": - case "const": - case "event": - case "extern": - case "override": - case "sealed": - case "static": - case "virtual": - case "volatile": - case "async": - case "partial": - color = modifiersColor; - break; - case "readonly": - if (role == ComposedType.ReadonlyRole) - color = parameterModifierColor; - else - color = modifiersColor; - break; - case "checked": - case "unchecked": - color = checkedKeywordColor; - break; - case "fixed": - case "unsafe": - color = unsafeKeywordsColor; - break; - case "enum": - case "struct": - color = valueTypeKeywordsColor; - break; - case "class": - case "interface": - case "delegate": - case "extension": - color = referenceTypeKeywordsColor; - break; - case "record": - color = role == Roles.RecordKeyword ? referenceTypeKeywordsColor : valueTypeKeywordsColor; - break; - case "select": - case "group": - case "by": - case "into": - case "from": - case "orderby": - case "let": - case "join": - case "on": - case "equals": - if (nodeStack.PeekOrDefault() is QueryClause) - color = queryKeywordsColor; - break; - case "ascending": - case "descending": - if (nodeStack.PeekOrDefault() is QueryOrdering) - color = queryKeywordsColor; - break; - case "explicit": - case "implicit": - case "operator": - color = operatorKeywordsColor; - break; - case "params": - case "ref": - case "out": - case "scoped": - color = parameterModifierColor; - break; - case "break": - case "continue": - case "goto": - case "yield": - case "return": - color = gotoKeywordsColor; - break; - } - if (nodeStack.PeekOrDefault() is AttributeSection) - color = attributeKeywordsColor; - if (color != null) - { - BeginSpan(color); - } - base.WriteKeyword(role, keyword); - if (color != null) - { - EndSpan(); - } - } - - public override void WritePrimitiveType(string type) - { - HighlightingColor color = null; - switch (type) - { - case "new": - case "notnull": - // Not sure if reference type or value type - color = referenceTypeKeywordsColor; - break; - case "bool": - case "byte": - case "char": - case "decimal": - case "double": - case "enum": - case "float": - case "int": - case "long": - case "sbyte": - case "short": - case "struct": - case "uint": - case "ushort": - case "ulong": - case "unmanaged": - case "nint": - case "nuint": - color = valueTypeKeywordsColor; - break; - case "class": - case "object": - case "string": - case "void": - case "dynamic": - color = referenceTypeKeywordsColor; - break; - } - if (color != null) - { - BeginSpan(color); - } - base.WritePrimitiveType(type); - if (color != null) - { - EndSpan(); - } - } - - public override void WriteIdentifier(Identifier identifier) - { - HighlightingColor color = null; - if (identifier.Parent?.GetResolveResult() is ILVariableResolveResult rr) - { - if (rr.Variable.Kind == VariableKind.Parameter) - { - if (identifier.Name == "value" - && identifier.Ancestors.OfType().FirstOrDefault() is { } accessor - && accessor.Role != PropertyDeclaration.GetterRole) - { - color = valueKeywordColor; - } - else - { - color = parameterColor; - } - } - else - { - color = variableColor; - } - } - if (identifier.Parent is AstType) - { - switch (identifier.Name) - { - case "var": - color = queryKeywordsColor; - break; - case "global": - color = structureKeywordsColor; - break; - } - } - switch (GetCurrentDefinition()) - { - case ITypeDefinition t: - ApplyTypeColor(t, ref color); - break; - case IMethod: - color = methodDeclarationColor; - break; - case IField: - color = fieldDeclarationColor; - break; - case IProperty: - color = propertyDeclarationColor; - break; - case IEvent: - color = eventDeclarationColor; - break; - } - switch (GetCurrentMemberReference()) - { - case IType t: - ApplyTypeColor(t, ref color); - break; - case IMethod m: - color = methodCallColor; - if (m.IsConstructor) - ApplyTypeColor(m.DeclaringType, ref color); - break; - case IField: - color = fieldAccessColor; - break; - case IProperty: - color = propertyAccessColor; - break; - case IEvent: - color = eventAccessColor; - break; - } - if (color != null) - { - BeginSpan(color); - } - base.WriteIdentifier(identifier); - if (color != null) - { - EndSpan(); - } - } - - void ApplyTypeColor(IType type, ref HighlightingColor color) - { - switch (type?.Kind) - { - case TypeKind.Delegate: - color = delegateTypeColor; - break; - case TypeKind.Class: - color = referenceTypeColor; - break; - case TypeKind.Interface: - color = interfaceTypeColor; - break; - case TypeKind.Enum: - color = enumerationTypeColor; - break; - case TypeKind.Struct: - color = valueTypeColor; - break; - } - } - - public override void WritePrimitiveValue(object value, Decompiler.CSharp.Syntax.LiteralFormat format) - { - HighlightingColor color = null; - if (value is null) - { - color = valueKeywordColor; - } - if (value is true || value is false) - { - color = trueKeywordColor; - } - if (color != null) - { - BeginSpan(color); - } - base.WritePrimitiveValue(value, format); - if (color != null) - { - EndSpan(); - } - } - - ISymbol GetCurrentDefinition() - { - if (nodeStack == null || nodeStack.Count == 0) - return null; - - var node = nodeStack.Peek(); - if (node is Identifier) - node = node.Parent; - if (Decompiler.TextTokenWriter.IsDefinition(ref node)) - return node.GetSymbol(); - - return null; - } - - ISymbol GetCurrentMemberReference() - { - if (nodeStack == null || nodeStack.Count == 0) - return null; - - AstNode node = nodeStack.Peek(); - var symbol = node.GetSymbol(); - if (symbol == null && node.Role == Roles.TargetExpression && node.Parent is InvocationExpression) - { - symbol = node.Parent.GetSymbol(); - } - if (symbol != null && node.Role == Roles.Type && node.Parent is ObjectCreateExpression) - { - var ctorSymbol = node.Parent.GetSymbol(); - if (ctorSymbol != null) - symbol = ctorSymbol; - } - if (node is IdentifierExpression && node.Role == Roles.TargetExpression && node.Parent is InvocationExpression && symbol is IMember member) - { - var declaringType = member.DeclaringType; - if (declaringType != null && declaringType.Kind == TypeKind.Delegate) - return null; - } - return symbol; - } - - readonly Stack nodeStack = new Stack(); - - public override void StartNode(AstNode node) - { - nodeStack.Push(node); - base.StartNode(node); - } - - public override void EndNode(AstNode node) - { - base.EndNode(node); - nodeStack.Pop(); - } - - readonly Stack colorStack = new Stack(); - HighlightingColor currentColor = new HighlightingColor(); - int currentColorBegin = -1; - readonly ILocatable locatable; - readonly ISmartTextOutput textOutput; - - private void BeginSpan(HighlightingColor highlightingColor) - { - if (textOutput != null) - { - textOutput.BeginSpan(highlightingColor); - return; - } - - if (currentColorBegin > -1) - HighlightingModel.SetHighlighting(currentColorBegin, locatable.Length - currentColorBegin, currentColor); - colorStack.Push(currentColor); - currentColor = currentColor.Clone(); - currentColorBegin = locatable.Length; - currentColor.MergeWith(highlightingColor); - currentColor.Freeze(); - } - - private void EndSpan() - { - if (textOutput != null) - { - textOutput.EndSpan(); - return; - } - - HighlightingModel.SetHighlighting(currentColorBegin, locatable.Length - currentColorBegin, currentColor); - currentColor = colorStack.Pop(); - currentColorBegin = locatable.Length; - } - } -} diff --git a/ILSpy/Languages/CSharpILMixedLanguage.cs b/ILSpy/Languages/CSharpILMixedLanguage.cs deleted file mode 100644 index da06515fc..000000000 --- a/ILSpy/Languages/CSharpILMixedLanguage.cs +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) 2018 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection.Metadata; -using System.Windows.Media; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp; -using ICSharpCode.Decompiler.CSharp.OutputVisitor; -using ICSharpCode.Decompiler.CSharp.Syntax; -using ICSharpCode.Decompiler.Disassembler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.Decompiler.Util; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Extensions; - -namespace ICSharpCode.ILSpy -{ - using SequencePoint = ICSharpCode.Decompiler.DebugInfo.SequencePoint; - - [Export(typeof(Language))] - [Shared] - class CSharpILMixedLanguage(SettingsService settingsService, DockWorkspace dockWorkspace) : ILLanguage(dockWorkspace) - { - public override string Name => "IL with C#"; - - protected override ReflectionDisassembler CreateDisassembler(ITextOutput output, DecompilationOptions options) - { - var displaySettings = settingsService.DisplaySettings; - return new ReflectionDisassembler(output, - new MixedMethodBodyDisassembler(output, options) { - DetectControlStructure = detectControlStructure, - ShowSequencePoints = options.DecompilerSettings.ShowDebugInfo - }, - options.CancellationToken) { - ShowMetadataTokens = displaySettings.ShowMetadataTokens, - ShowMetadataTokensInBase10 = displaySettings.ShowMetadataTokensInBase10, - ShowRawRVAOffsetAndBytes = displaySettings.ShowRawOffsetsAndBytesBeforeInstruction, - ExpandMemberDefinitions = options.DecompilerSettings.ExpandMemberDefinitions, - DecodeCustomAttributeBlobs = displaySettings.DecodeCustomAttributeBlobs - }; - } - - static CSharpDecompiler CreateDecompiler(MetadataFile module, DecompilationOptions options) - { - CSharpDecompiler decompiler = new CSharpDecompiler(module, module.GetAssemblyResolver(), options.DecompilerSettings); - decompiler.CancellationToken = options.CancellationToken; - return decompiler; - } - - static void WriteCode(TextWriter output, DecompilerSettings settings, SyntaxTree syntaxTree, IDecompilerTypeSystem typeSystem) - { - syntaxTree.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true }); - TokenWriter tokenWriter = new TextWriterTokenWriter(output) { IndentationString = settings.CSharpFormattingOptions.IndentationString }; - tokenWriter = TokenWriter.WrapInWriterThatSetsLocationsInAST(tokenWriter); - syntaxTree.AcceptVisitor(new CSharpOutputVisitor(tokenWriter, settings.CSharpFormattingOptions)); - } - - class MixedMethodBodyDisassembler : MethodBodyDisassembler - { - readonly DecompilationOptions options; - // list sorted by IL offset - IList sequencePoints; - // lines of raw c# source code - string[] codeLines; - - public MixedMethodBodyDisassembler(ITextOutput output, DecompilationOptions options) - : base(output, options.CancellationToken) - { - this.options = options; - } - - public override void Disassemble(MetadataFile module, MethodDefinitionHandle handle) - { - try - { - var csharpOutput = new StringWriter(); - CSharpDecompiler decompiler = CreateDecompiler(module, options); - var st = decompiler.Decompile(handle); - WriteCode(csharpOutput, options.DecompilerSettings, st, decompiler.TypeSystem); - var mapping = decompiler.CreateSequencePoints(st).FirstOrDefault(kvp => (kvp.Key.MoveNextMethod ?? kvp.Key.Method)?.MetadataToken == handle); - this.sequencePoints = mapping.Value ?? (IList)EmptyList.Instance; - this.codeLines = csharpOutput.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.None); - base.Disassemble(module, handle); - } - finally - { - this.sequencePoints = null; - this.codeLines = null; - } - } - - protected override void WriteInstruction(ITextOutput output, MetadataFile metadata, MethodDefinitionHandle methodHandle, ref BlobReader blob, int methodRva) - { - int index = sequencePoints.BinarySearch(blob.Offset, seq => seq.Offset); - if (index >= 0) - { - var info = sequencePoints[index]; - var highlightingOutput = output as ISmartTextOutput; - if (!info.IsHidden) - { - for (int line = info.StartLine; line <= info.EndLine; line++) - { - if (highlightingOutput != null) - { - string text = codeLines[line - 1]; - int startColumn = 1; - int endColumn = text.Length + 1; - if (line == info.StartLine) - startColumn = info.StartColumn; - if (line == info.EndLine) - endColumn = info.EndColumn; - WriteHighlightedCommentLine(highlightingOutput, text, startColumn - 1, endColumn - 1, info.StartLine == info.EndLine); - } - else - WriteCommentLine(output, codeLines[line - 1]); - } - } - else - { - output.Write("// "); - highlightingOutput?.BeginSpan(gray); - output.WriteLine("(no C# code)"); - highlightingOutput?.EndSpan(); - } - } - base.WriteInstruction(output, metadata, methodHandle, ref blob, methodRva); - } - - HighlightingColor gray = new HighlightingColor { Foreground = new SimpleHighlightingBrush(Colors.DarkGray) }; - - void WriteHighlightedCommentLine(ISmartTextOutput output, string text, int startColumn, int endColumn, bool isSingleLine) - { - if (startColumn > text.Length) - { - Debug.Fail("startColumn is invalid"); - startColumn = text.Length; - } - if (endColumn > text.Length) - { - Debug.Fail("endColumn is invalid"); - endColumn = text.Length; - } - output.Write("// "); - output.BeginSpan(gray); - if (isSingleLine) - output.Write(text.Substring(0, startColumn).TrimStart()); - else - output.Write(text.Substring(0, startColumn)); - output.EndSpan(); - output.Write(text.Substring(startColumn, endColumn - startColumn)); - output.BeginSpan(gray); - output.Write(text.Substring(endColumn)); - output.EndSpan(); - output.WriteLine(); - } - - void WriteCommentLine(ITextOutput output, string text) - { - output.WriteLine("// " + text); - } - } - } -} diff --git a/ILSpy/Languages/CSharpLanguage.cs b/ILSpy/Languages/CSharpLanguage.cs deleted file mode 100644 index 7070b9df8..000000000 --- a/ILSpy/Languages/CSharpLanguage.cs +++ /dev/null @@ -1,812 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.PortableExecutable; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp; -using ICSharpCode.Decompiler.CSharp.OutputVisitor; -using ICSharpCode.Decompiler.CSharp.ProjectDecompiler; -using ICSharpCode.Decompiler.CSharp.Syntax; -using ICSharpCode.Decompiler.CSharp.Transforms; -using ICSharpCode.Decompiler.IL; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.Output; -using ICSharpCode.Decompiler.Solution; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX; - -using LanguageVersion = ICSharpCode.ILSpyX.LanguageVersion; - -namespace ICSharpCode.ILSpy -{ - /// - /// C# decompiler integration into ILSpy. - /// Note: if you're interested in using the decompiler without the ILSpy UI, - /// please directly use the CSharpDecompiler class. - /// - [Export(typeof(Language))] - [Shared] - public partial class CSharpLanguage : Language - { - string name = "C#"; - bool showAllMembers = false; - int transformCount = int.MaxValue; - -#if DEBUG - internal static IEnumerable GetDebugLanguages() - { - string lastTransformName = "no transforms"; - int transformCount = 0; - foreach (var transform in CSharpDecompiler.GetAstTransforms()) - { - yield return new() { - transformCount = transformCount, - name = "C# - " + lastTransformName, - showAllMembers = true - }; - lastTransformName = "after " + transform.GetType().Name; - transformCount++; - } - yield return new() { - name = "C# - " + lastTransformName, - showAllMembers = true - }; - } -#endif - - public override string Name { - get { return name; } - } - - public override string FileExtension { - get { return ".cs"; } - } - - public override string ProjectFileExtension { - get { return ".csproj"; } - } - - IReadOnlyList versions; - - public override IReadOnlyList LanguageVersions { - get { - if (versions == null) - { - versions = new List() { - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp1.ToString(), "C# 1.0 / VS .NET"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp2.ToString(), "C# 2.0 / VS 2005"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp3.ToString(), "C# 3.0 / VS 2008"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp4.ToString(), "C# 4.0 / VS 2010"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp5.ToString(), "C# 5.0 / VS 2012"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp6.ToString(), "C# 6.0 / VS 2015"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp7.ToString(), "C# 7.0 / VS 2017"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp7_1.ToString(), "C# 7.1 / VS 2017.3"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp7_2.ToString(), "C# 7.2 / VS 2017.4"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp7_3.ToString(), "C# 7.3 / VS 2017.7"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp8_0.ToString(), "C# 8.0 / VS 2019"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp9_0.ToString(), "C# 9.0 / VS 2019.8"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp10_0.ToString(), "C# 10.0 / VS 2022"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp11_0.ToString(), "C# 11.0 / VS 2022.4"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp12_0.ToString(), "C# 12.0 / VS 2022.8"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp13_0.ToString(), "C# 13.0 / VS 2022.12"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp14_0.ToString(), "C# 14.0 / VS 2026"), - new LanguageVersion(Decompiler.CSharp.LanguageVersion.CSharp15_0.ToString(), "C# 15.0 / VS 202x.yy"), - }; - } - return versions; - } - } - - CSharpDecompiler CreateDecompiler(MetadataFile module, DecompilationOptions options) - { - CSharpDecompiler decompiler = new CSharpDecompiler(module, module.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings); - decompiler.CancellationToken = options.CancellationToken; - decompiler.DebugInfoProvider = module.GetDebugInfoOrNull(); - while (decompiler.AstTransforms.Count > transformCount) - decompiler.AstTransforms.RemoveAt(decompiler.AstTransforms.Count - 1); - if (options.EscapeInvalidIdentifiers) - { - decompiler.AstTransforms.Add(new EscapeInvalidIdentifiers()); - } - return decompiler; - } - - void WriteCode(ITextOutput output, DecompilerSettings settings, SyntaxTree syntaxTree, IDecompilerTypeSystem typeSystem) - { - syntaxTree.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true }); - output.IndentationString = settings.CSharpFormattingOptions.IndentationString; - TokenWriter tokenWriter = new TextTokenWriter(output, settings, typeSystem); - if (output is ISmartTextOutput highlightingOutput) - { - tokenWriter = new CSharpHighlightingTokenWriter(tokenWriter, highlightingOutput); - } - syntaxTree.AcceptVisitor(new CSharpOutputVisitor(tokenWriter, settings.CSharpFormattingOptions)); - } - - public override void DecompileMethod(IMethod method, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = method.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(method.DeclaringType)); - var methodDefinition = decompiler.TypeSystem.MainModule.ResolveEntity(method.MetadataToken) as IMethod; - if (methodDefinition.IsConstructor && methodDefinition.DeclaringType.IsReferenceType != false) - { - var members = CollectFieldsAndCtors(methodDefinition.DeclaringTypeDefinition, methodDefinition.IsStatic); - decompiler.AstTransforms.Add(new SelectCtorTransform(methodDefinition)); - WriteCode(output, options.DecompilerSettings, decompiler.Decompile(members), decompiler.TypeSystem); - } - else - { - WriteCode(output, options.DecompilerSettings, decompiler.Decompile(method.MetadataToken), decompiler.TypeSystem); - } - } - - class SelectCtorTransform : IAstTransform - { - readonly IMethod ctor; - readonly HashSet removedSymbols = new HashSet(); - - public SelectCtorTransform(IMethod ctor) - { - this.ctor = ctor; - } - - public void Run(AstNode rootNode, TransformContext context) - { - ConstructorDeclaration ctorDecl = null; - foreach (var node in rootNode.Children) - { - switch (node) - { - case ConstructorDeclaration ctor: - if (ctor.GetSymbol() == this.ctor) - { - ctorDecl = ctor; - } - else - { - // remove other ctors - ctor.Remove(); - removedSymbols.Add(ctor.GetSymbol()); - } - break; - case FieldDeclaration fd: - // Remove any fields without initializers - if (fd.Variables.All(v => v.Initializer.IsNull)) - { - fd.Remove(); - removedSymbols.Add(fd.GetSymbol()); - } - break; - case EventDeclaration ed: - // Remove any events without initializers - if (ed.Variables.All(v => v.Initializer.IsNull)) - { - ed.Remove(); - removedSymbols.Add(ed.GetSymbol()); - } - break; - case PropertyDeclaration pd: - // Remove any properties without initializers - if (pd.Initializer.IsNull) - { - pd.Remove(); - removedSymbols.Add(pd.GetSymbol()); - } - break; - case CustomEventDeclaration ced: - case IndexerDeclaration id: - node.Remove(); - removedSymbols.Add(node.GetSymbol()); - break; - } - } - if (ctorDecl?.Initializer.ConstructorInitializerType == ConstructorInitializerType.This) - { - // remove all non-constructor declarations - foreach (var node in rootNode.Children) - { - if (node is not ConstructorDeclaration) - { - node.Remove(); - removedSymbols.Add(node.GetSymbol()); - } - } - } - foreach (var node in rootNode.Children) - { - if (node is Comment && removedSymbols.Contains(node.GetSymbol())) - node.Remove(); - } - } - } - - public override void DecompileProperty(IProperty property, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = property.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(property.DeclaringType)); - WriteCode(output, options.DecompilerSettings, decompiler.Decompile(property.MetadataToken), decompiler.TypeSystem); - } - - public override void DecompileField(IField field, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = field.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(field.DeclaringType)); - if (field.IsConst) - { - WriteCode(output, options.DecompilerSettings, decompiler.Decompile(field.MetadataToken), decompiler.TypeSystem); - } - else - { - var members = CollectFieldsAndCtors(field.DeclaringTypeDefinition, field.IsStatic); - var resolvedField = decompiler.TypeSystem.MainModule.GetDefinition((FieldDefinitionHandle)field.MetadataToken); - decompiler.AstTransforms.Add(new SelectFieldTransform(resolvedField)); - WriteCode(output, options.DecompilerSettings, decompiler.Decompile(members), decompiler.TypeSystem); - } - } - - static List CollectFieldsAndCtors(ITypeDefinition type, bool isStatic) - { - var members = new List(); - foreach (var field in type.Fields) - { - if (!field.MetadataToken.IsNil && field.IsStatic == isStatic) - members.Add(field.MetadataToken); - } - foreach (var e in type.Events) - { - if (!e.MetadataToken.IsNil && e.IsStatic == isStatic) - members.Add(e.MetadataToken); - } - foreach (var p in type.Properties) - { - if (!p.MetadataToken.IsNil && p.IsStatic == isStatic && !p.IsIndexer) - members.Add(p.MetadataToken); - } - foreach (var ctor in type.Methods) - { - if (!ctor.MetadataToken.IsNil && ctor.IsConstructor && ctor.IsStatic == isStatic) - members.Add(ctor.MetadataToken); - } - - return members; - } - - /// - /// Removes all top-level members except for the specified fields. - /// - sealed class SelectFieldTransform : IAstTransform - { - readonly IField field; - - public SelectFieldTransform(IField field) - { - this.field = field; - } - - public void Run(AstNode rootNode, TransformContext context) - { - foreach (var node in rootNode.Children) - { - switch (node) - { - case EntityDeclaration ed: - if (node.GetSymbol() != field) - node.Remove(); - break; - case Comment c: - if (c.GetSymbol() != field) - node.Remove(); - break; - } - } - } - } - - public override void DecompileEvent(IEvent @event, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = @event.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(@event.DeclaringType)); - WriteCode(output, options.DecompilerSettings, decompiler.Decompile(@event.MetadataToken), decompiler.TypeSystem); - } - - public override void DecompileType(ITypeDefinition type, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = type.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(type, ConversionFlags.UseFullyQualifiedTypeNames | ConversionFlags.UseFullyQualifiedEntityNames)); - WriteCode(output, options.DecompilerSettings, decompiler.Decompile(type.MetadataToken), decompiler.TypeSystem); - } - - public void DecompileExtension(ITypeDefinition extension, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = extension.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(extension, ConversionFlags.UseFullyQualifiedTypeNames | ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.SupportExtensionDeclarations)); - WriteCode(output, options.DecompilerSettings, decompiler.DecompileExtension(extension.MetadataToken), decompiler.TypeSystem); - } - - public void DecompileExtension(IMethod extension, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = extension.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(extension.DeclaringType, ConversionFlags.UseFullyQualifiedTypeNames | ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.SupportExtensionDeclarations)); - WriteCode(output, options.DecompilerSettings, decompiler.DecompileExtension(extension.MetadataToken), decompiler.TypeSystem); - } - - public void DecompileExtension(IProperty extension, ITextOutput output, DecompilationOptions options) - { - MetadataFile assembly = extension.ParentModule.MetadataFile; - CSharpDecompiler decompiler = CreateDecompiler(assembly, options); - AddReferenceAssemblyWarningMessage(assembly, output); - AddReferenceWarningMessage(assembly, output); - WriteCommentLine(output, assembly.FullName); - WriteCommentLine(output, TypeToString(extension.DeclaringType, ConversionFlags.UseFullyQualifiedTypeNames | ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.SupportExtensionDeclarations)); - WriteCode(output, options.DecompilerSettings, decompiler.DecompileExtension(extension.MetadataToken), decompiler.TypeSystem); - } - - void AddReferenceWarningMessage(MetadataFile module, ITextOutput output) - { - var loadedAssembly = AssemblyTreeModel.AssemblyList.GetAssemblies().FirstOrDefault(la => la.GetMetadataFileOrNull() == module); - if (loadedAssembly == null || !loadedAssembly.LoadedAssemblyReferencesInfo.HasErrors) - return; - string line1 = Properties.Resources.WarningSomeAssemblyReference; - string line2 = Properties.Resources.PropertyManuallyMissingReferencesListLoadedAssemblies; - AddWarningMessage(module, output, line1, line2, Properties.Resources.ShowAssemblyLoad, Images.ViewCode, delegate { - ILSpyTreeNode assemblyNode = AssemblyTreeModel.FindTreeNode(module); - assemblyNode.EnsureLazyChildren(); - AssemblyTreeModel.SelectNode(assemblyNode.Children.OfType().Single()); - }); - } - - void AddReferenceAssemblyWarningMessage(MetadataFile module, ITextOutput output) - { - var metadata = module.Metadata; - if (!metadata.GetCustomAttributes(Handle.AssemblyDefinition).HasKnownAttribute(metadata, KnownAttribute.ReferenceAssembly)) - return; - string line1 = Properties.Resources.WarningAsmMarkedRef; - AddWarningMessage(module, output, line1); - } - - public override ProjectId DecompileAssembly(LoadedAssembly assembly, ITextOutput output, DecompilationOptions options) - { - var module = assembly.GetMetadataFileOrNull(); - if (module == null) - { - return null; - } - if (options.FullDecompilation && options.SaveAsProjectDirectory != null) - { - if (!WholeProjectDecompiler.CanUseSdkStyleProjectFormat(module)) - { - options.DecompilerSettings.UseSdkStyleProjectFormat = false; - } - var decompiler = new ILSpyWholeProjectDecompiler(assembly, options) { - ProgressIndicator = options.Progress - }; - return decompiler.DecompileProject(module, options.SaveAsProjectDirectory, new TextOutputWriter(output), options.CancellationToken); - } - else - { - AddReferenceAssemblyWarningMessage(module, output); - AddReferenceWarningMessage(module, output); - output.WriteLine(); - base.DecompileAssembly(assembly, output, options); - - // don't automatically load additional assemblies when an assembly node is selected in the tree view - IAssemblyResolver assemblyResolver = assembly.GetAssemblyResolver(loadOnDemand: options.FullDecompilation && options.DecompilerSettings.AutoLoadAssemblyReferences); - var typeSystem = new DecompilerTypeSystem(module, assemblyResolver, options.DecompilerSettings); - var globalType = typeSystem.MainModule.TypeDefinitions.FirstOrDefault(); - if (globalType != null) - { - output.Write("// Global type: "); - output.WriteReference(globalType, ILAmbience.EscapeName(globalType.FullName)); - output.WriteLine(); - } - var metadata = module.Metadata; - var corHeader = module.CorHeader; - if (module is PEFile peFile && corHeader != null) - { - var entrypointHandle = MetadataTokenHelpers.EntityHandleOrNil(corHeader.EntryPointTokenOrRelativeVirtualAddress); - if (!entrypointHandle.IsNil && entrypointHandle.Kind == HandleKind.MethodDefinition) - { - var entrypoint = typeSystem.MainModule.ResolveMethod(entrypointHandle, new Decompiler.TypeSystem.GenericContext()); - if (entrypoint != null) - { - output.Write("// Entry point: "); - output.WriteReference(entrypoint, ILAmbience.EscapeName(entrypoint.DeclaringType.FullName + "." + entrypoint.Name)); - output.WriteLine(); - } - } - output.WriteLine("// Architecture: " + GetPlatformDisplayName(peFile)); - if ((corHeader.Flags & System.Reflection.PortableExecutable.CorFlags.ILOnly) == 0) - { - output.WriteLine("// This assembly contains unmanaged code."); - } - string runtimeName = GetRuntimeDisplayName(module); - if (runtimeName != null) - { - output.WriteLine("// Runtime: " + runtimeName); - } - if ((corHeader.Flags & System.Reflection.PortableExecutable.CorFlags.StrongNameSigned) != 0) - { - output.WriteLine("// This assembly is signed with a strong name key."); - } - if (peFile.Reader.ReadDebugDirectory().Any(d => d.Type == DebugDirectoryEntryType.Reproducible)) - { - output.WriteLine("// This assembly was compiled using the /deterministic option."); - } - if (module.Metadata.MetadataKind != MetadataKind.Ecma335) - { - output.WriteLine("// This assembly was loaded with Windows Runtime projections applied."); - } - } - else - { - string runtimeName = GetRuntimeDisplayName(module); - if (runtimeName != null) - { - output.WriteLine("// Runtime: " + runtimeName); - } - } - if (metadata.IsAssembly) - { - var asm = metadata.GetAssemblyDefinition(); - if (asm.HashAlgorithm != AssemblyHashAlgorithm.None) - output.WriteLine("// Hash algorithm: " + asm.HashAlgorithm.ToString().ToUpper()); - if (!asm.PublicKey.IsNil) - { - output.Write("// Public key: "); - var reader = metadata.GetBlobReader(asm.PublicKey); - while (reader.RemainingBytes > 0) - output.Write(reader.ReadByte().ToString("x2")); - output.WriteLine(); - } - } - var debugInfo = assembly.GetDebugInfoOrNull(); - if (debugInfo != null) - { - output.WriteLine("// Debug info: " + debugInfo.Description); - } - output.WriteLine(); - - CSharpDecompiler decompiler = new CSharpDecompiler(typeSystem, options.DecompilerSettings); - decompiler.CancellationToken = options.CancellationToken; - if (options.EscapeInvalidIdentifiers) - { - decompiler.AstTransforms.Add(new EscapeInvalidIdentifiers()); - } - SyntaxTree st; - if (options.FullDecompilation) - { - st = decompiler.DecompileWholeModuleAsSingleFile(); - } - else - { - st = decompiler.DecompileModuleAndAssemblyAttributes(); - } - WriteCode(output, options.DecompilerSettings, st, decompiler.TypeSystem); - return null; - } - } - - class ILSpyWholeProjectDecompiler : WholeProjectDecompiler - { - readonly LoadedAssembly assembly; - readonly DecompilationOptions options; - - public ILSpyWholeProjectDecompiler(LoadedAssembly assembly, DecompilationOptions options) - : base(options.DecompilerSettings, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences, options.DecompilerSettings.ApplyWindowsRuntimeProjections), null, assembly.GetAssemblyReferenceClassifier(options.DecompilerSettings.ApplyWindowsRuntimeProjections), assembly.GetDebugInfoOrNull()) - { - this.assembly = assembly; - this.options = options; - } - - protected override IEnumerable WriteResourceToFile(string fileName, string resourceName, Stream entryStream) - { - var context = new ResourceFileHandlerContext(options); - foreach (var handler in ResourceFileHandlers) - { - if (handler.CanHandle(fileName, context)) - { - entryStream.Position = 0; - fileName = handler.WriteResourceToFile(assembly, fileName, entryStream, context); - - return new[] { new ProjectItemInfo(handler.EntryType, fileName) { PartialTypes = context.PartialTypes }.With(context.AdditionalProperties) }; - } - } - return base.WriteResourceToFile(fileName, resourceName, entryStream); - } - } - - CSharpAmbience CreateAmbience() - { - CSharpAmbience ambience = new CSharpAmbience(); - // Do not forget to update CSharpAmbienceTests.ILSpyMainTreeViewTypeFlags, if this ever changes. - ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList | ConversionFlags.PlaceReturnTypeAfterParameterList; - var decompilerSettings = SettingsService.DecompilerSettings.Clone(); - if (!Enum.TryParse(AssemblyTreeModel.CurrentLanguageVersion?.Version, out Decompiler.CSharp.LanguageVersion languageVersion)) - languageVersion = Decompiler.CSharp.LanguageVersion.Latest; - decompilerSettings.SetLanguageVersion(languageVersion); - if (decompilerSettings.LiftNullables) - { - ambience.ConversionFlags |= ConversionFlags.UseNullableSpecifierForValueTypes; - } - if (decompilerSettings.IntroducePrivateProtectedAccessibility) - { - ambience.ConversionFlags |= ConversionFlags.UsePrivateProtectedAccessibility; - } - return ambience; - } - - public override string EntityToString(IEntity entity, ConversionFlags conversionFlags) - { - // Do not forget to update CSharpAmbienceTests, if this ever changes. - var ambience = CreateAmbience(); - ambience.ConversionFlags |= conversionFlags - | ConversionFlags.ShowReturnType - | ConversionFlags.ShowParameterList - | ConversionFlags.ShowParameterModifiers; - return ambience.ConvertSymbol(entity); - } - - public override string TypeToString(IType type, ConversionFlags conversionFlags = ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.UseFullyQualifiedTypeNames) - { - if (type == null) - throw new ArgumentNullException(nameof(type)); - var ambience = CreateAmbience(); - // Do not forget to update CSharpAmbienceTests.ILSpyMainTreeViewFlags, if this ever changes. - ambience.ConversionFlags |= conversionFlags; - if (type is ITypeDefinition definition) - { - return ambience.ConvertSymbol(definition); - } - else - { - return ambience.ConvertType(type); - } - } - - static string ToCSharpString(MetadataReader metadata, TypeDefinitionHandle handle, bool fullName, bool omitGenerics) - { - var currentTypeDefHandle = handle; - var typeDef = metadata.GetTypeDefinition(currentTypeDefHandle); - List builder = new List(); - - while (!currentTypeDefHandle.IsNil) - { - if (builder.Count > 0) - builder.Add("."); - typeDef = metadata.GetTypeDefinition(currentTypeDefHandle); - var part = ReflectionHelper.SplitTypeParameterCountFromReflectionName(metadata.GetString(typeDef.Name), out int typeParamCount); - var genericParams = typeDef.GetGenericParameters(); - if (!omitGenerics && genericParams.Count > 0) - { - builder.Add(">"); - int firstIndex = genericParams.Count - typeParamCount; - for (int i = genericParams.Count - 1; i >= genericParams.Count - typeParamCount; i--) - { - builder.Add(metadata.GetString(metadata.GetGenericParameter(genericParams[i]).Name)); - builder.Add(i == firstIndex ? "<" : ","); - } - } - builder.Add(part); - currentTypeDefHandle = typeDef.GetDeclaringType(); - if (!fullName) - break; - } - - if (fullName && !typeDef.Namespace.IsNil) - { - builder.Add("."); - builder.Add(metadata.GetString(typeDef.Namespace)); - } - - switch (builder.Count) - { - case 0: - return string.Empty; - case 1: - return builder[0]; - case 2: - return builder[1] + builder[0]; - case 3: - return builder[2] + builder[1] + builder[0]; - case 4: - return builder[3] + builder[2] + builder[1] + builder[0]; - default: - builder.Reverse(); - return string.Concat(builder); - } - } - - public override string GetEntityName(MetadataFile module, EntityHandle handle, bool fullName, bool omitGenerics) - { - MetadataReader metadata = module.Metadata; - switch (handle.Kind) - { - case HandleKind.TypeDefinition: - return ToCSharpString(metadata, (TypeDefinitionHandle)handle, fullName, omitGenerics); - case HandleKind.FieldDefinition: - var fd = metadata.GetFieldDefinition((FieldDefinitionHandle)handle); - var declaringType = fd.GetDeclaringType(); - if (fullName) - return ToCSharpString(metadata, declaringType, fullName, omitGenerics) + "." + metadata.GetString(fd.Name); - return metadata.GetString(fd.Name); - case HandleKind.MethodDefinition: - var md = metadata.GetMethodDefinition((MethodDefinitionHandle)handle); - declaringType = md.GetDeclaringType(); - string methodName = metadata.GetString(md.Name); - switch (methodName) - { - case ".ctor": - case ".cctor": - var td = metadata.GetTypeDefinition(declaringType); - methodName = ReflectionHelper.SplitTypeParameterCountFromReflectionName(metadata.GetString(td.Name)); - break; - case "Finalize": - const MethodAttributes finalizerAttributes = (MethodAttributes.Virtual | MethodAttributes.Family | MethodAttributes.HideBySig); - if ((md.Attributes & finalizerAttributes) != finalizerAttributes) - goto default; - MethodSignature methodSignature = md.DecodeSignature(MetadataExtensions.MinimalSignatureTypeProvider, default); - if (methodSignature.GenericParameterCount != 0 || methodSignature.ParameterTypes.Length != 0) - goto default; - td = metadata.GetTypeDefinition(declaringType); - methodName = "~" + ReflectionHelper.SplitTypeParameterCountFromReflectionName(metadata.GetString(td.Name)); - break; - default: - var genericParams = md.GetGenericParameters(); - if (!omitGenerics && genericParams.Count > 0) - { - methodName += "<"; - int i = 0; - foreach (var h in genericParams) - { - if (i > 0) - methodName += ","; - var gp = metadata.GetGenericParameter(h); - methodName += metadata.GetString(gp.Name); - } - methodName += ">"; - } - break; - } - if (fullName) - return ToCSharpString(metadata, declaringType, fullName, omitGenerics) + "." + methodName; - return methodName; - case HandleKind.EventDefinition: - var ed = metadata.GetEventDefinition((EventDefinitionHandle)handle); - declaringType = metadata.GetMethodDefinition(ed.GetAccessors().GetAny()).GetDeclaringType(); - if (fullName && !declaringType.IsNil) - return ToCSharpString(metadata, declaringType, fullName, omitGenerics) + "." + metadata.GetString(ed.Name); - return metadata.GetString(ed.Name); - case HandleKind.PropertyDefinition: - var pd = metadata.GetPropertyDefinition((PropertyDefinitionHandle)handle); - declaringType = metadata.GetMethodDefinition(pd.GetAccessors().GetAny()).GetDeclaringType(); - if (fullName && !declaringType.IsNil) - return ToCSharpString(metadata, declaringType, fullName, omitGenerics) + "." + metadata.GetString(pd.Name); - return metadata.GetString(pd.Name); - default: - return null; - } - } - - public override bool ShowMember(IEntity member) - { - MetadataFile assembly = member.ParentModule.MetadataFile; - var decompilerSettings = SettingsService.DecompilerSettings.Clone(); - if (!Enum.TryParse(AssemblyTreeModel.CurrentLanguageVersion?.Version, out Decompiler.CSharp.LanguageVersion languageVersion)) - languageVersion = Decompiler.CSharp.LanguageVersion.Latest; - decompilerSettings.SetLanguageVersion(languageVersion); - return showAllMembers || !CSharpDecompiler.MemberIsHidden(assembly, member.MetadataToken, decompilerSettings); - } - - public override RichText GetRichTextTooltip(IEntity entity) - { - var flags = ConversionFlags.All & ~(ConversionFlags.ShowBody | ConversionFlags.PlaceReturnTypeAfterParameterList); - var output = new StringWriter(); - var decoratedWriter = new TextWriterTokenWriter(output); - var writer = new CSharpHighlightingTokenWriter(TokenWriter.InsertRequiredSpaces(decoratedWriter), locatable: decoratedWriter); - var settings = SettingsService.DecompilerSettings.Clone(); - if (!Enum.TryParse(AssemblyTreeModel.CurrentLanguageVersion?.Version, out Decompiler.CSharp.LanguageVersion languageVersion)) - languageVersion = Decompiler.CSharp.LanguageVersion.Latest; - settings.SetLanguageVersion(languageVersion); - if (!settings.LiftNullables) - { - flags &= ~ConversionFlags.UseNullableSpecifierForValueTypes; - } - if (settings.RecordClasses) - { - flags |= ConversionFlags.SupportRecordClasses; - } - if (settings.RecordStructs) - { - flags |= ConversionFlags.SupportRecordStructs; - } - if (settings.UnsignedRightShift) - { - flags |= ConversionFlags.SupportUnsignedRightShift; - } - if (settings.CheckedOperators) - { - flags |= ConversionFlags.SupportOperatorChecked; - } - if (settings.InitAccessors) - { - flags |= ConversionFlags.SupportInitAccessors; - } - if (settings.IntroducePrivateProtectedAccessibility) - { - flags |= ConversionFlags.UsePrivateProtectedAccessibility; - } - if (entity is IMethod m && m.IsLocalFunction) - { - writer.WriteIdentifier(Identifier.Create("(local)")); - } - new CSharpAmbience() { - ConversionFlags = flags, - }.ConvertSymbol(entity, writer, settings.CSharpFormattingOptions); - return new RichText(output.ToString(), writer.HighlightingModel); - } - - public override CodeMappingInfo GetCodeMappingInfo(MetadataFile module, EntityHandle member) - { - return CSharpDecompiler.GetCodeMappingInfo(module, member); - } - - CSharpBracketSearcher bracketSearcher = new CSharpBracketSearcher(); - - public override IBracketSearcher BracketSearcher => bracketSearcher; - } -} diff --git a/ILSpy/Languages/CSharpLanguage.wpf.cs b/ILSpy/Languages/CSharpLanguage.wpf.cs deleted file mode 100644 index 61d378a20..000000000 --- a/ILSpy/Languages/CSharpLanguage.wpf.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - - -using System; -using System.Windows; -using System.Windows.Controls; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy -{ - - /// - /// C# decompiler integration into ILSpy. - /// Note: if you're interested in using the decompiler without the ILSpy UI, - /// please directly use the CSharpDecompiler class. - /// - partial class CSharpLanguage - { - void AddWarningMessage(MetadataFile module, ITextOutput output, string line1, string line2 = null, - string buttonText = null, System.Windows.Media.ImageSource buttonImage = null, RoutedEventHandler buttonClickHandler = null) - { - if (output is ISmartTextOutput fancyOutput) - { - string text = line1; - if (!string.IsNullOrEmpty(line2)) - text += Environment.NewLine + line2; - fancyOutput.AddUIElement(() => new StackPanel { - Margin = new Thickness(5), - Orientation = Orientation.Horizontal, - Children = { - new Image { - Width = 32, - Height = 32, - Source = Images.Load(this, "Images/Warning") - }, - new TextBlock { - Margin = new Thickness(5, 0, 0, 0), - Text = text - } - } - }); - fancyOutput.WriteLine(); - if (buttonText != null && buttonClickHandler != null) - { - fancyOutput.AddButton(buttonImage, buttonText, buttonClickHandler); - fancyOutput.WriteLine(); - } - } - else - { - WriteCommentLine(output, line1); - if (!string.IsNullOrEmpty(line2)) - WriteCommentLine(output, line2); - } - } - } -} diff --git a/ILSpy/Languages/ILAstLanguage.cs b/ILSpy/Languages/ILAstLanguage.cs deleted file mode 100644 index 9d3916667..000000000 --- a/ILSpy/Languages/ILAstLanguage.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp; -using ICSharpCode.Decompiler.Disassembler; -using ICSharpCode.Decompiler.IL; -using ICSharpCode.Decompiler.IL.Transforms; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX; - -using SRM = System.Reflection.Metadata; - -namespace ICSharpCode.ILSpy -{ -#if DEBUG - /// - /// Represents the ILAst "language" used for debugging purposes. - /// - abstract class ILAstLanguage : Language - { - public event EventHandler StepperUpdated; - - readonly string name; - - protected ILAstLanguage(string name) - { - this.name = name; - } - - protected virtual void OnStepperUpdated(EventArgs e = null) - { - StepperUpdated?.Invoke(this, e ?? new EventArgs()); - } - - public Stepper Stepper { get; set; } = new Stepper(); - - public override string Name { get { return name; } } - - internal static IEnumerable GetDebugLanguages(DockWorkspace dockWorkspace) - { - yield return new TypedIL(); - yield return new BlockIL(CSharpDecompiler.GetILTransforms(), dockWorkspace); - } - - public override string FileExtension { - get { - return ".il"; - } - } - - public override void DecompileMethod(IMethod method, ITextOutput output, DecompilationOptions options) - { - base.DecompileMethod(method, output, options); - new ReflectionDisassembler(output, options.CancellationToken) - .DisassembleMethodHeader(method.ParentModule.MetadataFile, (SRM.MethodDefinitionHandle)method.MetadataToken); - output.WriteLine(); - output.WriteLine(); - } - - class TypedIL() : ILAstLanguage("Typed IL") - { - public override void DecompileMethod(IMethod method, ITextOutput output, DecompilationOptions options) - { - base.DecompileMethod(method, output, options); - var module = method.ParentModule.MetadataFile; - var methodDef = module.Metadata.GetMethodDefinition((SRM.MethodDefinitionHandle)method.MetadataToken); - if (!methodDef.HasBody()) - return; - var typeSystem = new DecompilerTypeSystem(module, module.GetAssemblyResolver()); - ILReader reader = new ILReader(typeSystem.MainModule); - var methodBody = module.GetMethodBody(methodDef.RelativeVirtualAddress); - reader.WriteTypedIL((SRM.MethodDefinitionHandle)method.MetadataToken, methodBody, output, cancellationToken: options.CancellationToken); - } - } - - class BlockIL(IReadOnlyList transforms, DockWorkspace dockWorkspace) : ILAstLanguage("ILAst") - { - public override void DecompileMethod(IMethod method, ITextOutput output, DecompilationOptions options) - { - base.DecompileMethod(method, output, options); - var module = method.ParentModule.MetadataFile; - var metadata = module.Metadata; - var methodDef = metadata.GetMethodDefinition((SRM.MethodDefinitionHandle)method.MetadataToken); - if (!methodDef.HasBody()) - return; - IAssemblyResolver assemblyResolver = module.GetAssemblyResolver(); - var typeSystem = new DecompilerTypeSystem(module, assemblyResolver); - var reader = new ILReader(typeSystem.MainModule); - reader.UseDebugSymbols = options.DecompilerSettings.UseDebugSymbols; - reader.UseRefLocalsForAccurateOrderOfEvaluation = options.DecompilerSettings.UseRefLocalsForAccurateOrderOfEvaluation; - var methodBody = module.GetMethodBody(methodDef.RelativeVirtualAddress); - ILFunction il = reader.ReadIL((SRM.MethodDefinitionHandle)method.MetadataToken, methodBody, kind: ILFunctionKind.TopLevelFunction, cancellationToken: options.CancellationToken); - var decompiler = new CSharpDecompiler(typeSystem, options.DecompilerSettings) { CancellationToken = options.CancellationToken }; - ILTransformContext context = decompiler.CreateILTransformContext(il); - context.Stepper.StepLimit = options.StepLimit; - context.Stepper.IsDebug = options.IsDebug; - try - { - il.RunTransforms(transforms, context); - } - catch (StepLimitReachedException) - { - } - catch (Exception ex) - { - output.WriteLine(ex.ToString()); - output.WriteLine(); - output.WriteLine("ILAst after the crash:"); - } - finally - { - // update stepper even if a transform crashed unexpectedly - if (options.StepLimit == int.MaxValue) - { - Stepper = context.Stepper; - OnStepperUpdated(new EventArgs()); - } - } - (output as ISmartTextOutput)?.AddButton(Images.ViewCode, "Show Steps", delegate { - dockWorkspace.ShowToolPane(DebugStepsPaneModel.PaneContentId); - }); - output.WriteLine(); - il.WriteTo(output, DebugSteps.Options); - } - } - } -#endif -} diff --git a/ILSpy/Languages/ILLanguage.cs b/ILSpy/Languages/ILLanguage.cs deleted file mode 100644 index 748328b7e..000000000 --- a/ILSpy/Languages/ILLanguage.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Linq; -using System.Reflection.Metadata; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Disassembler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.Solution; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.Decompiler.Util; -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX; - -namespace ICSharpCode.ILSpy -{ - /// - /// IL language support. - /// - /// - /// Currently comes in two versions: - /// flat IL (detectControlStructure=false) and structured IL (detectControlStructure=true). - /// - [Export(typeof(Language))] - [Shared] - public class ILLanguage(DockWorkspace dockWorkspace) : Language - { - protected bool detectControlStructure = true; - - public override string Name { - get { return "IL"; } - } - - public override string FileExtension { - get { return ".il"; } - } - - protected virtual ReflectionDisassembler CreateDisassembler(ITextOutput output, DecompilationOptions options) - { - var displaySettings = SettingsService.DisplaySettings; - output.IndentationString = options.DecompilerSettings.CSharpFormattingOptions.IndentationString; - return new ReflectionDisassembler(output, options.CancellationToken) { - DetectControlStructure = detectControlStructure, - ShowSequencePoints = options.DecompilerSettings.ShowDebugInfo, - ShowMetadataTokens = displaySettings.ShowMetadataTokens, - ShowMetadataTokensInBase10 = displaySettings.ShowMetadataTokensInBase10, - ShowRawRVAOffsetAndBytes = displaySettings.ShowRawOffsetsAndBytesBeforeInstruction, - ExpandMemberDefinitions = options.DecompilerSettings.ExpandMemberDefinitions, - DecodeCustomAttributeBlobs = displaySettings.DecodeCustomAttributeBlobs - }; - } - - public override void DecompileMethod(IMethod method, ITextOutput output, DecompilationOptions options) - { - var dis = CreateDisassembler(output, options); - MetadataFile module = method.ParentModule.MetadataFile; - dis.AssemblyResolver = module.GetAssemblyResolver(); - dis.DebugInfo = module.GetDebugInfoOrNull(); - dis.DisassembleMethod(module, (MethodDefinitionHandle)method.MetadataToken); - } - - public override void DecompileField(IField field, ITextOutput output, DecompilationOptions options) - { - var dis = CreateDisassembler(output, options); - MetadataFile module = field.ParentModule.MetadataFile; - dis.AssemblyResolver = module.GetAssemblyResolver(); - dis.DebugInfo = module.GetDebugInfoOrNull(); - dis.DisassembleField(module, (FieldDefinitionHandle)field.MetadataToken); - } - - public override void DecompileProperty(IProperty property, ITextOutput output, DecompilationOptions options) - { - var dis = CreateDisassembler(output, options); - MetadataFile module = property.ParentModule.MetadataFile; - dis.AssemblyResolver = module.GetAssemblyResolver(); - dis.DebugInfo = module.GetDebugInfoOrNull(); - dis.DisassembleProperty(module, (PropertyDefinitionHandle)property.MetadataToken); - var pd = module.Metadata.GetPropertyDefinition((PropertyDefinitionHandle)property.MetadataToken); - var accessors = pd.GetAccessors(); - - if (!accessors.Getter.IsNil) - { - output.WriteLine(); - dis.DisassembleMethod(module, accessors.Getter); - } - if (!accessors.Setter.IsNil) - { - output.WriteLine(); - dis.DisassembleMethod(module, accessors.Setter); - } - /*foreach (var m in property.OtherMethods) { - output.WriteLine(); - dis.DisassembleMethod(m); - }*/ - } - - public override void DecompileEvent(IEvent ev, ITextOutput output, DecompilationOptions options) - { - var dis = CreateDisassembler(output, options); - MetadataFile module = ev.ParentModule.MetadataFile; - dis.AssemblyResolver = module.GetAssemblyResolver(); - dis.DebugInfo = module.GetDebugInfoOrNull(); - dis.DisassembleEvent(module, (EventDefinitionHandle)ev.MetadataToken); - - var ed = ((MetadataReader)module.Metadata).GetEventDefinition((EventDefinitionHandle)ev.MetadataToken); - var accessors = ed.GetAccessors(); - if (!accessors.Adder.IsNil) - { - output.WriteLine(); - dis.DisassembleMethod(module, accessors.Adder); - } - if (!accessors.Remover.IsNil) - { - output.WriteLine(); - dis.DisassembleMethod(module, accessors.Remover); - } - if (!accessors.Raiser.IsNil) - { - output.WriteLine(); - dis.DisassembleMethod(module, accessors.Raiser); - } - /*foreach (var m in ev.OtherMethods) { - output.WriteLine(); - dis.DisassembleMethod(m); - }*/ - } - - public override void DecompileType(ITypeDefinition type, ITextOutput output, DecompilationOptions options) - { - var dis = CreateDisassembler(output, options); - MetadataFile module = type.ParentModule.MetadataFile; - dis.AssemblyResolver = module.GetAssemblyResolver(); - dis.DebugInfo = module.GetDebugInfoOrNull(); - dis.DisassembleType(module, (TypeDefinitionHandle)type.MetadataToken); - } - - public override void DecompileNamespace(string nameSpace, IEnumerable types, ITextOutput output, DecompilationOptions options) - { - var dis = CreateDisassembler(output, options); - MetadataFile module = types.FirstOrDefault()?.ParentModule.MetadataFile; - dis.AssemblyResolver = module.GetAssemblyResolver(); - dis.DebugInfo = module.GetDebugInfoOrNull(); - dis.DisassembleNamespace(nameSpace, module, types.Select(t => (TypeDefinitionHandle)t.MetadataToken)); - } - - public override ProjectId DecompileAssembly(LoadedAssembly assembly, ITextOutput output, DecompilationOptions options) - { - output.WriteLine("// " + assembly.FileName); - output.WriteLine(); - var module = assembly.GetMetadataFileOrNull(); - - if (options.FullDecompilation && options.SaveAsProjectDirectory != null) - { - throw new NotSupportedException($"Language '{Name}' does not support exporting assemblies as projects!"); - } - - var metadata = module.Metadata; - var dis = CreateDisassembler(output, options); - - // don't automatically load additional assemblies when an assembly node is selected in the tree view - dis.AssemblyResolver = module.GetAssemblyResolver(loadOnDemand: options.FullDecompilation); - dis.DebugInfo = module.GetDebugInfoOrNull(); - if (options.FullDecompilation) - dis.WriteAssemblyReferences(metadata); - if (metadata.IsAssembly) - dis.WriteAssemblyHeader(module); - output.WriteLine(); - dis.WriteModuleHeader(module); - if (options.FullDecompilation) - { - output.WriteLine(); - output.WriteLine(); - dis.WriteModuleContents(module); - } - return null; - } - - public override RichText GetRichTextTooltip(IEntity entity) - { - var output = new AvalonEditTextOutput() { IgnoreNewLineAndIndent = true }; - - var disasm = CreateDisassembler(output, dockWorkspace.ActiveTabPage.CreateDecompilationOptions()); - MetadataFile module = entity.ParentModule?.MetadataFile; - if (module == null) - { - return null; - } - - switch (entity.SymbolKind) - { - case SymbolKind.TypeDefinition: - disasm.DisassembleTypeHeader(module, (TypeDefinitionHandle)entity.MetadataToken); - break; - case SymbolKind.Field: - disasm.DisassembleFieldHeader(module, (FieldDefinitionHandle)entity.MetadataToken); - break; - case SymbolKind.Property: - case SymbolKind.Indexer: - disasm.DisassemblePropertyHeader(module, (PropertyDefinitionHandle)entity.MetadataToken); - break; - case SymbolKind.Event: - disasm.DisassembleEventHeader(module, (EventDefinitionHandle)entity.MetadataToken); - break; - case SymbolKind.Method: - case SymbolKind.Operator: - case SymbolKind.Constructor: - case SymbolKind.Destructor: - case SymbolKind.Accessor: - disasm.DisassembleMethodHeader(module, (MethodDefinitionHandle)entity.MetadataToken); - break; - default: - output.Write(GetDisplayName(entity, true, true, true)); - break; - } - - return new DocumentHighlighter(output.GetDocument(), base.SyntaxHighlighting).HighlightLine(1).ToRichText(); - } - } -} diff --git a/ILSpy/Languages/IResourceFileHandler.cs b/ILSpy/Languages/IResourceFileHandler.cs deleted file mode 100644 index ef5226c74..000000000 --- a/ILSpy/Languages/IResourceFileHandler.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.IO; - -using ICSharpCode.Decompiler; -using ICSharpCode.ILSpyX; - -namespace ICSharpCode.ILSpy -{ - public interface IResourceFileHandler - { - string EntryType { get; } - bool CanHandle(string name, ResourceFileHandlerContext context); - string WriteResourceToFile(LoadedAssembly assembly, string fileName, Stream stream, ResourceFileHandlerContext context); - } - - public class ResourceFileHandlerContext - { - readonly List partialTypes = new(); - internal List PartialTypes => partialTypes; - - readonly Dictionary additionalProperties = new(); - public Dictionary AdditionalProperties => additionalProperties; - - public DecompilationOptions DecompilationOptions { get; } - - public ResourceFileHandlerContext(DecompilationOptions options) - { - this.DecompilationOptions = options; - } - - public void AddPartialTypeInfo(PartialTypeInfo info) - { - this.PartialTypes.Add(info); - } - } -} diff --git a/ILSpy/Languages/Language.cs b/ILSpy/Languages/Language.cs deleted file mode 100644 index 19750ecb9..000000000 --- a/ILSpy/Languages/Language.cs +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection.Metadata; -using System.Reflection.PortableExecutable; - -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.IL; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.Output; -using ICSharpCode.Decompiler.Solution; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.Decompiler.Util; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpyX; -using ICSharpCode.ILSpyX.Abstractions; - -namespace ICSharpCode.ILSpy -{ - /// - /// Base class for language-specific decompiler implementations. - /// - /// - /// Implementations of this class must be thread-safe. - /// - public abstract class Language : ILanguage - { - protected static SettingsService SettingsService { get; } = App.ExportProvider.GetExportedValue(); - - protected static AssemblyTreeModel AssemblyTreeModel { get; } = App.ExportProvider.GetExportedValue(); - - protected static ICollection ResourceFileHandlers { get; } = App.ExportProvider.GetExportedValues().ToArray(); - - /// - /// Gets the name of the language (as shown in the UI) - /// - public abstract string Name { get; } - - /// - /// Gets the file extension used by source code files in this language. - /// - public abstract string FileExtension { get; } - - public virtual string ProjectFileExtension { - get { return null; } - } - - public virtual IReadOnlyList LanguageVersions { - get { return EmptyList.Instance; } - } - - public bool HasLanguageVersions => LanguageVersions.Count > 0; - - /// - /// Gets the syntax highlighting used for this language. - /// - public virtual IHighlightingDefinition SyntaxHighlighting { - get { - return HighlightingManager.Instance.GetDefinitionByExtension(FileExtension); - } - } - - public virtual TextView.IBracketSearcher BracketSearcher { - get { - return TextView.DefaultBracketSearcher.DefaultInstance; - } - } - - public virtual void DecompileMethod(IMethod method, ITextOutput output, DecompilationOptions options) - { - WriteCommentLine(output, TypeToString(method.DeclaringTypeDefinition) + "." + method.Name); - } - - public virtual void DecompileProperty(IProperty property, ITextOutput output, DecompilationOptions options) - { - WriteCommentLine(output, TypeToString(property.DeclaringTypeDefinition) + "." + property.Name); - } - - public virtual void DecompileField(IField field, ITextOutput output, DecompilationOptions options) - { - WriteCommentLine(output, TypeToString(field.DeclaringTypeDefinition) + "." + field.Name); - } - - public virtual void DecompileEvent(IEvent @event, ITextOutput output, DecompilationOptions options) - { - WriteCommentLine(output, TypeToString(@event.DeclaringTypeDefinition) + "." + @event.Name); - } - - public virtual void DecompileType(ITypeDefinition type, ITextOutput output, DecompilationOptions options) - { - WriteCommentLine(output, TypeToString(type)); - } - - public virtual void DecompileNamespace(string nameSpace, IEnumerable types, ITextOutput output, DecompilationOptions options) - { - WriteCommentLine(output, nameSpace); - } - - public virtual ProjectId DecompileAssembly(LoadedAssembly assembly, ITextOutput output, DecompilationOptions options) - { - WriteCommentLine(output, assembly.FileName); - var asm = assembly.GetMetadataFileOrNull(); - if (asm == null) - return null; - if (options.FullDecompilation && options.SaveAsProjectDirectory != null) - { - throw new NotSupportedException($"Language '{Name}' does not support exporting assemblies as projects!"); - } - var metadata = asm.Metadata; - if (metadata.IsAssembly) - { - var name = metadata.GetAssemblyDefinition(); - if ((name.Flags & System.Reflection.AssemblyFlags.WindowsRuntime) != 0) - { - WriteCommentLine(output, metadata.GetString(name.Name) + " [WinRT]"); - } - else if (metadata.TryGetFullAssemblyName(out string assemblyName)) - { - WriteCommentLine(output, assemblyName); - } - else - { - WriteCommentLine(output, "ERR: Could not read assembly name"); - } - } - else - { - WriteCommentLine(output, metadata.GetString(metadata.GetModuleDefinition().Name)); - } - return null; - } - - public virtual void WriteCommentLine(ITextOutput output, string comment) - { - output.WriteLine("// " + comment); - } - - #region TypeToString - /// - /// Converts a type definition, reference or specification into a string. This method is used by tree nodes and search results. - /// - public virtual string TypeToString(IType type, ConversionFlags conversionFlags = ConversionFlags.UseFullyQualifiedTypeNames | ConversionFlags.UseFullyQualifiedEntityNames) - { - return new ILAmbience() { ConversionFlags = conversionFlags }.ConvertType(type); - } - #endregion - - /// - /// Converts a member signature to a string. - /// This is used for displaying the tooltip on a member reference. - /// - public virtual string GetTooltip(IEntity entity) - { - return GetDisplayName(entity, true, true, true); - } - - /// - /// Converts a member signature to a string. - /// This is used for displaying the tooltip on a member reference. - /// - public virtual RichText GetRichTextTooltip(IEntity entity) - { - return GetTooltip(entity); - } - - [Obsolete("Use EntityToString instead")] - public virtual string FieldToString(IField field, bool includeDeclaringTypeName, bool includeNamespace, bool includeNamespaceOfDeclaringTypeName) - { - if (field == null) - throw new ArgumentNullException(nameof(field)); - var flags = ConversionFlags.ShowTypeParameterList - | ConversionFlags.PlaceReturnTypeAfterParameterList - | ConversionFlags.ShowReturnType - | ConversionFlags.ShowParameterList - | ConversionFlags.ShowParameterModifiers; - if (includeDeclaringTypeName) - flags |= ConversionFlags.ShowDeclaringType; - if (includeNamespace) - flags |= ConversionFlags.UseFullyQualifiedTypeNames; - if (includeNamespaceOfDeclaringTypeName) - flags |= ConversionFlags.UseFullyQualifiedEntityNames; - return EntityToString(field, flags); - } - - [Obsolete("Use EntityToString instead")] - public virtual string PropertyToString(IProperty property, bool includeDeclaringTypeName, bool includeNamespace, bool includeNamespaceOfDeclaringTypeName) - { - if (property == null) - throw new ArgumentNullException(nameof(property)); - var flags = ConversionFlags.ShowTypeParameterList - | ConversionFlags.PlaceReturnTypeAfterParameterList - | ConversionFlags.ShowReturnType - | ConversionFlags.ShowParameterList - | ConversionFlags.ShowParameterModifiers; - if (includeDeclaringTypeName) - flags |= ConversionFlags.ShowDeclaringType; - if (includeNamespace) - flags |= ConversionFlags.UseFullyQualifiedTypeNames; - if (includeNamespaceOfDeclaringTypeName) - flags |= ConversionFlags.UseFullyQualifiedEntityNames; - return EntityToString(property, flags); - } - - [Obsolete("Use EntityToString instead")] - public virtual string MethodToString(IMethod method, bool includeDeclaringTypeName, bool includeNamespace, bool includeNamespaceOfDeclaringTypeName) - { - if (method == null) - throw new ArgumentNullException(nameof(method)); - var flags = ConversionFlags.ShowTypeParameterList - | ConversionFlags.PlaceReturnTypeAfterParameterList - | ConversionFlags.ShowReturnType - | ConversionFlags.ShowParameterList - | ConversionFlags.ShowParameterModifiers; - if (includeDeclaringTypeName) - flags |= ConversionFlags.ShowDeclaringType; - if (includeNamespace) - flags |= ConversionFlags.UseFullyQualifiedTypeNames; - if (includeNamespaceOfDeclaringTypeName) - flags |= ConversionFlags.UseFullyQualifiedEntityNames; - return EntityToString(method, flags); - } - - [Obsolete("Use EntityToString instead")] - public virtual string EventToString(IEvent @event, bool includeDeclaringTypeName, bool includeNamespace, bool includeNamespaceOfDeclaringTypeName) - { - if (@event == null) - throw new ArgumentNullException(nameof(@event)); - var flags = ConversionFlags.ShowTypeParameterList - | ConversionFlags.PlaceReturnTypeAfterParameterList - | ConversionFlags.ShowReturnType - | ConversionFlags.ShowParameterList - | ConversionFlags.ShowParameterModifiers; - if (includeDeclaringTypeName) - flags |= ConversionFlags.ShowDeclaringType; - if (includeNamespace) - flags |= ConversionFlags.UseFullyQualifiedTypeNames; - if (includeNamespaceOfDeclaringTypeName) - flags |= ConversionFlags.UseFullyQualifiedEntityNames; - return EntityToString(@event, flags); - } - - public virtual string EntityToString(IEntity entity, ConversionFlags conversionFlags) - { - var ambience = new ILAmbience(); - ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList - | ConversionFlags.PlaceReturnTypeAfterParameterList - | ConversionFlags.ShowReturnType - | ConversionFlags.ShowParameterList - | ConversionFlags.ShowParameterModifiers - | conversionFlags; - return ambience.ConvertSymbol(entity); - } - - protected string GetDisplayName(IEntity entity, bool includeDeclaringTypeName, bool includeNamespace, bool includeNamespaceOfDeclaringTypeName) - { - string entityName; - if (entity is ITypeDefinition t && !t.MetadataToken.IsNil) - { - MetadataReader metadata = t.ParentModule.MetadataFile.Metadata; - var typeDef = metadata.GetTypeDefinition((TypeDefinitionHandle)t.MetadataToken); - entityName = ILAmbience.EscapeName(metadata.GetString(typeDef.Name)); - } - else - { - entityName = ILAmbience.EscapeName(entity.Name); - } - if (includeNamespace || includeDeclaringTypeName) - { - if (entity.DeclaringTypeDefinition != null) - return TypeToString(entity.DeclaringTypeDefinition, ConversionFlags.ShowDeclaringType | ConversionFlags.UseFullyQualifiedEntityNames) + "." + entityName; - return ILAmbience.EscapeName(entity.Namespace) + "." + entityName; - } - else - { - return entityName; - } - } - - /// - /// Used for WPF keyboard navigation. - /// - public override string ToString() - { - return Name; - } - - public virtual bool ShowMember(IEntity member) - { - return true; - } - - /// - /// This should produce a string representation of the entity for search to match search strings against. - /// - public virtual string GetEntityName(MetadataFile module, EntityHandle handle, bool fullName, bool omitGenerics) - { - MetadataReader metadata = module.Metadata; - switch (handle.Kind) - { - case HandleKind.TypeDefinition: - if (fullName) - return ILAmbience.EscapeName(((TypeDefinitionHandle)handle).GetFullTypeName(metadata).ToILNameString(omitGenerics)); - var td = metadata.GetTypeDefinition((TypeDefinitionHandle)handle); - return ILAmbience.EscapeName(metadata.GetString(td.Name)); - case HandleKind.FieldDefinition: - var fd = metadata.GetFieldDefinition((FieldDefinitionHandle)handle); - if (fullName) - return ILAmbience.EscapeName(fd.GetDeclaringType().GetFullTypeName(metadata).ToILNameString(omitGenerics) + "." + metadata.GetString(fd.Name)); - return ILAmbience.EscapeName(metadata.GetString(fd.Name)); - case HandleKind.MethodDefinition: - var md = metadata.GetMethodDefinition((MethodDefinitionHandle)handle); - string methodName = metadata.GetString(md.Name); - if (!omitGenerics) - { - int genericParamCount = md.GetGenericParameters().Count; - if (genericParamCount > 0) - methodName += "``" + genericParamCount; - } - if (fullName) - return ILAmbience.EscapeName(md.GetDeclaringType().GetFullTypeName(metadata).ToILNameString(omitGenerics) + "." + methodName); - return ILAmbience.EscapeName(methodName); - case HandleKind.EventDefinition: - var ed = metadata.GetEventDefinition((EventDefinitionHandle)handle); - var declaringType = metadata.GetMethodDefinition(ed.GetAccessors().GetAny()).GetDeclaringType(); - if (fullName && !declaringType.IsNil) - return ILAmbience.EscapeName(declaringType.GetFullTypeName(metadata).ToILNameString(omitGenerics) + "." + metadata.GetString(ed.Name)); - return ILAmbience.EscapeName(metadata.GetString(ed.Name)); - case HandleKind.PropertyDefinition: - var pd = metadata.GetPropertyDefinition((PropertyDefinitionHandle)handle); - declaringType = metadata.GetMethodDefinition(pd.GetAccessors().GetAny()).GetDeclaringType(); - if (fullName && !declaringType.IsNil) - return ILAmbience.EscapeName(declaringType.GetFullTypeName(metadata).ToILNameString(omitGenerics) + "." + metadata.GetString(pd.Name)); - return ILAmbience.EscapeName(metadata.GetString(pd.Name)); - default: - return null; - } - } - - public virtual CodeMappingInfo GetCodeMappingInfo(MetadataFile module, EntityHandle member) - { - var declaringType = (TypeDefinitionHandle)member.GetDeclaringType(module.Metadata); - - if (declaringType.IsNil && member.Kind == HandleKind.TypeDefinition) - { - declaringType = (TypeDefinitionHandle)member; - } - - return new CodeMappingInfo(module, declaringType); - } - - static readonly IReadOnlyDictionary osMachineLookup = new Dictionary - { - { (Machine)0x4644, "MacOS" }, - { (Machine)0x7b79, "Linux" }, - { (Machine)0xadc4, "FreeBSD" }, - { (Machine)0x1993, "NetBSD" }, - { (Machine)0x1992, "Sun" }, - }; - - public static string GetPlatformDisplayName(PEFile module) - { - var headers = module.Reader.PEHeaders; - var architecture = headers.CoffHeader.Machine; - var characteristics = headers.CoffHeader.Characteristics; - var corflags = headers.CorHeader.Flags; - - var modifier = string.Empty; - - if (!Enum.IsDefined(architecture)) - { - foreach (var (osEnum, osText) in osMachineLookup) - { - var candidate = architecture ^ osEnum; - if (Enum.IsDefined(candidate)) - { - modifier = osText + " "; - architecture = candidate; - break; - } - } - } - - switch (architecture) - { - case Machine.I386: - if ((corflags & CorFlags.Prefers32Bit) != 0) - return modifier + "AnyCPU (32-bit preferred)"; - if ((corflags & CorFlags.Requires32Bit) != 0) - return modifier + "x86"; - // According to ECMA-335, II.25.3.3.1 CorFlags.Requires32Bit and Characteristics.Bit32Machine must be in sync - // for assemblies containing managed code. However, this is not true for C++/CLI assemblies. - if ((corflags & CorFlags.ILOnly) == 0 && (characteristics & Characteristics.Bit32Machine) != 0) - return modifier + "x86"; - return modifier + "AnyCPU (64-bit preferred)"; - case Machine.Amd64: - return modifier + "x64"; - case Machine.IA64: - return modifier + "Itanium"; - default: - return architecture.ToString(); - } - } - - public static string GetRuntimeDisplayName(MetadataFile module) - { - return module.Metadata.MetadataVersion; - } - } -} diff --git a/ILSpy/Languages/LanguageService.cs b/ILSpy/Languages/LanguageService.cs deleted file mode 100644 index 7cd6e47e1..000000000 --- a/ILSpy/Languages/LanguageService.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Composition; -using System.Linq; - -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpyX; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy -{ - [Export] - [Shared] - public class LanguageService : ObservableObjectBase - { - private readonly SettingsService settingsService; - private readonly LanguageSettings languageSettings; - - public LanguageService(IEnumerable languages, SettingsService settingsService, DockWorkspace dockWorkspace) - { - this.settingsService = settingsService; - languageSettings = settingsService.SessionSettings.LanguageSettings; - - var sortedLanguages = languages.ToList(); - - sortedLanguages.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.Ordinal)); -#if DEBUG - sortedLanguages.AddRange(ILAstLanguage.GetDebugLanguages(dockWorkspace)); - sortedLanguages.AddRange(CSharpLanguage.GetDebugLanguages()); -#endif - AllLanguages = sortedLanguages.AsReadOnly(); - - this.language = GetLanguage(languageSettings.LanguageId); - this.languageVersion = Language.LanguageVersions.FirstOrDefault(v => v.Version == languageSettings.LanguageVersionId) ?? Language.LanguageVersions.LastOrDefault(); - } - - /// - /// A list of all languages. - /// - public ReadOnlyCollection AllLanguages { get; } - - /// - /// Gets a language using its name. - /// If the language is not found, C# is returned instead. - /// - public Language GetLanguage(string? name) - { - return AllLanguages.FirstOrDefault(l => l.Name == name) ?? AllLanguages.First(); - } - - ILLanguage? ilLanguage; - - public ILLanguage ILLanguage => ilLanguage ??= (ILLanguage)GetLanguage("IL"); - - /// - /// This dictionary is necessary to remember language versions across language changes. For example, - /// the user first select C# 10, then switches to IL, then switches back to C#. After that we must be - /// able to restore the original selection (i.e., C# 10). - /// - private readonly Dictionary languageVersionHistory = new(); - - Language language; - - /// - /// Gets/Sets the current language. - /// - /// - /// While this isn't related to filtering, having it as part of the FilterSettings - /// makes it easy to pass it down into all tree nodes. - /// - public Language Language { - get => language; - set { - if (language == value) - return; - - if (language is { HasLanguageVersions: true }) - { - languageVersionHistory[language] = languageVersion; - } - - language = value; - OnPropertyChanged(); - - languageSettings.LanguageId = language.Name; - - if (language.HasLanguageVersions) - { - LanguageVersion = languageVersionHistory.TryGetValue(value, out var version) ? version : Language.LanguageVersions.Last(); - } - else - { - LanguageVersion = default; - } - } - } - - LanguageVersion? languageVersion; - - /// - /// Gets/Sets the current language version. - /// - /// - /// While this isn't related to filtering, having it as part of the FilterSettings - /// makes it easy to pass it down into all tree nodes. - /// - public LanguageVersion? LanguageVersion { - get { return languageVersion; } - set { - if (languageVersion == value) - return; - - languageVersion = value; - OnPropertyChanged(); - - if (Language.HasLanguageVersions) - { - languageVersionHistory[Language] = languageVersion; - } - - languageSettings.LanguageVersionId = languageVersion?.Version; - } - } - } -} diff --git a/ILSpy/MainWindow.xaml b/ILSpy/MainWindow.xaml deleted file mode 100644 index 0ab9f3ae2..000000000 --- a/ILSpy/MainWindow.xaml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs deleted file mode 100644 index ab2a133b6..000000000 --- a/ILSpy/MainWindow.xaml.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.ComponentModel; -using System.Composition; -using System.Drawing; -using System.Linq; -using System.Windows; -using System.Windows.Media; -using System.Windows.Threading; - -using Screen = System.Windows.Forms.Screen; - -namespace ICSharpCode.ILSpy -{ - /// - /// The main window of the application. - /// - [Export] - [Shared] -#pragma warning disable MEF003 // Main window is a singleton - partial class MainWindow - { - private readonly SettingsService settingsService; - - public MainWindow(MainWindowViewModel mainWindowViewModel, SettingsService settingsService) - { - this.settingsService = settingsService; - - // Make sure Images are initialized on the UI thread. - this.Icon = Images.ILSpyIcon; - - this.DataContext = mainWindowViewModel; - - InitializeComponent(); - - Dispatcher.BeginInvoke(DispatcherPriority.Background, () => { - mainWindowViewModel.Workspace.InitializeLayout(); - MessageBus.Send(this, new MainWindowLoadedEventArgs()); - }); - } - - void SetWindowBounds(Rect bounds) - { - this.Left = bounds.Left; - this.Top = bounds.Top; - this.Width = bounds.Width; - this.Height = bounds.Height; - } - - protected override void OnSourceInitialized(EventArgs e) - { - base.OnSourceInitialized(e); - - var source = PresentationSource.FromVisual(this); - - var sessionSettings = settingsService.SessionSettings; - - // Validate and Set Window Bounds - var windowBounds = Rect.Transform(sessionSettings.WindowBounds, source?.CompositionTarget?.TransformToDevice ?? Matrix.Identity); - var boundsRect = new Rectangle((int)windowBounds.Left, (int)windowBounds.Top, (int)windowBounds.Width, (int)windowBounds.Height); - - bool areBoundsValid = Screen.AllScreens.Any(screen => Rectangle.Intersect(boundsRect, screen.WorkingArea) is { Width: > 10, Height: > 10 }); - - SetWindowBounds(areBoundsValid ? sessionSettings.WindowBounds : SessionSettings.DefaultWindowBounds); - - this.WindowState = sessionSettings.WindowState; - } - - protected override void OnStateChanged(EventArgs e) - { - base.OnStateChanged(e); - // store window state in settings only if it's not minimized - if (this.WindowState != WindowState.Minimized) - settingsService.SessionSettings.WindowState = this.WindowState; - } - - protected override void OnClosing(CancelEventArgs e) - { - base.OnClosing(e); - - var snapshot = settingsService.CreateSnapshot(); - - var sessionSettings = snapshot.GetSettings(); - - MessageBus.Send(this, new ApplySessionSettingsEventArgs(sessionSettings)); - - sessionSettings.WindowBounds = this.RestoreBounds; - // store window state in settings only if it's not minimized - if (this.WindowState != WindowState.Minimized) - sessionSettings.WindowState = this.WindowState; - sessionSettings.DockLayout.Serialize(new(DockManager)); - - snapshot.Save(); - } - } -} \ No newline at end of file diff --git a/ILSpy/MainWindowViewModel.cs b/ILSpy/MainWindowViewModel.cs deleted file mode 100644 index ffc83cc7e..000000000 --- a/ILSpy/MainWindowViewModel.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2021 Siegfried Pammer -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; - -using ICSharpCode.ILSpy.Docking; -using ICSharpCode.ILSpyX; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy -{ - [Export] - [Shared] - public class MainWindowViewModel(SettingsService settingsService, LanguageService languageService, DockWorkspace dockWorkspace) : ObservableObjectBase - { - public DockWorkspace Workspace { get; } = dockWorkspace; - - public SessionSettings SessionSettings => settingsService.SessionSettings; - - public LanguageService LanguageService => languageService; - - public AssemblyListManager AssemblyListManager => settingsService.AssemblyListManager; - } -} diff --git a/ILSpy/Metadata/CoffHeaderTreeNode.cs b/ILSpy/Metadata/CoffHeaderTreeNode.cs deleted file mode 100644 index 20b46050f..000000000 --- a/ILSpy/Metadata/CoffHeaderTreeNode.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX.Extensions; - -using TomsToolbox.Essentials; - -namespace ICSharpCode.ILSpy.Metadata -{ - class CoffHeaderTreeNode : ILSpyTreeNode - { - private PEFile module; - - public CoffHeaderTreeNode(PEFile module) - { - this.module = module; - } - - public override object Text => "COFF Header"; - - public override object NavigationText => $"{Text} ({module.Name})"; - - public override object Icon => Images.Header; - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var dataGrid = Helpers.PrepareDataGrid(tabPage, this); - - dataGrid.RowDetailsTemplateSelector = new CharacteristicsDataTemplateSelector("Characteristics"); - dataGrid.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed; - - dataGrid.Columns.Clear(); - dataGrid.AutoGenerateColumns = false; - dataGrid.Columns.AddRange( - new[] { - new DataGridTextColumn { IsReadOnly = true, Header = "Member", Binding = new Binding("Member") }, - new DataGridTextColumn { IsReadOnly = true, Header = "Offset", Binding = new Binding("Offset") { StringFormat = "X8" } }, - new DataGridTextColumn { IsReadOnly = true, Header = "Size", Binding = new Binding("Size") }, - new DataGridTextColumn { IsReadOnly = true, Header = "Value", Binding = new Binding(".") { Converter = ByteWidthConverter.Instance } }, - new DataGridTextColumn { IsReadOnly = true, Header = "Meaning", Binding = new Binding("Meaning") } - } - ); - var headers = module.Reader.PEHeaders; - var header = headers.CoffHeader; - - var linkerDateTime = DateTimeOffset.FromUnixTimeSeconds(unchecked((uint)header.TimeDateStamp)).DateTime; - - var entries = new List(); - entries.Add(new Entry(headers.CoffHeaderStartOffset, (int)header.Machine, 2, "Machine", header.Machine.ToString())); - entries.Add(new Entry(headers.CoffHeaderStartOffset + 2, (int)header.NumberOfSections, 2, "Number of Sections", "Number of sections; indicates size of the Section Table, which immediately follows the headers.")); - entries.Add(new Entry(headers.CoffHeaderStartOffset + 4, header.TimeDateStamp, 4, "Time/Date Stamp", $"{linkerDateTime} (UTC) / {linkerDateTime.ToLocalTime()} - Time and date the file was created in seconds since January 1st 1970 00:00:00 or 0. Note that for deterministic builds this value is meaningless.")); - entries.Add(new Entry(headers.CoffHeaderStartOffset + 8, header.PointerToSymbolTable, 4, "Pointer to Symbol Table", "Always 0 in .NET executables.")); - entries.Add(new Entry(headers.CoffHeaderStartOffset + 12, header.NumberOfSymbols, 4, "Number of Symbols", "Always 0 in .NET executables.")); - entries.Add(new Entry(headers.CoffHeaderStartOffset + 16, (int)header.SizeOfOptionalHeader, 2, "Optional Header Size", "Size of the optional header.")); - Entry characteristics; - entries.Add(characteristics = new Entry(headers.CoffHeaderStartOffset + 18, (int)header.Characteristics, 2, "Characteristics", "Flags indicating attributes of the file.", new[] { - new BitEntry(((int)header.Characteristics & 0x0001) != 0, "<0001> Relocation info stripped from file"), - new BitEntry(((int)header.Characteristics & 0x0002) != 0, "<0002> File is executable"), - new BitEntry(((int)header.Characteristics & 0x0004) != 0, "<0004> Line numbers stripped from file"), - new BitEntry(((int)header.Characteristics & 0x0008) != 0, "<0008> Local symbols stripped from file"), - new BitEntry(((int)header.Characteristics & 0x0010) != 0, "<0010> Aggressively trim working set"), - new BitEntry(((int)header.Characteristics & 0x0020) != 0, "<0020> Large address aware"), - new BitEntry(((int)header.Characteristics & 0x0040) != 0, "<0040> Reserved"), - new BitEntry(((int)header.Characteristics & 0x0080) != 0, "<0080> Bytes of machine words are reversed (Low)"), - new BitEntry(((int)header.Characteristics & 0x0100) != 0, "<0100> 32-bit word machine"), - new BitEntry(((int)header.Characteristics & 0x0200) != 0, "<0200> Debugging info stripped from file in .DBG file"), - new BitEntry(((int)header.Characteristics & 0x0400) != 0, "<0400> If image is on removable media, copy and run from the swap file"), - new BitEntry(((int)header.Characteristics & 0x0800) != 0, "<0800> If image is on Net, copy and run from the swap file"), - new BitEntry(((int)header.Characteristics & 0x1000) != 0, "<1000> System"), - new BitEntry(((int)header.Characteristics & 0x2000) != 0, "<2000> DLL"), - new BitEntry(((int)header.Characteristics & 0x4000) != 0, "<4000> File should only be run on a UP machine"), - new BitEntry(((int)header.Characteristics & 0x8000) != 0, "<8000> Bytes of machine words are reversed (High)"), - })); - - dataGrid.ItemsSource = entries; - dataGrid.SetDetailsVisibilityForItem(characteristics, Visibility.Visible); - tabPage.Content = dataGrid; - return true; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - } - } - - public class CharacteristicsDataTemplateSelector : DataTemplateSelector - { - string detailsFieldName; - - public CharacteristicsDataTemplateSelector(string detailsFieldName) - { - this.detailsFieldName = detailsFieldName; - } - - public override DataTemplate SelectTemplate(object item, DependencyObject container) - { - if (((Entry)item).Member == detailsFieldName) - return (DataTemplate)MetadataTableViews.Instance["HeaderFlagsDetailsDataGrid"]; - return null; - } - } -} diff --git a/ILSpy/Metadata/CorTables/AssemblyRefTableTreeNode.cs b/ILSpy/Metadata/CorTables/AssemblyRefTableTreeNode.cs deleted file mode 100644 index ee5bcb07e..000000000 --- a/ILSpy/Metadata/CorTables/AssemblyRefTableTreeNode.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class AssemblyRefTableTreeNode : MetadataTableTreeNode - { - public AssemblyRefTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.AssemblyRef, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.AssemblyReferences) - { - list.Add(new AssemblyRefEntry(metadataFile, row)); - } - return list; - } - - internal struct AssemblyRefEntry - { - readonly MetadataFile metadataFile; - readonly AssemblyReferenceHandle handle; - readonly System.Reflection.Metadata.AssemblyReference assemblyRef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.AssemblyRef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.AssemblyRef) * (RID - 1); - - public Version Version => assemblyRef.Version; - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public AssemblyFlags Flags => assemblyRef.Flags; - - public object FlagsTooltip => new FlagsTooltip((int)assemblyRef.Flags, null) { - FlagGroup.CreateMultipleChoiceGroup(typeof(AssemblyFlags), selectedValue: (int)assemblyRef.Flags, includeAll: false) - }; - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int PublicKeyOrToken => MetadataTokens.GetHeapOffset(assemblyRef.PublicKeyOrToken); - - public string PublicKeyOrTokenTooltip { - get { - if (assemblyRef.PublicKeyOrToken.IsNil) - return null; - System.Collections.Immutable.ImmutableArray token = metadataFile.Metadata.GetBlobContent(assemblyRef.PublicKeyOrToken); - return token.ToHexString(token.Length); - } - } - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(assemblyRef.Name):X} \"{Name}\""; - - public string Name => metadataFile.Metadata.GetString(assemblyRef.Name); - - public string CultureTooltip => $"{MetadataTokens.GetHeapOffset(assemblyRef.Culture):X} \"{Culture}\""; - - public string Culture => metadataFile.Metadata.GetString(assemblyRef.Culture); - - public AssemblyRefEntry(MetadataFile metadataFile, AssemblyReferenceHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.assemblyRef = metadataFile.Metadata.GetAssemblyReference(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/AssemblyTableTreeNode.cs b/ILSpy/Metadata/CorTables/AssemblyTableTreeNode.cs deleted file mode 100644 index f02ce3e48..000000000 --- a/ILSpy/Metadata/CorTables/AssemblyTableTreeNode.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class AssemblyTableTreeNode : MetadataTableTreeNode - { - public AssemblyTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Assembly, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - if (metadataFile.Metadata.IsAssembly) - { - return [new AssemblyEntry(metadataFile.Metadata, metadataFile.MetadataOffset)]; - } - else - { - return []; - } - } - - internal readonly struct AssemblyEntry - { - readonly int metadataOffset; - readonly MetadataReader metadata; - readonly AssemblyDefinition assembly; - - public int RID => MetadataTokens.GetRowNumber(EntityHandle.AssemblyDefinition); - - public int Token => MetadataTokens.GetToken(EntityHandle.AssemblyDefinition); - - public int Offset => metadataOffset - + metadata.GetTableMetadataOffset(TableIndex.Assembly) - + metadata.GetTableRowSize(TableIndex.Assembly) * (RID - 1); - - [ColumnInfo("X4", Kind = ColumnKind.Other)] - public AssemblyHashAlgorithm HashAlgorithm => assembly.HashAlgorithm; - - public object HashAlgorithmTooltip => new FlagsTooltip() { - FlagGroup.CreateSingleChoiceGroup(typeof(AssemblyHashAlgorithm), selectedValue: (int)assembly.HashAlgorithm, defaultFlag: new Flag("None (0000)", 0, false), includeAny: false) - }; - - [ColumnInfo("X4", Kind = ColumnKind.Other)] - public AssemblyFlags Flags => assembly.Flags; - - public object FlagsTooltip => new FlagsTooltip() { - FlagGroup.CreateMultipleChoiceGroup(typeof(AssemblyFlags), selectedValue: (int)assembly.Flags, includeAll: false) - }; - - public Version Version => assembly.Version; - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(assembly.Name):X} \"{Name}\""; - - public string Name => metadata.GetString(assembly.Name); - - public string CultureTooltip => $"{MetadataTokens.GetHeapOffset(assembly.Culture):X} \"{Culture}\""; - - public string Culture => metadata.GetString(assembly.Culture); - - public AssemblyEntry(MetadataReader metadata, int metadataOffset) - { - this.metadata = metadata; - this.metadataOffset = metadataOffset; - this.assembly = metadata.GetAssemblyDefinition(); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/ClassLayoutTableTreeNode.cs b/ILSpy/Metadata/CorTables/ClassLayoutTableTreeNode.cs deleted file mode 100644 index 6aa8e9712..000000000 --- a/ILSpy/Metadata/CorTables/ClassLayoutTableTreeNode.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Buffers.Binary; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class ClassLayoutTableTreeNode : MetadataTableTreeNode - { - public ClassLayoutTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.ClassLayout, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - var length = metadataFile.Metadata.GetTableRowCount(TableIndex.ClassLayout); - ReadOnlySpan ptr = metadataFile.Metadata.AsReadOnlySpan(); - - for (int rid = 1; rid <= length; rid++) - { - list.Add(new ClassLayoutEntry(metadataFile, ptr, rid)); - } - - return list; - } - - readonly struct ClassLayout - { - public readonly ushort PackingSize; - public readonly EntityHandle Parent; - public readonly uint ClassSize; - - public ClassLayout(ReadOnlySpan ptr, int typeDefSize) - { - PackingSize = BinaryPrimitives.ReadUInt16LittleEndian(ptr); - ClassSize = BinaryPrimitives.ReadUInt32LittleEndian(ptr.Slice(2, 4)); - Parent = MetadataTokens.TypeDefinitionHandle(Helpers.GetValueLittleEndian(ptr.Slice(6, typeDefSize))); - } - } - - internal struct ClassLayoutEntry - { - readonly MetadataFile metadataFile; - readonly ClassLayout classLayout; - - public int RID { get; } - - public int Token => 0x0F000000 | RID; - - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(classLayout.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference("metadata", classLayout.Parent))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, classLayout.Parent); - - [ColumnInfo("X4", Kind = ColumnKind.Other)] - public ushort PackingSize => classLayout.PackingSize; - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public uint ClassSize => classLayout.ClassSize; - - public ClassLayoutEntry(MetadataFile metadataFile, ReadOnlySpan ptr, int row) - { - this.metadataFile = metadataFile; - this.RID = row; - var metadata = metadataFile.Metadata; - var rowOffset = metadata.GetTableMetadataOffset(TableIndex.ClassLayout) - + metadata.GetTableRowSize(TableIndex.ClassLayout) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.classLayout = new ClassLayout(ptr.Slice(rowOffset), metadata.GetTableRowCount(TableIndex.TypeDef) < ushort.MaxValue ? 2 : 4); - this.parentTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/ConstantTableTreeNode.cs b/ILSpy/Metadata/CorTables/ConstantTableTreeNode.cs deleted file mode 100644 index 17ec29087..000000000 --- a/ILSpy/Metadata/CorTables/ConstantTableTreeNode.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class ConstantTableTreeNode : MetadataTableTreeNode - { - public ConstantTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Constant, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - for (int row = 1; row <= metadataFile.Metadata.GetTableRowCount(TableIndex.Constant); row++) - { - list.Add(new ConstantEntry(metadataFile, MetadataTokens.ConstantHandle(row))); - } - return list; - } - - internal struct ConstantEntry - { - readonly MetadataFile metadataFile; - readonly EntityHandle handle; - readonly Constant constant; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.Constant) - + metadataFile.Metadata.GetTableRowSize(TableIndex.Constant) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public ConstantTypeCode Type => constant.TypeCode; - - public string TypeTooltip => constant.TypeCode.ToString(); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(constant.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, constant.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, constant.Parent); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Value => MetadataTokens.GetHeapOffset(constant.Value); - - public string ValueTooltip { - get { - return null; - } - } - - public ConstantEntry(MetadataFile metadataFile, ConstantHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.constant = metadataFile.Metadata.GetConstant(handle); - this.parentTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/CustomAttributeTableTreeNode.cs b/ILSpy/Metadata/CorTables/CustomAttributeTableTreeNode.cs deleted file mode 100644 index 9e8a507b9..000000000 --- a/ILSpy/Metadata/CorTables/CustomAttributeTableTreeNode.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class CustomAttributeTableTreeNode : MetadataTableTreeNode - { - public CustomAttributeTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.CustomAttribute, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.CustomAttributes) - { - list.Add(new CustomAttributeEntry(metadataFile, row)); - } - return list; - } - - internal struct CustomAttributeEntry - { - readonly MetadataFile metadataFile; - readonly CustomAttributeHandle handle; - readonly CustomAttribute customAttr; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.CustomAttribute) - + metadataFile.Metadata.GetTableRowSize(TableIndex.CustomAttribute) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(customAttr.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, customAttr.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, customAttr.Parent); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Constructor => MetadataTokens.GetToken(customAttr.Constructor); - - public void OnConstructorClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, customAttr.Constructor, protocol: "metadata"))); - } - - string constructorTooltip; - public string ConstructorTooltip => GenerateTooltip(ref constructorTooltip, metadataFile, customAttr.Constructor); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Value => MetadataTokens.GetHeapOffset(customAttr.Value); - - public string ValueTooltip { - get { - return null; - } - } - - public CustomAttributeEntry(MetadataFile metadataFile, CustomAttributeHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.customAttr = metadataFile.Metadata.GetCustomAttribute(handle); - this.parentTooltip = null; - this.constructorTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/DeclSecurityTableTreeNode.cs b/ILSpy/Metadata/CorTables/DeclSecurityTableTreeNode.cs deleted file mode 100644 index ed54e44e0..000000000 --- a/ILSpy/Metadata/CorTables/DeclSecurityTableTreeNode.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class DeclSecurityTableTreeNode : MetadataTableTreeNode - { - public DeclSecurityTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.DeclSecurity, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.DeclarativeSecurityAttributes) - { - list.Add(new DeclSecurityEntry(metadataFile, row)); - } - return list; - } - - internal struct DeclSecurityEntry - { - readonly MetadataFile metadataFile; - readonly DeclarativeSecurityAttributeHandle handle; - readonly DeclarativeSecurityAttribute declSecAttr; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.DeclSecurity) - + metadataFile.Metadata.GetTableRowSize(TableIndex.DeclSecurity) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(declSecAttr.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, declSecAttr.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, declSecAttr.Parent); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public DeclarativeSecurityAction Action => declSecAttr.Action; - - public string ActionTooltip { - get { - return declSecAttr.Action.ToString(); - } - } - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int PermissionSet => MetadataTokens.GetHeapOffset(declSecAttr.PermissionSet); - - public string PermissionSetTooltip { - get { - return null; - } - } - - public DeclSecurityEntry(MetadataFile metadataFile, DeclarativeSecurityAttributeHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.declSecAttr = metadataFile.Metadata.GetDeclarativeSecurityAttribute(handle); - this.parentTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/EventMapTableTreeNode.cs b/ILSpy/Metadata/CorTables/EventMapTableTreeNode.cs deleted file mode 100644 index 74318f623..000000000 --- a/ILSpy/Metadata/CorTables/EventMapTableTreeNode.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class EventMapTableTreeNode : MetadataTableTreeNode - { - public EventMapTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.EventMap, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(TableIndex.EventMap); - ReadOnlySpan ptr = metadata.AsReadOnlySpan(); - int typeDefSize = metadata.GetTableRowCount(TableIndex.TypeDef) < ushort.MaxValue ? 2 : 4; - int eventDefSize = metadata.GetTableRowCount(TableIndex.Event) < ushort.MaxValue ? 2 : 4; - for (int rid = 1; rid <= length; rid++) - { - list.Add(new EventMapEntry(metadataFile, ptr, rid, typeDefSize, eventDefSize)); - } - return list; - } - - readonly struct EventMap - { - public readonly TypeDefinitionHandle Parent; - public readonly EventDefinitionHandle EventList; - - public EventMap(ReadOnlySpan ptr, int typeDefSize, int eventDefSize) - { - Parent = MetadataTokens.TypeDefinitionHandle(Helpers.GetValueLittleEndian(ptr.Slice(0, typeDefSize))); - EventList = MetadataTokens.EventDefinitionHandle(Helpers.GetValueLittleEndian(ptr.Slice(typeDefSize, eventDefSize))); - } - } - - internal struct EventMapEntry - { - readonly MetadataFile metadataFile; - readonly EventMap eventMap; - - public int RID { get; } - public int Token => 0x12000000 | RID; - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(eventMap.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, eventMap.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, eventMap.Parent); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int EventList => MetadataTokens.GetToken(eventMap.EventList); - - public void OnEventListClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, eventMap.EventList, protocol: "metadata"))); - } - - string eventListTooltip; - public string EventListTooltip => GenerateTooltip(ref eventListTooltip, metadataFile, eventMap.EventList); - - public EventMapEntry(MetadataFile metadataFile, ReadOnlySpan ptr, int row, int typeDefSize, int eventDefSize) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.EventMap) - + metadataFile.Metadata.GetTableRowSize(TableIndex.EventMap) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.eventMap = new EventMap(ptr.Slice(rowOffset), typeDefSize, eventDefSize); - this.parentTooltip = null; - this.eventListTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/EventTableTreeNode.cs b/ILSpy/Metadata/CorTables/EventTableTreeNode.cs deleted file mode 100644 index d960ecd14..000000000 --- a/ILSpy/Metadata/CorTables/EventTableTreeNode.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class EventTableTreeNode : MetadataTableTreeNode - { - public EventTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Event, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.EventDefinitions) - { - list.Add(new EventDefEntry(metadataFile, row)); - } - return list; - } - - internal struct EventDefEntry : IMemberTreeNode - { - readonly MetadataFile metadataFile; - readonly EventDefinitionHandle handle; - readonly EventDefinition eventDef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.Event) - + metadataFile.Metadata.GetTableRowSize(TableIndex.Event) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public EventAttributes Attributes => eventDef.Attributes; - - public object AttributesTooltip => new FlagsTooltip { - FlagGroup.CreateMultipleChoiceGroup(typeof(EventAttributes), selectedValue: (int)eventDef.Attributes, includeAll: false), - }; - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(eventDef.Name):X} \"{Name}\""; - - public string Name => metadataFile.Metadata.GetString(eventDef.Name); - - IEntity IMemberTreeNode.Member { - get { - return ((MetadataModule)GetTypeSystemWithCurrentOptionsOrNull(metadataFile)?.MainModule)?.GetDefinition(handle); - } - } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Type => MetadataTokens.GetToken(eventDef.Type); - - public void OnTypeClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, eventDef.Type, protocol: "metadata"))); - } - - string typeTooltip; - public string TypeTooltip => GenerateTooltip(ref typeTooltip, metadataFile, eventDef.Type); - - public EventDefEntry(MetadataFile metadataFile, EventDefinitionHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.eventDef = metadataFile.Metadata.GetEventDefinition(handle); - this.typeTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/ExportedTypeTableTreeNode.cs b/ILSpy/Metadata/CorTables/ExportedTypeTableTreeNode.cs deleted file mode 100644 index 4675745cf..000000000 --- a/ILSpy/Metadata/CorTables/ExportedTypeTableTreeNode.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class ExportedTypeTableTreeNode : MetadataTableTreeNode - { - public ExportedTypeTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.ExportedType, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var metadata = metadataFile.Metadata; - foreach (var row in metadata.ExportedTypes) - { - list.Add(new ExportedTypeEntry(metadataFile, row, metadata.GetExportedType(row))); - } - return list; - } - - internal struct ExportedTypeEntry - { - readonly MetadataFile metadataFile; - readonly ExportedTypeHandle handle; - readonly ExportedType type; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.ExportedType) - + metadataFile.Metadata.GetTableRowSize(TableIndex.ExportedType) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public TypeAttributes Attributes => type.Attributes; - - const TypeAttributes otherFlagsMask = ~(TypeAttributes.VisibilityMask | TypeAttributes.LayoutMask | TypeAttributes.ClassSemanticsMask | TypeAttributes.StringFormatMask | TypeAttributes.CustomFormatMask); - - public object AttributesTooltip => new FlagsTooltip { - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Visibility: ", (int)TypeAttributes.VisibilityMask, (int)(type.Attributes & TypeAttributes.VisibilityMask), new Flag("NotPublic (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Class layout: ", (int)TypeAttributes.LayoutMask, (int)(type.Attributes & TypeAttributes.LayoutMask), new Flag("AutoLayout (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Class semantics: ", (int)TypeAttributes.ClassSemanticsMask, (int)(type.Attributes & TypeAttributes.ClassSemanticsMask), new Flag("Class (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "String format: ", (int)TypeAttributes.StringFormatMask, (int)(type.Attributes & TypeAttributes.StringFormatMask), new Flag("AnsiClass (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Custom format: ", (int)TypeAttributes.CustomFormatMask, (int)(type.Attributes & TypeAttributes.CustomFormatMask), new Flag("Value0 (0000)", 0, false), includeAny: false), - FlagGroup.CreateMultipleChoiceGroup(typeof(TypeAttributes), "Flags:", (int)otherFlagsMask, (int)(type.Attributes & otherFlagsMask), includeAll: false), - }; - - public int TypeDefId => type.GetTypeDefinitionId(); - - public string TypeNameTooltip => $"{MetadataTokens.GetHeapOffset(type.Name):X} \"{TypeName}\""; - - public string TypeName => metadataFile.Metadata.GetString(type.Name); - - public string TypeNamespaceTooltip => $"{MetadataTokens.GetHeapOffset(type.Namespace):X} \"{TypeNamespace}\""; - - public string TypeNamespace => metadataFile.Metadata.GetString(type.Namespace); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Implementation => MetadataTokens.GetToken(type.Implementation); - - public void OnImplementationClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, type.Implementation, protocol: "metadata"))); - } - - string implementationTooltip; - public string ImplementationTooltip => GenerateTooltip(ref implementationTooltip, metadataFile, type.Implementation); - - public ExportedTypeEntry(MetadataFile metadataFile, ExportedTypeHandle handle, ExportedType type) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.type = type; - this.implementationTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/FieldLayoutTableTreeNode.cs b/ILSpy/Metadata/CorTables/FieldLayoutTableTreeNode.cs deleted file mode 100644 index 18b14b80b..000000000 --- a/ILSpy/Metadata/CorTables/FieldLayoutTableTreeNode.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Buffers.Binary; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class FieldLayoutTableTreeNode : MetadataTableTreeNode - { - public FieldLayoutTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.FieldLayout, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(TableIndex.FieldLayout); - ReadOnlySpan ptr = metadata.AsReadOnlySpan(); - int fieldDefSize = metadata.GetTableRowCount(TableIndex.Field) < ushort.MaxValue ? 2 : 4; - for (int rid = 1; rid <= length; rid++) - { - list.Add(new FieldLayoutEntry(metadataFile, ptr, rid, fieldDefSize)); - } - return list; - } - - readonly struct FieldLayout - { - public readonly int Offset; - public readonly FieldDefinitionHandle Field; - - public FieldLayout(ReadOnlySpan ptr, int fieldDefSize) - { - Offset = BinaryPrimitives.ReadInt32LittleEndian(ptr); - Field = MetadataTokens.FieldDefinitionHandle(Helpers.GetValueLittleEndian(ptr.Slice(4, fieldDefSize))); - } - } - - internal struct FieldLayoutEntry - { - readonly MetadataFile metadataFile; - readonly FieldLayout fieldLayout; - - public int RID { get; } - public int Token => 0x10000000 | RID; - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Field => MetadataTokens.GetToken(fieldLayout.Field); - - public void OnFieldClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, fieldLayout.Field, protocol: "metadata"))); - } - - string fieldTooltip; - public string FieldTooltip => GenerateTooltip(ref fieldTooltip, metadataFile, fieldLayout.Field); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public int FieldOffset => fieldLayout.Offset; - - public FieldLayoutEntry(MetadataFile metadataFile, ReadOnlySpan ptr, int row, int fieldDefSize) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.FieldLayout) - + metadataFile.Metadata.GetTableRowSize(TableIndex.FieldLayout) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.fieldLayout = new FieldLayout(ptr.Slice(rowOffset), fieldDefSize); - this.fieldTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/FieldMarshalTableTreeNode.cs b/ILSpy/Metadata/CorTables/FieldMarshalTableTreeNode.cs deleted file mode 100644 index 1881695f5..000000000 --- a/ILSpy/Metadata/CorTables/FieldMarshalTableTreeNode.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class FieldMarshalTableTreeNode : MetadataTableTreeNode - { - public FieldMarshalTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.FieldMarshal, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(TableIndex.FieldMarshal); - ReadOnlySpan ptr = metadata.AsReadOnlySpan(); - int hasFieldMarshalRefSize = metadata.ComputeCodedTokenSize(32768, TableMask.Field | TableMask.Param); - int blobHeapSize = metadata.GetHeapSize(HeapIndex.Blob) < ushort.MaxValue ? 2 : 4; - for (int rid = 1; rid <= length; rid++) - { - list.Add(new FieldMarshalEntry(metadataFile, ptr, rid, blobHeapSize, hasFieldMarshalRefSize)); - } - return list; - } - - readonly struct FieldMarshal - { - public readonly BlobHandle NativeType; - public readonly EntityHandle Parent; - - public FieldMarshal(ReadOnlySpan ptr, int blobHeapSize, int hasFieldMarshalRefSize) - { - Parent = Helpers.FromHasFieldMarshalTag((uint)Helpers.GetValueLittleEndian(ptr, hasFieldMarshalRefSize)); - NativeType = MetadataTokens.BlobHandle(Helpers.GetValueLittleEndian(ptr.Slice(hasFieldMarshalRefSize, blobHeapSize))); - } - } - - internal struct FieldMarshalEntry - { - readonly MetadataFile metadataFile; - readonly FieldMarshal fieldMarshal; - - public int RID { get; } - public int Token => 0x0D000000 | RID; - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(fieldMarshal.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, fieldMarshal.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, fieldMarshal.Parent); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int NativeType => MetadataTokens.GetHeapOffset(fieldMarshal.NativeType); - - public FieldMarshalEntry(MetadataFile metadataFile, ReadOnlySpan ptr, int row, int blobHeapSize, int hasFieldMarshalRefSize) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.FieldMarshal) - + metadataFile.Metadata.GetTableRowSize(TableIndex.FieldMarshal) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.fieldMarshal = new FieldMarshal(ptr.Slice(rowOffset), blobHeapSize, hasFieldMarshalRefSize); - this.parentTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/FieldRVATableTreeNode.cs b/ILSpy/Metadata/CorTables/FieldRVATableTreeNode.cs deleted file mode 100644 index b57d6c906..000000000 --- a/ILSpy/Metadata/CorTables/FieldRVATableTreeNode.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Buffers.Binary; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class FieldRVATableTreeNode : MetadataTableTreeNode - { - public FieldRVATableTreeNode(MetadataFile metadataFile) - : base(TableIndex.FieldRva, metadataFile) - { - } - - public override object Text => $"1D FieldRVA ({metadataFile.Metadata.GetTableRowCount(TableIndex.FieldRva)})"; - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(TableIndex.FieldRva); - ReadOnlySpan ptr = metadata.AsReadOnlySpan(); - int metadataOffset = metadataFile.MetadataOffset; - int fieldDefSize = metadata.GetTableRowCount(TableIndex.Field) < ushort.MaxValue ? 2 : 4; - for (int rid = 1; rid <= length; rid++) - { - list.Add(new FieldRVAEntry(metadataFile, metadataOffset, ptr, rid, fieldDefSize)); - } - return list; - } - - readonly struct FieldRVA - { - public readonly int Offset; - public readonly FieldDefinitionHandle Field; - - public FieldRVA(ReadOnlySpan ptr, int fieldDefSize) - { - Offset = BinaryPrimitives.ReadInt32LittleEndian(ptr); - Field = MetadataTokens.FieldDefinitionHandle(Helpers.GetValueLittleEndian(ptr.Slice(4, fieldDefSize))); - } - } - - internal struct FieldRVAEntry - { - readonly MetadataFile metadataFile; - readonly FieldRVA fieldRVA; - - public int RID { get; } - public int Token => 0x1D000000 | RID; - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Field => MetadataTokens.GetToken(fieldRVA.Field); - - public void OnFieldClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, fieldRVA.Field, protocol: "metadata"))); - } - - string fieldTooltip; - public string FieldTooltip => GenerateTooltip(ref fieldTooltip, metadataFile, fieldRVA.Field); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public int FieldOffset => fieldRVA.Offset; - - public FieldRVAEntry(MetadataFile metadataFile, int metadataOffset, ReadOnlySpan ptr, int row, int fieldDefSize) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.FieldRva) - + metadataFile.Metadata.GetTableRowSize(TableIndex.FieldRva) * (row - 1); - this.Offset = metadataOffset + rowOffset; - this.fieldRVA = new FieldRVA(ptr.Slice(rowOffset), fieldDefSize); - this.fieldTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/FieldTableTreeNode.cs b/ILSpy/Metadata/CorTables/FieldTableTreeNode.cs deleted file mode 100644 index 2fbc43e8a..000000000 --- a/ILSpy/Metadata/CorTables/FieldTableTreeNode.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class FieldTableTreeNode : MetadataTableTreeNode - { - public FieldTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Field, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.FieldDefinitions) - { - list.Add(new FieldDefEntry(metadataFile, row)); - } - return list; - } - - internal struct FieldDefEntry : IMemberTreeNode - { - readonly MetadataFile metadataFile; - readonly FieldDefinitionHandle handle; - readonly FieldDefinition fieldDef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.Field) - + metadataFile.Metadata.GetTableRowSize(TableIndex.Field) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public FieldAttributes Attributes => fieldDef.Attributes; - - const FieldAttributes otherFlagsMask = ~(FieldAttributes.FieldAccessMask); - - public object AttributesTooltip => new FlagsTooltip() { - FlagGroup.CreateSingleChoiceGroup(typeof(FieldAttributes), "Field access: ", (int)FieldAttributes.FieldAccessMask, (int)(fieldDef.Attributes & FieldAttributes.FieldAccessMask), new Flag("CompilerControlled (0000)", 0, false), includeAny: false), - FlagGroup.CreateMultipleChoiceGroup(typeof(FieldAttributes), "Flags:", (int)otherFlagsMask, (int)(fieldDef.Attributes & otherFlagsMask), includeAll: false), - }; - - public string Name => metadataFile.Metadata.GetString(fieldDef.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(fieldDef.Name):X} \"{Name}\""; - - IEntity IMemberTreeNode.Member => ((MetadataModule)metadataFile.GetTypeSystemWithCurrentOptionsOrNull(SettingsService, AssemblyTreeModel.CurrentLanguageVersion)?.MainModule)?.GetDefinition(handle); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(fieldDef.Signature); - - string signatureTooltip; - public string SignatureTooltip => GenerateTooltip(ref signatureTooltip, metadataFile, handle); - - public FieldDefEntry(MetadataFile metadataFile, FieldDefinitionHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.fieldDef = metadataFile.Metadata.GetFieldDefinition(handle); - this.signatureTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/FileTableTreeNode.cs b/ILSpy/Metadata/CorTables/FileTableTreeNode.cs deleted file mode 100644 index 45e3917e2..000000000 --- a/ILSpy/Metadata/CorTables/FileTableTreeNode.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class FileTableTreeNode : MetadataTableTreeNode - { - public FileTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.File, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.AssemblyFiles) - { - list.Add(new FileEntry(metadataFile, row)); - } - return list; - } - - internal struct FileEntry - { - readonly MetadataFile metadataFile; - readonly AssemblyFileHandle handle; - readonly AssemblyFile assemblyFile; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.File) - + metadataFile.Metadata.GetTableRowSize(TableIndex.File) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public int Attributes => assemblyFile.ContainsMetadata ? 1 : 0; - - public string AttributesTooltip => assemblyFile.ContainsMetadata ? "ContainsMetaData" : "ContainsNoMetaData"; - - public string Name => metadataFile.Metadata.GetString(assemblyFile.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(assemblyFile.Name):X} \"{Name}\""; - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int HashValue => MetadataTokens.GetHeapOffset(assemblyFile.HashValue); - - public string HashValueTooltip { - get { - if (assemblyFile.HashValue.IsNil) - return null; - System.Collections.Immutable.ImmutableArray token = metadataFile.Metadata.GetBlobContent(assemblyFile.HashValue); - return token.ToHexString(token.Length); - } - } - - public FileEntry(MetadataFile metadataFile, AssemblyFileHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.assemblyFile = metadataFile.Metadata.GetAssemblyFile(handle); - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/GenericParamConstraintTableTreeNode.cs b/ILSpy/Metadata/CorTables/GenericParamConstraintTableTreeNode.cs deleted file mode 100644 index cea6a3103..000000000 --- a/ILSpy/Metadata/CorTables/GenericParamConstraintTableTreeNode.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.IL; -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class GenericParamConstraintTableTreeNode : MetadataTableTreeNode - { - public GenericParamConstraintTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.GenericParamConstraint, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var metadata = metadataFile.Metadata; - for (int row = 1; row <= metadata.GetTableRowCount(TableIndex.GenericParamConstraint); row++) - { - list.Add(new GenericParamConstraintEntry(metadataFile, MetadataTokens.GenericParameterConstraintHandle(row))); - } - return list; - } - - internal struct GenericParamConstraintEntry - { - readonly MetadataFile metadataFile; - readonly GenericParameterConstraintHandle handle; - readonly GenericParameterConstraint genericParamConstraint; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.GenericParamConstraint) - + metadataFile.Metadata.GetTableRowSize(TableIndex.GenericParamConstraint) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Owner => MetadataTokens.GetToken(genericParamConstraint.Parameter); - - public void OnOwnerClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, genericParamConstraint.Parameter, protocol: "metadata"))); - } - - string ownerTooltip; - - public string OwnerTooltip { - get { - if (ownerTooltip == null) - { - ITextOutput output = new PlainTextOutput(); - var p = metadataFile.Metadata.GetGenericParameter(genericParamConstraint.Parameter); - output.Write("parameter " + p.Index + (p.Name.IsNil ? "" : " (" + metadataFile.Metadata.GetString(p.Name) + ")") + " of "); - p.Parent.WriteTo(metadataFile, output, default); - ownerTooltip = output.ToString(); - } - return ownerTooltip; - } - } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Type => MetadataTokens.GetToken(genericParamConstraint.Type); - - public void OnTypeClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, genericParamConstraint.Type, protocol: "metadata"))); - } - - string typeTooltip; - public string TypeTooltip => GenerateTooltip(ref typeTooltip, metadataFile, genericParamConstraint.Type); - - public GenericParamConstraintEntry(MetadataFile metadataFile, GenericParameterConstraintHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.genericParamConstraint = metadataFile.Metadata.GetGenericParameterConstraint(handle); - this.ownerTooltip = null; - this.typeTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/GenericParamTableTreeNode.cs b/ILSpy/Metadata/CorTables/GenericParamTableTreeNode.cs deleted file mode 100644 index ce90b7c4f..000000000 --- a/ILSpy/Metadata/CorTables/GenericParamTableTreeNode.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class GenericParamTableTreeNode : MetadataTableTreeNode - { - public GenericParamTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.GenericParam, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - for (int row = 1; row <= metadataFile.Metadata.GetTableRowCount(TableIndex.GenericParam); row++) - { - list.Add(new GenericParamEntry(metadataFile, MetadataTokens.GenericParameterHandle(row))); - } - return list; - } - - internal struct GenericParamEntry - { - readonly MetadataFile metadataFile; - readonly GenericParameterHandle handle; - readonly GenericParameter genericParam; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.GenericParam) - + metadataFile.Metadata.GetTableRowSize(TableIndex.GenericParam) * (RID - 1); - - public int Number => genericParam.Index; - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public GenericParameterAttributes Attributes => genericParam.Attributes; - - public object AttributesTooltip => new FlagsTooltip { - FlagGroup.CreateSingleChoiceGroup(typeof(GenericParameterAttributes), "Variance: ", (int)GenericParameterAttributes.VarianceMask, (int)(genericParam.Attributes & GenericParameterAttributes.VarianceMask), new Flag("None (0000)", 0, false), includeAny: false), - FlagGroup.CreateMultipleChoiceGroup(typeof(GenericParameterAttributes), "Special Constraint: ", (int)GenericParameterAttributes.SpecialConstraintMask, (int)(genericParam.Attributes & GenericParameterAttributes.SpecialConstraintMask), includeAll: false), - }; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Owner => MetadataTokens.GetToken(genericParam.Parent); - - public void OnOwnerClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, genericParam.Parent, protocol: "metadata"))); - } - - string ownerTooltip; - public string OwnerTooltip => GenerateTooltip(ref ownerTooltip, metadataFile, genericParam.Parent); - - public string Name => metadataFile.Metadata.GetString(genericParam.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(genericParam.Name):X} \"{Name}\""; - - public GenericParamEntry(MetadataFile metadataFile, GenericParameterHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.genericParam = metadataFile.Metadata.GetGenericParameter(handle); - this.ownerTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/ImplMapTableTreeNode.cs b/ILSpy/Metadata/CorTables/ImplMapTableTreeNode.cs deleted file mode 100644 index fa1365d35..000000000 --- a/ILSpy/Metadata/CorTables/ImplMapTableTreeNode.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Buffers.Binary; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -using Mono.Cecil; - -namespace ICSharpCode.ILSpy.Metadata -{ - class ImplMapTableTreeNode : MetadataTableTreeNode - { - public ImplMapTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.ImplMap, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(TableIndex.ImplMap); - var span = metadata.AsReadOnlySpan(); - int moduleRefSize = metadata.GetTableRowCount(TableIndex.ModuleRef) < ushort.MaxValue ? 2 : 4; - int memberForwardedTagRefSize = metadata.ComputeCodedTokenSize(32768, TableMask.MethodDef | TableMask.Field); - int stringHandleSize = metadata.GetHeapSize(HeapIndex.String) < ushort.MaxValue ? 2 : 4; - for (int rid = 1; rid <= length; rid++) - { - list.Add(new ImplMapEntry(metadataFile, span, rid, moduleRefSize, memberForwardedTagRefSize, stringHandleSize)); - } - return list; - } - - readonly struct ImplMap - { - public readonly PInvokeAttributes MappingFlags; - public readonly EntityHandle MemberForwarded; - public readonly StringHandle ImportName; - public readonly ModuleReferenceHandle ImportScope; - - public ImplMap(ReadOnlySpan span, int moduleRefSize, int memberForwardedTagRefSize, int stringHandleSize) - { - MappingFlags = (PInvokeAttributes)BinaryPrimitives.ReadUInt16LittleEndian(span); - MemberForwarded = Helpers.FromMemberForwardedTag((uint)Helpers.GetValueLittleEndian(span.Slice(2, memberForwardedTagRefSize))); - ImportName = MetadataTokens.StringHandle(Helpers.GetValueLittleEndian(span.Slice(2 + memberForwardedTagRefSize, stringHandleSize))); - ImportScope = MetadataTokens.ModuleReferenceHandle(Helpers.GetValueLittleEndian(span.Slice(2 + memberForwardedTagRefSize + stringHandleSize, moduleRefSize))); - } - } - - internal struct ImplMapEntry - { - readonly MetadataFile metadataFile; - readonly ImplMap implMap; - - public int RID { get; } - public int Token => 0x1C000000 | RID; - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public PInvokeAttributes MappingFlags => implMap.MappingFlags; - - const PInvokeAttributes otherFlagsMask = ~(PInvokeAttributes.CallConvMask | PInvokeAttributes.CharSetMask); - - public object MappingFlagsTooltip => new FlagsTooltip { - FlagGroup.CreateSingleChoiceGroup(typeof(PInvokeAttributes), "Character set: ", (int)PInvokeAttributes.CharSetMask, (int)(implMap.MappingFlags & PInvokeAttributes.CharSetMask), new Flag("CharSetNotSpec (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(PInvokeAttributes), "Calling convention: ", (int)PInvokeAttributes.CallConvMask, (int)(implMap.MappingFlags & PInvokeAttributes.CallConvMask), new Flag("Invalid (0000)", 0, false), includeAny: false), - FlagGroup.CreateMultipleChoiceGroup(typeof(PInvokeAttributes), "Flags:", (int)otherFlagsMask, (int)(implMap.MappingFlags & otherFlagsMask), includeAll: false), - }; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int MemberForwarded => MetadataTokens.GetToken(implMap.MemberForwarded); - - public void OnMemberForwardedClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, implMap.MemberForwarded, protocol: "metadata"))); - } - - string memberForwardedTooltip; - public string MemberForwardedTooltip => GenerateTooltip(ref memberForwardedTooltip, metadataFile, implMap.MemberForwarded); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int ImportScope => MetadataTokens.GetToken(implMap.ImportScope); - - public void OnImportScopeClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, implMap.ImportScope, protocol: "metadata"))); - } - - string importScopeTooltip; - public string ImportScopeTooltip => GenerateTooltip(ref importScopeTooltip, metadataFile, implMap.ImportScope); - - public string ImportName => metadataFile.Metadata.GetString(implMap.ImportName); - - public string ImportNameTooltip => $"{MetadataTokens.GetHeapOffset(implMap.ImportName):X} \"{ImportName}\""; - - public ImplMapEntry(MetadataFile metadataFile, ReadOnlySpan span, int row, int moduleRefSize, int memberForwardedTagRefSize, int stringHandleSize) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.ImplMap) - + metadataFile.Metadata.GetTableRowSize(TableIndex.ImplMap) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.implMap = new ImplMap(span.Slice(rowOffset), moduleRefSize, memberForwardedTagRefSize, stringHandleSize); - this.importScopeTooltip = null; - this.memberForwardedTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/InterfaceImplTableTreeNode.cs b/ILSpy/Metadata/CorTables/InterfaceImplTableTreeNode.cs deleted file mode 100644 index 555e66352..000000000 --- a/ILSpy/Metadata/CorTables/InterfaceImplTableTreeNode.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class InterfaceImplTableTreeNode : MetadataTableTreeNode - { - public InterfaceImplTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.InterfaceImpl, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var length = metadataFile.Metadata.GetTableRowCount(TableIndex.InterfaceImpl); - ReadOnlySpan ptr = metadataFile.Metadata.AsReadOnlySpan(); - for (int rid = 1; rid <= length; rid++) - { - list.Add(new InterfaceImplEntry(metadataFile, ptr, rid)); - } - return list; - } - - readonly struct InterfaceImpl - { - public readonly EntityHandle Class; - public readonly EntityHandle Interface; - - public InterfaceImpl(ReadOnlySpan ptr, int classSize, int interfaceSize) - { - Class = MetadataTokens.TypeDefinitionHandle(Helpers.GetValueLittleEndian(ptr, classSize)); - Interface = Helpers.FromTypeDefOrRefTag((uint)Helpers.GetValueLittleEndian(ptr.Slice(classSize, interfaceSize))); - } - } - - internal struct InterfaceImplEntry - { - readonly MetadataFile metadataFile; - readonly InterfaceImpl interfaceImpl; - - public int RID { get; } - - public int Token => 0x09000000 | RID; - - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Class => MetadataTokens.GetToken(interfaceImpl.Class); - - public void OnClassClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, interfaceImpl.Class, protocol: "metadata"))); - } - - string classTooltip; - public string ClassTooltip => GenerateTooltip(ref classTooltip, metadataFile, interfaceImpl.Class); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Interface => MetadataTokens.GetToken(interfaceImpl.Interface); - - public void OnInterfaceClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, interfaceImpl.Interface, protocol: "metadata"))); - } - - string interfaceTooltip; - public string InterfaceTooltip => GenerateTooltip(ref interfaceTooltip, metadataFile, interfaceImpl.Interface); - - public InterfaceImplEntry(MetadataFile metadataFile, ReadOnlySpan ptr, int row) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.InterfaceImpl) - + metadataFile.Metadata.GetTableRowSize(TableIndex.InterfaceImpl) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.interfaceImpl = new InterfaceImpl(ptr.Slice(rowOffset), metadataFile.Metadata.GetTableRowCount(TableIndex.TypeDef) < ushort.MaxValue ? 2 : 4, metadataFile.Metadata.ComputeCodedTokenSize(16384, TableMask.TypeDef | TableMask.TypeRef | TableMask.TypeSpec)); - this.interfaceTooltip = null; - this.classTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/ManifestResourceTableTreeNode.cs b/ILSpy/Metadata/CorTables/ManifestResourceTableTreeNode.cs deleted file mode 100644 index f22f03903..000000000 --- a/ILSpy/Metadata/CorTables/ManifestResourceTableTreeNode.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class ManifestResourceTableTreeNode : MetadataTableTreeNode - { - public ManifestResourceTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.ManifestResource, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var metadata = metadataFile.Metadata; - foreach (var row in metadata.ManifestResources) - { - list.Add(new ManifestResourceEntry(metadataFile, row)); - } - return list; - } - - internal struct ManifestResourceEntry - { - readonly MetadataFile metadataFile; - readonly ManifestResourceHandle handle; - readonly ManifestResource manifestResource; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.ManifestResource) - + metadataFile.Metadata.GetTableRowSize(TableIndex.ManifestResource) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public ManifestResourceAttributes Attributes => manifestResource.Attributes; - - public object AttributesTooltip => manifestResource.Attributes.ToString(); - - public string Name => metadataFile.Metadata.GetString(manifestResource.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(manifestResource.Name):X} \"{Name}\""; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Implementation => MetadataTokens.GetToken(manifestResource.Implementation); - - public void OnImplementationClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, manifestResource.Implementation, protocol: "metadata"))); - } - - string implementationTooltip; - public string ImplementationTooltip => GenerateTooltip(ref implementationTooltip, metadataFile, manifestResource.Implementation); - - public ManifestResourceEntry(MetadataFile metadataFile, ManifestResourceHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.manifestResource = metadataFile.Metadata.GetManifestResource(handle); - this.implementationTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/MemberRefTableTreeNode.cs b/ILSpy/Metadata/CorTables/MemberRefTableTreeNode.cs deleted file mode 100644 index 46d3b07a0..000000000 --- a/ILSpy/Metadata/CorTables/MemberRefTableTreeNode.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class MemberRefTableTreeNode : MetadataTableTreeNode - { - public MemberRefTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.MemberRef, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.MemberReferences) - { - list.Add(new MemberRefEntry(metadataFile, row)); - } - return list; - } - - internal struct MemberRefEntry - { - readonly MetadataFile metadataFile; - readonly MemberReferenceHandle handle; - readonly MemberReference memberRef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.MemberRef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.MemberRef) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(memberRef.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, memberRef.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, memberRef.Parent); - - public string Name => metadataFile.Metadata.GetString(memberRef.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(memberRef.Name):X} \"{Name}\""; - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(memberRef.Signature); - - string signatureTooltip; - public string SignatureTooltip => GenerateTooltip(ref signatureTooltip, metadataFile, handle); - - public MemberRefEntry(MetadataFile metadataFile, MemberReferenceHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.memberRef = metadataFile.Metadata.GetMemberReference(handle); - this.signatureTooltip = null; - this.parentTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/MethodImplTableTreeNode.cs b/ILSpy/Metadata/CorTables/MethodImplTableTreeNode.cs deleted file mode 100644 index 5e791b8d2..000000000 --- a/ILSpy/Metadata/CorTables/MethodImplTableTreeNode.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class MethodImplTableTreeNode : MetadataTableTreeNode - { - public MethodImplTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.MethodImpl, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - for (int row = 1; row <= metadataFile.Metadata.GetTableRowCount(TableIndex.MethodImpl); row++) - { - list.Add(new MethodImplEntry(metadataFile, MetadataTokens.MethodImplementationHandle(row))); - } - return list; - } - - internal struct MethodImplEntry - { - readonly MetadataFile metadataFile; - readonly MethodImplementationHandle handle; - readonly MethodImplementation methodImpl; - - public int RID => MetadataTokens.GetToken(handle) & 0xFFFFFF; - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.MethodDef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.MethodDef) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int MethodDeclaration => MetadataTokens.GetToken(methodImpl.MethodDeclaration); - - public void OnMethodDeclarationClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, methodImpl.MethodDeclaration, protocol: "metadata"))); - } - - string methodDeclarationTooltip; - public string MethodDeclarationTooltip => GenerateTooltip(ref methodDeclarationTooltip, metadataFile, methodImpl.MethodDeclaration); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int MethodBody => MetadataTokens.GetToken(methodImpl.MethodBody); - - public void OnMethodBodyClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, methodImpl.MethodBody, protocol: "metadata"))); - } - - string methodBodyTooltip; - public string MethodBodyTooltip => GenerateTooltip(ref methodBodyTooltip, metadataFile, methodImpl.MethodBody); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Type => MetadataTokens.GetToken(methodImpl.Type); - - public void OnTypeClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, methodImpl.Type, protocol: "metadata"))); - } - - string typeTooltip; - public string TypeTooltip => GenerateTooltip(ref typeTooltip, metadataFile, methodImpl.Type); - - public MethodImplEntry(MetadataFile metadataFile, MethodImplementationHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.methodImpl = metadataFile.Metadata.GetMethodImplementation(handle); - this.typeTooltip = null; - this.methodBodyTooltip = null; - this.methodDeclarationTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/MethodSemanticsTableTreeNode.cs b/ILSpy/Metadata/CorTables/MethodSemanticsTableTreeNode.cs deleted file mode 100644 index 40db886c8..000000000 --- a/ILSpy/Metadata/CorTables/MethodSemanticsTableTreeNode.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class MethodSemanticsTableTreeNode : MetadataTableTreeNode - { - public MethodSemanticsTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.MethodSemantics, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.GetMethodSemantics()) - { - list.Add(new MethodSemanticsEntry(metadataFile, row.Handle, row.Semantics, row.Method, row.Association)); - } - return list; - } - - internal struct MethodSemanticsEntry - { - readonly MetadataFile metadataFile; - readonly Handle handle; - readonly MethodSemanticsAttributes semantics; - readonly MethodDefinitionHandle method; - readonly EntityHandle association; - - public int RID => MetadataTokens.GetToken(handle) & 0xFFFFFF; - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.MethodDef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.MethodDef) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public MethodSemanticsAttributes Semantics => semantics; - - public string SemanticsTooltip => semantics.ToString(); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Method => MetadataTokens.GetToken(method); - - public void OnMethodClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, method, protocol: "metadata"))); - } - - string methodTooltip; - public string MethodTooltip => GenerateTooltip(ref methodTooltip, metadataFile, method); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Association => MetadataTokens.GetToken(association); - - public void OnAssociationClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, association, protocol: "metadata"))); - } - - string associationTooltip; - public string AssociationTooltip => GenerateTooltip(ref associationTooltip, metadataFile, association); - - public MethodSemanticsEntry(MetadataFile metadataFile, Handle handle, MethodSemanticsAttributes semantics, MethodDefinitionHandle method, EntityHandle association) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.semantics = semantics; - this.method = method; - this.association = association; - this.methodTooltip = null; - this.associationTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/MethodSpecTableTreeNode.cs b/ILSpy/Metadata/CorTables/MethodSpecTableTreeNode.cs deleted file mode 100644 index fe6f6322d..000000000 --- a/ILSpy/Metadata/CorTables/MethodSpecTableTreeNode.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Disassembler; -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class MethodSpecTableTreeNode : MetadataTableTreeNode - { - public MethodSpecTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.MethodSpec, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.GetMethodSpecifications()) - { - list.Add(new MethodSpecEntry(metadataFile, row)); - } - return list; - } - - internal struct MethodSpecEntry - { - readonly MetadataFile metadataFile; - readonly MethodSpecificationHandle handle; - readonly MethodSpecification methodSpec; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.MethodSpec) - + metadataFile.Metadata.GetTableRowSize(TableIndex.MethodSpec) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Method => MetadataTokens.GetToken(methodSpec.Method); - - public void OnMethodClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, methodSpec.Method, protocol: "metadata"))); - } - - string methodTooltip; - public string MethodTooltip => GenerateTooltip(ref methodTooltip, metadataFile, methodSpec.Method); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(methodSpec.Signature); - - public string SignatureTooltip { - get { - ITextOutput output = new PlainTextOutput(); - var signature = methodSpec.DecodeSignature(new DisassemblerSignatureTypeProvider(metadataFile, output), default); - bool first = true; - foreach (var type in signature) - { - if (first) - first = false; - else - output.Write(", "); - type(ILNameSyntax.TypeName); - } - return output.ToString(); - } - } - - public MethodSpecEntry(MetadataFile metadataFile, MethodSpecificationHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.methodSpec = metadataFile.Metadata.GetMethodSpecification(handle); - this.methodTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/MethodTableTreeNode.cs b/ILSpy/Metadata/CorTables/MethodTableTreeNode.cs deleted file mode 100644 index e7df62c5e..000000000 --- a/ILSpy/Metadata/CorTables/MethodTableTreeNode.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class MethodTableTreeNode : MetadataTableTreeNode - { - public MethodTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.MethodDef, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.MethodDefinitions) - { - list.Add(new MethodDefEntry(metadataFile, row)); - } - return list; - } - - internal struct MethodDefEntry : IMemberTreeNode - { - readonly MetadataFile metadataFile; - readonly MethodDefinitionHandle handle; - readonly MethodDefinition methodDef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.MethodDef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.MethodDef) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public MethodAttributes Attributes => methodDef.Attributes; - - const MethodAttributes otherFlagsMask = ~(MethodAttributes.MemberAccessMask | MethodAttributes.VtableLayoutMask); - - public object AttributesTooltip => new FlagsTooltip { - FlagGroup.CreateSingleChoiceGroup(typeof(MethodAttributes), "Member access: ", (int)MethodAttributes.MemberAccessMask, (int)(methodDef.Attributes & MethodAttributes.MemberAccessMask), new Flag("CompilerControlled (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(MethodAttributes), "Vtable layout: ", (int)MethodAttributes.VtableLayoutMask, (int)(methodDef.Attributes & MethodAttributes.VtableLayoutMask), new Flag("ReuseSlot (0000)", 0, false), includeAny: false), - FlagGroup.CreateMultipleChoiceGroup(typeof(MethodAttributes), "Flags:", (int)otherFlagsMask, (int)(methodDef.Attributes & otherFlagsMask), includeAll: false), - }; - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public MethodImplAttributes ImplAttributes => methodDef.ImplAttributes; - - public object ImplAttributesTooltip => new FlagsTooltip { - FlagGroup.CreateSingleChoiceGroup(typeof(MethodImplAttributes), "Code type: ", (int)MethodImplAttributes.CodeTypeMask, (int)(methodDef.ImplAttributes & MethodImplAttributes.CodeTypeMask), new Flag("IL (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(MethodImplAttributes), "Managed type: ", (int)MethodImplAttributes.ManagedMask, (int)(methodDef.ImplAttributes & MethodImplAttributes.ManagedMask), new Flag("Managed (0000)", 0, false), includeAny: false), - }; - - public int RVA => methodDef.RelativeVirtualAddress; - - public string Name => metadataFile.Metadata.GetString(methodDef.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(methodDef.Name):X} \"{Name}\""; - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(methodDef.Signature); - - string signatureTooltip; - - public string SignatureTooltip => GenerateTooltip(ref signatureTooltip, metadataFile, handle); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int ParamList => MetadataTokens.GetToken(methodDef.GetParameters().FirstOrDefault()); - - public void OnParamListClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, methodDef.GetParameters().FirstOrDefault(), protocol: "metadata"))); - } - - string paramListTooltip; - public string ParamListTooltip { - get { - var param = methodDef.GetParameters().FirstOrDefault(); - if (param.IsNil) - return null; - return GenerateTooltip(ref paramListTooltip, metadataFile, param); - } - } - - IEntity IMemberTreeNode.Member => ((MetadataModule)metadataFile.GetTypeSystemWithCurrentOptionsOrNull(SettingsService, AssemblyTreeModel.CurrentLanguageVersion)?.MainModule)?.GetDefinition(handle); - - public MethodDefEntry(MetadataFile metadataFile, MethodDefinitionHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.methodDef = metadataFile.Metadata.GetMethodDefinition(handle); - this.signatureTooltip = null; - this.paramListTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/ModuleRefTableTreeNode.cs b/ILSpy/Metadata/CorTables/ModuleRefTableTreeNode.cs deleted file mode 100644 index b30937f1a..000000000 --- a/ILSpy/Metadata/CorTables/ModuleRefTableTreeNode.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class ModuleRefTableTreeNode : MetadataTableTreeNode - { - public ModuleRefTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.ModuleRef, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.GetModuleReferences()) - { - list.Add(new ModuleRefEntry(metadataFile, row)); - } - return list; - } - - internal struct ModuleRefEntry - { - readonly MetadataFile metadataFile; - readonly ModuleReferenceHandle handle; - readonly ModuleReference moduleRef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.ModuleRef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.ModuleRef) * (RID - 1); - - public string Name => metadataFile.Metadata.GetString(moduleRef.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(moduleRef.Name):X} \"{Name}\""; - - public ModuleRefEntry(MetadataFile metadataFile, ModuleReferenceHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.moduleRef = metadataFile.Metadata.GetModuleReference(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/ModuleTableTreeNode.cs b/ILSpy/Metadata/CorTables/ModuleTableTreeNode.cs deleted file mode 100644 index b8685cd58..000000000 --- a/ILSpy/Metadata/CorTables/ModuleTableTreeNode.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class ModuleTableTreeNode : MetadataTableTreeNode - { - public ModuleTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Module, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - return [new ModuleEntry(metadataFile, EntityHandle.ModuleDefinition)]; - } - - internal struct ModuleEntry - { - readonly MetadataFile metadataFile; - readonly ModuleDefinitionHandle handle; - readonly ModuleDefinition moduleDef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.Module) - + metadataFile.Metadata.GetTableRowSize(TableIndex.Module) * (RID - 1); - - public int Generation => moduleDef.Generation; - - public string Name => metadataFile.Metadata.GetString(moduleDef.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(moduleDef.Name):X} \"{Name}\""; - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Mvid => MetadataTokens.GetHeapOffset(moduleDef.Mvid); - - public string MvidTooltip => metadataFile.Metadata.GetGuid(moduleDef.Mvid).ToString(); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int GenerationId => MetadataTokens.GetHeapOffset(moduleDef.GenerationId); - - public string GenerationIdTooltip => moduleDef.GenerationId.IsNil ? null : metadataFile.Metadata.GetGuid(moduleDef.GenerationId).ToString(); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int BaseGenerationId => MetadataTokens.GetHeapOffset(moduleDef.BaseGenerationId); - - public string BaseGenerationIdTooltip => moduleDef.BaseGenerationId.IsNil ? null : metadataFile.Metadata.GetGuid(moduleDef.BaseGenerationId).ToString(); - - public ModuleEntry(MetadataFile metadataFile, ModuleDefinitionHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.moduleDef = metadataFile.Metadata.GetModuleDefinition(); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/NestedClassTableTreeNode.cs b/ILSpy/Metadata/CorTables/NestedClassTableTreeNode.cs deleted file mode 100644 index 62c7f6475..000000000 --- a/ILSpy/Metadata/CorTables/NestedClassTableTreeNode.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class NestedClassTableTreeNode : MetadataTableTreeNode - { - public NestedClassTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.NestedClass, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(TableIndex.NestedClass); - ReadOnlySpan ptr = metadata.AsReadOnlySpan(); - int typeDefSize = metadataFile.Metadata.GetTableRowCount(TableIndex.TypeDef) < ushort.MaxValue ? 2 : 4; - for (int rid = 1; rid <= length; rid++) - { - list.Add(new NestedClassEntry(metadataFile, ptr, rid, typeDefSize)); - } - return list; - } - - readonly struct NestedClass - { - public readonly TypeDefinitionHandle Nested; - public readonly TypeDefinitionHandle Enclosing; - - public NestedClass(ReadOnlySpan ptr, int typeDefSize) - { - Nested = MetadataTokens.TypeDefinitionHandle(Helpers.GetValueLittleEndian(ptr, typeDefSize)); - Enclosing = MetadataTokens.TypeDefinitionHandle(Helpers.GetValueLittleEndian(ptr.Slice(typeDefSize), typeDefSize)); - } - } - - internal struct NestedClassEntry - { - readonly MetadataFile metadataFile; - readonly NestedClass nestedClass; - - public int RID { get; } - public int Token => 0x29000000 | RID; - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int NestedClass => MetadataTokens.GetToken(nestedClass.Nested); - public void OnNestedClassClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, nestedClass.Nested, protocol: "metadata"))); - } - string nestedClassTooltip; - public string NestedClassTooltip => GenerateTooltip(ref nestedClassTooltip, metadataFile, nestedClass.Nested); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int EnclosingClass => MetadataTokens.GetToken(nestedClass.Enclosing); - public void OnEnclosingClassClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, nestedClass.Enclosing, protocol: "metadata"))); - } - string enclosingClassTooltip; - public string EnclosingClassTooltip => GenerateTooltip(ref enclosingClassTooltip, metadataFile, nestedClass.Enclosing); - - public NestedClassEntry(MetadataFile metadataFile, ReadOnlySpan ptr, int row, int typeDefSize) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.NestedClass) - + metadataFile.Metadata.GetTableRowSize(TableIndex.NestedClass) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.nestedClass = new NestedClass(ptr.Slice(rowOffset), typeDefSize); - this.nestedClassTooltip = null; - this.enclosingClassTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/ParamTableTreeNode.cs b/ILSpy/Metadata/CorTables/ParamTableTreeNode.cs deleted file mode 100644 index 76fb39c31..000000000 --- a/ILSpy/Metadata/CorTables/ParamTableTreeNode.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class ParamTableTreeNode : MetadataTableTreeNode - { - public ParamTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Param, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - for (int row = 1; row <= metadataFile.Metadata.GetTableRowCount(TableIndex.Param); row++) - { - list.Add(new ParamEntry(metadataFile, MetadataTokens.ParameterHandle(row))); - } - return list; - } - - internal struct ParamEntry - { - readonly MetadataFile metadataFile; - readonly ParameterHandle handle; - readonly Parameter param; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.Param) - + metadataFile.Metadata.GetTableRowSize(TableIndex.Param) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public ParameterAttributes Attributes => param.Attributes; - - public object AttributesTooltip => new FlagsTooltip { - FlagGroup.CreateMultipleChoiceGroup(typeof(ParameterAttributes), selectedValue: (int)param.Attributes, includeAll: false) - }; - - public string Name => metadataFile.Metadata.GetString(param.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(param.Name):X} \"{Name}\""; - - public int Sequence => param.SequenceNumber; - - public ParamEntry(MetadataFile metadataFile, ParameterHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.param = metadataFile.Metadata.GetParameter(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/PropertyMapTableTreeNode.cs b/ILSpy/Metadata/CorTables/PropertyMapTableTreeNode.cs deleted file mode 100644 index 51b9c9347..000000000 --- a/ILSpy/Metadata/CorTables/PropertyMapTableTreeNode.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class PropertyMapTableTreeNode : MetadataTableTreeNode - { - public PropertyMapTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.PropertyMap, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(TableIndex.PropertyMap); - ReadOnlySpan ptr = metadata.AsReadOnlySpan(); - int typeDefSize = metadata.GetTableRowCount(TableIndex.TypeDef) < ushort.MaxValue ? 2 : 4; - int propertyDefSize = metadata.GetTableRowCount(TableIndex.Property) < ushort.MaxValue ? 2 : 4; - for (int rid = 1; rid <= length; rid++) - { - list.Add(new PropertyMapEntry(metadataFile, ptr, rid, typeDefSize, propertyDefSize)); - } - return list; - } - - readonly struct PropertyMap - { - public readonly TypeDefinitionHandle Parent; - public readonly PropertyDefinitionHandle PropertyList; - - public PropertyMap(ReadOnlySpan ptr, int typeDefSize, int propertyDefSize) - { - Parent = MetadataTokens.TypeDefinitionHandle(Helpers.GetValueLittleEndian(ptr, typeDefSize)); - PropertyList = MetadataTokens.PropertyDefinitionHandle(Helpers.GetValueLittleEndian(ptr.Slice(typeDefSize, propertyDefSize))); - } - } - - internal struct PropertyMapEntry - { - readonly MetadataFile metadataFile; - readonly PropertyMap propertyMap; - - public int RID { get; } - public int Token => 0x15000000 | RID; - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(propertyMap.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, propertyMap.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, propertyMap.Parent); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int PropertyList => MetadataTokens.GetToken(propertyMap.PropertyList); - - public void OnPropertyListClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, propertyMap.PropertyList, protocol: "metadata"))); - } - - string propertyListTooltip; - public string PropertyListTooltip => GenerateTooltip(ref propertyListTooltip, metadataFile, propertyMap.PropertyList); - - public PropertyMapEntry(MetadataFile metadataFile, ReadOnlySpan ptr, int row, int typeDefSize, int propertyDefSize) - { - this.metadataFile = metadataFile; - this.RID = row; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.PropertyMap) - + metadataFile.Metadata.GetTableRowSize(TableIndex.PropertyMap) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - this.propertyMap = new PropertyMap(ptr.Slice(rowOffset), typeDefSize, propertyDefSize); - this.propertyListTooltip = null; - this.parentTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/PropertyTableTreeNode.cs b/ILSpy/Metadata/CorTables/PropertyTableTreeNode.cs deleted file mode 100644 index 10ad58e19..000000000 --- a/ILSpy/Metadata/CorTables/PropertyTableTreeNode.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class PropertyTableTreeNode : MetadataTableTreeNode - { - public PropertyTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Property, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - foreach (var row in metadataFile.Metadata.PropertyDefinitions) - { - list.Add(new PropertyDefEntry(metadataFile, row)); - } - return list; - } - - internal struct PropertyDefEntry : IMemberTreeNode - { - readonly MetadataFile metadataFile; - readonly PropertyDefinitionHandle handle; - readonly PropertyDefinition propertyDef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.Property) - + metadataFile.Metadata.GetTableRowSize(TableIndex.Property) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public PropertyAttributes Attributes => propertyDef.Attributes; - - public object AttributesTooltip => new FlagsTooltip { - FlagGroup.CreateMultipleChoiceGroup(typeof(PropertyAttributes), selectedValue: (int)propertyDef.Attributes, includeAll: false), - }; - - public string Name => metadataFile.Metadata.GetString(propertyDef.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(propertyDef.Name):X} \"{Name}\""; - - IEntity IMemberTreeNode.Member => ((MetadataModule)metadataFile.GetTypeSystemWithCurrentOptionsOrNull(SettingsService, AssemblyTreeModel.CurrentLanguageVersion)?.MainModule)?.GetDefinition(handle); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(propertyDef.Signature); - - string signatureTooltip; - public string SignatureTooltip => GenerateTooltip(ref signatureTooltip, metadataFile, handle); - - public PropertyDefEntry(MetadataFile metadataFile, PropertyDefinitionHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.propertyDef = metadataFile.Metadata.GetPropertyDefinition(handle); - this.signatureTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/PtrTableTreeNode.cs b/ILSpy/Metadata/CorTables/PtrTableTreeNode.cs deleted file mode 100644 index 26ff9c7f9..000000000 --- a/ILSpy/Metadata/CorTables/PtrTableTreeNode.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2024 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class PtrTableTreeNode : MetadataTableTreeNode - { - readonly TableIndex referencedTableKind; - - public PtrTableTreeNode(TableIndex kind, MetadataFile metadataFile) - : base(kind, metadataFile) - { - if (kind is not (TableIndex.EventPtr or TableIndex.FieldPtr or TableIndex.MethodPtr or TableIndex.ParamPtr or TableIndex.PropertyPtr)) - { - throw new ArgumentOutOfRangeException("PtrTable does not support " + kind); - } - - this.referencedTableKind = kind switch { - TableIndex.EventPtr => TableIndex.Event, - TableIndex.FieldPtr => TableIndex.Field, - TableIndex.MethodPtr => TableIndex.MethodDef, - TableIndex.ParamPtr => TableIndex.Param, - TableIndex.PropertyPtr => TableIndex.Property, - _ => throw new NotImplementedException(), // unreachable - }; - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - var metadata = metadataFile.Metadata; - var length = metadata.GetTableRowCount(Kind); - ReadOnlySpan ptr = metadata.AsReadOnlySpan(); - - int handleDefSize = metadataFile.Metadata.GetTableRowCount(referencedTableKind) < ushort.MaxValue ? 2 : 4; - - for (int rid = 1; rid <= length; rid++) - { - list.Add(new PtrEntry(metadataFile, Kind, referencedTableKind, handleDefSize, ptr, rid)); - } - return list; - } - - readonly struct HandlePtr - { - public readonly EntityHandle Handle; - - public HandlePtr(ReadOnlySpan ptr, TableIndex kind, int handleSize) - { - Handle = MetadataTokens.EntityHandle(((int)kind << 24) | Helpers.GetValueLittleEndian(ptr, handleSize)); - } - } - - internal struct PtrEntry - { - readonly MetadataFile metadataFile; - readonly HandlePtr handlePtr; - readonly TableIndex kind; - - public int RID { get; } - - public int Token => ((int)kind << 24) | RID; - - public int Offset { get; } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Handle => MetadataTokens.GetToken(handlePtr.Handle); - - public void OnHandleClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, handlePtr.Handle, protocol: "metadata"))); - } - - string handleTooltip; - public string HandleTooltip => GenerateTooltip(ref handleTooltip, metadataFile, handlePtr.Handle); - - public PtrEntry(MetadataFile metadataFile, TableIndex kind, TableIndex handleKind, int handleDefSize, ReadOnlySpan ptr, int row) - { - this.metadataFile = metadataFile; - this.RID = row; - this.kind = kind; - var rowOffset = metadataFile.Metadata.GetTableMetadataOffset(kind) - + metadataFile.Metadata.GetTableRowSize(kind) * (row - 1); - this.Offset = metadataFile.MetadataOffset + rowOffset; - - this.handlePtr = new HandlePtr(ptr.Slice(rowOffset), handleKind, handleDefSize); - this.handleTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/StandAloneSigTableTreeNode.cs b/ILSpy/Metadata/CorTables/StandAloneSigTableTreeNode.cs deleted file mode 100644 index 468685a9e..000000000 --- a/ILSpy/Metadata/CorTables/StandAloneSigTableTreeNode.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - class StandAloneSigTableTreeNode : MetadataTableTreeNode - { - public StandAloneSigTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.StandAloneSig, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - for (int row = 1; row <= metadataFile.Metadata.GetTableRowCount(TableIndex.StandAloneSig); row++) - { - list.Add(new StandAloneSigEntry(metadataFile, MetadataTokens.StandaloneSignatureHandle(row))); - } - - return list; - } - - internal struct StandAloneSigEntry - { - readonly MetadataFile metadataFile; - readonly StandaloneSignatureHandle handle; - readonly StandaloneSignature standaloneSig; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.StandAloneSig) - + metadataFile.Metadata.GetTableRowSize(TableIndex.StandAloneSig) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(standaloneSig.Signature); - - string signatureTooltip; - public string SignatureTooltip => GenerateTooltip(ref signatureTooltip, metadataFile, handle); - - public StandAloneSigEntry(MetadataFile metadataFile, StandaloneSignatureHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.standaloneSig = metadataFile.Metadata.GetStandaloneSignature(handle); - this.signatureTooltip = null; - } - } - } -} diff --git a/ILSpy/Metadata/CorTables/TypeDefTableTreeNode.cs b/ILSpy/Metadata/CorTables/TypeDefTableTreeNode.cs deleted file mode 100644 index 9a472ca37..000000000 --- a/ILSpy/Metadata/CorTables/TypeDefTableTreeNode.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Disassembler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class TypeDefTableTreeNode : MetadataTableTreeNode - { - public TypeDefTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.TypeDef, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.TypeDefinitions) - { - list.Add(new TypeDefEntry(metadataFile, row)); - } - return list; - } - - internal struct TypeDefEntry : IMemberTreeNode - { - readonly MetadataFile metadataFile; - readonly TypeDefinitionHandle handle; - readonly TypeDefinition typeDef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.TypeDef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.TypeDef) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public TypeAttributes Attributes => typeDef.Attributes; - - const TypeAttributes otherFlagsMask = ~(TypeAttributes.VisibilityMask | TypeAttributes.LayoutMask | TypeAttributes.ClassSemanticsMask | TypeAttributes.StringFormatMask | TypeAttributes.CustomFormatMask); - - public object AttributesTooltip => new FlagsTooltip { - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Visibility: ", (int)TypeAttributes.VisibilityMask, (int)(typeDef.Attributes & TypeAttributes.VisibilityMask), new Flag("NotPublic (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Class layout: ", (int)TypeAttributes.LayoutMask, (int)(typeDef.Attributes & TypeAttributes.LayoutMask), new Flag("AutoLayout (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Class semantics: ", (int)TypeAttributes.ClassSemanticsMask, (int)(typeDef.Attributes & TypeAttributes.ClassSemanticsMask), new Flag("Class (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "String format: ", (int)TypeAttributes.StringFormatMask, (int)(typeDef.Attributes & TypeAttributes.StringFormatMask), new Flag("AnsiClass (0000)", 0, false), includeAny: false), - FlagGroup.CreateSingleChoiceGroup(typeof(TypeAttributes), "Custom format: ", (int)TypeAttributes.CustomFormatMask, (int)(typeDef.Attributes & TypeAttributes.CustomFormatMask), new Flag("Value0 (0000)", 0, false), includeAny: false), - FlagGroup.CreateMultipleChoiceGroup(typeof(TypeAttributes), "Flags:", (int)otherFlagsMask, (int)(typeDef.Attributes & otherFlagsMask), includeAll: false), - }; - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(typeDef.Name):X} \"{Name}\""; - - public string Name => metadataFile.Metadata.GetString(typeDef.Name); - - public string NamespaceTooltip => $"{MetadataTokens.GetHeapOffset(typeDef.Namespace):X} \"{Namespace}\""; - - public string Namespace => metadataFile.Metadata.GetString(typeDef.Namespace); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int BaseType => MetadataTokens.GetToken(typeDef.BaseType); - - public void OnBaseTypeClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, typeDef.BaseType, protocol: "metadata"))); - } - - public string BaseTypeTooltip { - get { - var output = new PlainTextOutput(); - var provider = new DisassemblerSignatureTypeProvider(metadataFile, output); - if (typeDef.BaseType.IsNil) - return null; - switch (typeDef.BaseType.Kind) - { - case HandleKind.TypeDefinition: - provider.GetTypeFromDefinition(metadataFile.Metadata, (TypeDefinitionHandle)typeDef.BaseType, 0)(ILNameSyntax.Signature); - return output.ToString(); - case HandleKind.TypeReference: - provider.GetTypeFromReference(metadataFile.Metadata, (TypeReferenceHandle)typeDef.BaseType, 0)(ILNameSyntax.Signature); - return output.ToString(); - case HandleKind.TypeSpecification: - provider.GetTypeFromSpecification(metadataFile.Metadata, new Decompiler.Metadata.MetadataGenericContext(default(TypeDefinitionHandle), metadataFile.Metadata), (TypeSpecificationHandle)typeDef.BaseType, 0)(ILNameSyntax.Signature); - return output.ToString(); - default: - return null; - } - } - } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int FieldList => MetadataTokens.GetToken(typeDef.GetFields().FirstOrDefault()); - - public void OnFieldListClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, typeDef.GetFields().FirstOrDefault(), protocol: "metadata"))); - } - - string fieldListTooltip; - public string FieldListTooltip { - get { - var @field = typeDef.GetFields().FirstOrDefault(); - if (@field.IsNil) - return null; - return GenerateTooltip(ref fieldListTooltip, metadataFile, @field); - } - } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int MethodList => MetadataTokens.GetToken(typeDef.GetMethods().FirstOrDefault()); - - public void OnMethodListClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, typeDef.GetMethods().FirstOrDefault(), protocol: "metadata"))); - } - - string methodListTooltip; - public string MethodListTooltip { - get { - var method = typeDef.GetMethods().FirstOrDefault(); - if (method.IsNil) - return null; - return GenerateTooltip(ref methodListTooltip, metadataFile, method); - } - } - - IEntity IMemberTreeNode.Member => ((MetadataModule)metadataFile.GetTypeSystemWithCurrentOptionsOrNull(SettingsService, AssemblyTreeModel.CurrentLanguageVersion)?.MainModule)?.GetDefinition(handle); - - public TypeDefEntry(MetadataFile metadataFile, TypeDefinitionHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.typeDef = metadataFile.Metadata.GetTypeDefinition(handle); - this.methodListTooltip = null; - this.fieldListTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/TypeRefTableTreeNode.cs b/ILSpy/Metadata/CorTables/TypeRefTableTreeNode.cs deleted file mode 100644 index 157d587c0..000000000 --- a/ILSpy/Metadata/CorTables/TypeRefTableTreeNode.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class TypeRefTableTreeNode : MetadataTableTreeNode - { - public TypeRefTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.TypeRef, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.TypeReferences) - { - list.Add(new TypeRefEntry(metadataFile, row)); - } - return list; - } - - internal struct TypeRefEntry - { - readonly MetadataFile metadataFile; - readonly TypeReferenceHandle handle; - readonly TypeReference typeRef; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataFile.MetadataOffset - + metadataFile.Metadata.GetTableMetadataOffset(TableIndex.TypeRef) - + metadataFile.Metadata.GetTableRowSize(TableIndex.TypeRef) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int ResolutionScope => MetadataTokens.GetToken(typeRef.ResolutionScope); - - public void OnResolutionScopeClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, typeRef.ResolutionScope, protocol: "metadata"))); - } - - string resolutionScopeTooltip; - public string ResolutionScopeTooltip => GenerateTooltip(ref resolutionScopeTooltip, metadataFile, typeRef.ResolutionScope); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(typeRef.Name):X} \"{Name}\""; - - public string Name => metadataFile.Metadata.GetString(typeRef.Name); - - public string NamespaceTooltip => $"{MetadataTokens.GetHeapOffset(typeRef.Namespace):X} \"{Namespace}\""; - - public string Namespace => metadataFile.Metadata.GetString(typeRef.Namespace); - - public TypeRefEntry(MetadataFile metadataFile, TypeReferenceHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.typeRef = metadataFile.Metadata.GetTypeReference(handle); - this.resolutionScopeTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/CorTables/TypeSpecTableTreeNode.cs b/ILSpy/Metadata/CorTables/TypeSpecTableTreeNode.cs deleted file mode 100644 index 393723bc7..000000000 --- a/ILSpy/Metadata/CorTables/TypeSpecTableTreeNode.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Disassembler; -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class TypeSpecTableTreeNode : MetadataTableTreeNode - { - public TypeSpecTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.TypeSpec, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.GetTypeSpecifications()) - { - list.Add(new TypeSpecEntry(metadataFile, row)); - } - return list; - } - - internal struct TypeSpecEntry - { - readonly int metadataOffset; - readonly MetadataFile module; - readonly MetadataReader metadata; - readonly TypeSpecificationHandle handle; - readonly TypeSpecification typeSpec; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public int Offset => metadataOffset - + metadata.GetTableMetadataOffset(TableIndex.TypeSpec) - + metadata.GetTableRowSize(TableIndex.TypeSpec) * (RID - 1); - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(typeSpec.Signature); - - public string SignatureTooltip { - get { - ITextOutput output = new PlainTextOutput(); - typeSpec.DecodeSignature(new DisassemblerSignatureTypeProvider(module, output), default)(ILNameSyntax.Signature); - return output.ToString(); - } - } - - public TypeSpecEntry(MetadataFile metadataFile, TypeSpecificationHandle handle) - { - this.module = metadataFile; - this.metadataOffset = metadataFile.MetadataOffset; - this.metadata = metadataFile.Metadata; - this.handle = handle; - this.typeSpec = metadata.GetTypeSpecification(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DataDirectoriesTreeNode.cs b/ILSpy/Metadata/DataDirectoriesTreeNode.cs deleted file mode 100644 index 665258a3d..000000000 --- a/ILSpy/Metadata/DataDirectoriesTreeNode.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Reflection.PortableExecutable; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - class DataDirectoriesTreeNode : ILSpyTreeNode - { - private PEFile module; - - public DataDirectoriesTreeNode(PEFile module) - { - this.module = module; - } - - public override object Text => "Data Directories"; - - public override object NavigationText => $"{Text} ({module.Name})"; -#if CROSS_PLATFORM - public override object Icon => Images.DirectoryTable; -#else - public override object Icon => Images.ListFolder; - public override object ExpandedIcon => Images.ListFolderOpen; -#endif - public override bool View(ViewModels.TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var dataGrid = Helpers.PrepareDataGrid(tabPage, this); - //dataGrid.AutoGenerateColumns = false; - //dataGrid.Columns.Add(new DataGridTextColumn { IsReadOnly = true, Header = "Name", Binding = new Binding("Name") }); - //dataGrid.Columns.Add(new DataGridTextColumn { IsReadOnly = true, Header = "RVA", Binding = new Binding("RVA") { StringFormat = "X8" } }); - //dataGrid.Columns.Add(new DataGridTextColumn { IsReadOnly = true, Header = "Size", Binding = new Binding("Size") { StringFormat = "X8" } }); - //dataGrid.Columns.Add(new DataGridTextColumn { IsReadOnly = true, Header = "Section", Binding = new Binding("Section") }); - var headers = module.Reader.PEHeaders; - var header = headers.PEHeader; - - var entries = new DataDirectoryEntry[] { - new DataDirectoryEntry(headers, "Export Table", header.ExportTableDirectory), - new DataDirectoryEntry(headers, "Import Table", header.ImportTableDirectory), - new DataDirectoryEntry(headers, "Resource Table", header.ResourceTableDirectory), - new DataDirectoryEntry(headers, "Exception Table", header.ExceptionTableDirectory), - new DataDirectoryEntry(headers, "Certificate Table", header.CertificateTableDirectory), - new DataDirectoryEntry(headers, "Base Relocation Table", header.BaseRelocationTableDirectory), - new DataDirectoryEntry(headers, "Debug Table", header.DebugTableDirectory), - new DataDirectoryEntry(headers, "Copyright Table", header.CopyrightTableDirectory), - new DataDirectoryEntry(headers, "Global Pointer Table", header.GlobalPointerTableDirectory), - new DataDirectoryEntry(headers, "Thread Local Storage Table", header.ThreadLocalStorageTableDirectory), - new DataDirectoryEntry(headers, "Load Config", header.LoadConfigTableDirectory), - new DataDirectoryEntry(headers, "Bound Import", header.BoundImportTableDirectory), - new DataDirectoryEntry(headers, "Import Address Table", header.ImportAddressTableDirectory), - new DataDirectoryEntry(headers, "Delay Import Descriptor", header.DelayImportTableDirectory), - new DataDirectoryEntry(headers, "CLI Header", header.CorHeaderTableDirectory), - }; - - dataGrid.ItemsSource = entries; - - tabPage.Content = dataGrid; - return true; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - } - - class DataDirectoryEntry - { - public string Name { get; set; } - public int RVA { get; set; } - public int Size { get; set; } - public string Section { get; set; } - - public DataDirectoryEntry(string name, int rva, int size, string section) - { - this.Name = name; - this.RVA = rva; - this.Size = size; - this.Section = section; - } - - public DataDirectoryEntry(PEHeaders headers, string name, DirectoryEntry entry) - : this(name, entry.RelativeVirtualAddress, entry.Size, (headers.GetContainingSectionIndex(entry.RelativeVirtualAddress) >= 0) ? headers.SectionHeaders[headers.GetContainingSectionIndex(entry.RelativeVirtualAddress)].Name : "") - { - } - } - } -} diff --git a/ILSpy/Metadata/DebugDirectory/CodeViewTreeNode.cs b/ILSpy/Metadata/DebugDirectory/CodeViewTreeNode.cs deleted file mode 100644 index a62b93962..000000000 --- a/ILSpy/Metadata/DebugDirectory/CodeViewTreeNode.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#nullable enable - -using System.Reflection.PortableExecutable; - -using ICSharpCode.Decompiler; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - sealed class CodeViewTreeNode : ILSpyTreeNode - { - readonly CodeViewDebugDirectoryData entry; - public CodeViewTreeNode(CodeViewDebugDirectoryData entry) - { - this.entry = entry; - } - - override public object Text => nameof(DebugDirectoryEntryType.CodeView); - - public override object ToolTip => "Associated PDB file description."; - - public override object Icon => Images.MetadataTable; - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var dataGrid = Helpers.PrepareDataGrid(tabPage, this); - - dataGrid.ItemsSource = new[] { entry }; - - tabPage.Content = dataGrid; - - return true; - } - - sealed class PdbChecksumDebugDirectoryDataEntry - { - readonly CodeViewDebugDirectoryData entry; - public PdbChecksumDebugDirectoryDataEntry(CodeViewDebugDirectoryData entry) - { - this.entry = entry; - } - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, Text.ToString()); - language.WriteCommentLine(output, $"GUID: {entry.Guid}"); - language.WriteCommentLine(output, $"Age: {entry.Age}"); - language.WriteCommentLine(output, $"Path: {entry.Path}"); - } - } -} diff --git a/ILSpy/Metadata/DebugDirectory/DebugDirectoryEntryTreeNode.cs b/ILSpy/Metadata/DebugDirectory/DebugDirectoryEntryTreeNode.cs deleted file mode 100644 index 6326a8660..000000000 --- a/ILSpy/Metadata/DebugDirectory/DebugDirectoryEntryTreeNode.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#nullable enable - -using System.Reflection.PortableExecutable; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - sealed class DebugDirectoryEntryTreeNode : ILSpyTreeNode - { - readonly PEFile module; - readonly PEReader reader; - readonly DebugDirectoryEntry entry; - public DebugDirectoryEntryTreeNode(PEFile module, DebugDirectoryEntry entry) - { - this.module = module; - this.reader = module.Reader; - this.entry = entry; - } - - override public object Text => entry.Type.ToString(); - - public override object NavigationText => $"{Text} ({module.Name})"; - - public override object Icon => Images.MetadataTable; - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, Text.ToString()); - if (entry.DataSize > 0) - { - language.WriteCommentLine(output, $"Raw Data ({entry.DataSize}):"); - int dataOffset = module.Reader.IsLoadedImage ? entry.DataRelativeVirtualAddress : entry.DataPointer; - var data = module.Reader.GetEntireImage().GetContent(dataOffset, entry.DataSize); - language.WriteCommentLine(output, data.ToHexString(data.Length)); - } - else - { - language.WriteCommentLine(output, $"(no data)"); - } - } - } -} diff --git a/ILSpy/Metadata/DebugDirectory/PdbChecksumTreeNode.cs b/ILSpy/Metadata/DebugDirectory/PdbChecksumTreeNode.cs deleted file mode 100644 index d576d40bd..000000000 --- a/ILSpy/Metadata/DebugDirectory/PdbChecksumTreeNode.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#nullable enable - -using System.Reflection.PortableExecutable; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - sealed class PdbChecksumTreeNode : ILSpyTreeNode - { - readonly PdbChecksumDebugDirectoryData entry; - public PdbChecksumTreeNode(PdbChecksumDebugDirectoryData entry) - { - this.entry = entry; - } - - override public object Text => nameof(DebugDirectoryEntryType.PdbChecksum); - - public override object ToolTip - => "The entry stores a crypto hash of the content of the symbol file the PE/COFF\n" - + "file was built with. The hash can be used to validate that a given PDB file was\n" - + "built with the PE/COFF file and not altered in any way. More than one entry can\n" - + "be present if multiple PDBs were produced during the build of the PE/COFF file\n" - + "(for example, private and public symbols)."; - - public override object Icon => Images.MetadataTable; - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var dataGrid = Helpers.PrepareDataGrid(tabPage, this); - - dataGrid.ItemsSource = new[] { new PdbChecksumDebugDirectoryDataEntry(entry) }; - - tabPage.Content = dataGrid; - - return true; - } - - sealed class PdbChecksumDebugDirectoryDataEntry - { - readonly PdbChecksumDebugDirectoryData entry; - public PdbChecksumDebugDirectoryDataEntry(PdbChecksumDebugDirectoryData entry) - { - this.entry = entry; - } - - public string AlgorithmName => entry.AlgorithmName; - - public string Checksum => entry.Checksum.ToHexString(entry.Checksum.Length); - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, Text.ToString()); - language.WriteCommentLine(output, $"AlgorithmName: {entry.AlgorithmName}"); - language.WriteCommentLine(output, $"Checksum: {entry.Checksum.ToHexString(entry.Checksum.Length)}"); - } - } -} diff --git a/ILSpy/Metadata/DebugDirectoryTreeNode.cs b/ILSpy/Metadata/DebugDirectoryTreeNode.cs deleted file mode 100644 index 1050cdefc..000000000 --- a/ILSpy/Metadata/DebugDirectoryTreeNode.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Reflection.PortableExecutable; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - class DebugDirectoryTreeNode : ILSpyTreeNode - { - private PEFile module; - - public DebugDirectoryTreeNode(PEFile module) - { - this.module = module; - this.LazyLoading = true; - } - - public override object Text => "Debug Directory"; - - public override object NavigationText => $"{Text} ({module.Name})"; -#if CROSS_PLATFORM - public override object Icon => Images.DirectoryTable; -#else - public override object Icon => Images.ListFolder; - public override object ExpandedIcon => Images.ListFolderOpen; -#endif - public override bool View(ViewModels.TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var dataGrid = Helpers.PrepareDataGrid(tabPage, this); - var entries = new List(); - foreach (var entry in module.Reader.ReadDebugDirectory()) - { - int dataOffset = module.Reader.IsLoadedImage ? entry.DataRelativeVirtualAddress : entry.DataPointer; - var data = module.Reader.GetEntireImage().GetContent(dataOffset, entry.DataSize); - - entries.Add(new DebugDirectoryEntryView(entry, data.ToHexString(data.Length))); - } - - dataGrid.ItemsSource = entries.ToArray(); - - tabPage.Content = dataGrid; - return true; - } - - protected override void LoadChildren() - { - foreach (var entry in module.Reader.ReadDebugDirectory()) - { - try - { - switch (entry.Type) - { - case DebugDirectoryEntryType.CodeView: - var codeViewData = module.Reader.ReadCodeViewDebugDirectoryData(entry); - this.Children.Add(new CodeViewTreeNode(codeViewData)); - break; - - case DebugDirectoryEntryType.EmbeddedPortablePdb: - var embeddedPortablePdbProvider = module.Reader.ReadEmbeddedPortablePdbDebugDirectoryData(entry); - var embeddedPortablePdbMetadataFile = new MetadataFile(MetadataFile.MetadataFileKind.ProgramDebugDatabase, module.FileName, embeddedPortablePdbProvider, isEmbedded: true); - this.Children.Add(new MetadataTreeNode(embeddedPortablePdbMetadataFile, "Debug Metadata (Embedded)")); - break; - - case DebugDirectoryEntryType.PdbChecksum: - var pdbChecksumData = module.Reader.ReadPdbChecksumDebugDirectoryData(entry); - this.Children.Add(new PdbChecksumTreeNode(pdbChecksumData)); - break; - - case DebugDirectoryEntryType.Unknown: - case DebugDirectoryEntryType.Coff: - case DebugDirectoryEntryType.Reproducible: - default: - this.Children.Add(new DebugDirectoryEntryTreeNode(module, entry)); - break; - } - } - catch (BadImageFormatException ex) - { - this.Children.Add(new ErrorTreeNode(ex)); - } - } - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, "Data Directories"); - } - - class DebugDirectoryEntryView - { - public uint Timestamp { get; set; } - public ushort MajorVersion { get; set; } - public ushort MinorVersion { get; set; } - public string Type { get; set; } - public int SizeOfRawData { get; set; } - [ColumnInfo("X8")] - public int AddressOfRawData { get; set; } - [ColumnInfo("X8")] - public int PointerToRawData { get; set; } - public string RawData { get; set; } - - public DebugDirectoryEntryView(DebugDirectoryEntry entry, string data) - { - this.RawData = data; - this.Timestamp = entry.Stamp; - this.MajorVersion = entry.MajorVersion; - this.MinorVersion = entry.MinorVersion; - this.Type = entry.Type.ToString(); - this.SizeOfRawData = entry.DataSize; - this.AddressOfRawData = entry.DataRelativeVirtualAddress; - this.PointerToRawData = entry.DataPointer; - } - } - } -} diff --git a/ILSpy/Metadata/DebugMetadataTablesTreeNode.cs b/ILSpy/Metadata/DebugMetadataTablesTreeNode.cs deleted file mode 100644 index 8131f0910..000000000 --- a/ILSpy/Metadata/DebugMetadataTablesTreeNode.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2021 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - class DebugMetadataTablesTreeNode : ILSpyTreeNode - { - private MetadataFile metadataFile; - - public DebugMetadataTablesTreeNode(MetadataFile metadataFile) - { - this.metadataFile = metadataFile; - this.LazyLoading = true; - } - - public override object Text => "Tables"; - - public override object NavigationText => $"{Text} ({metadataFile.Name})"; - - public override object Icon => Images.MetadataTableGroup; - - protected override void LoadChildren() - { - if (ShowTable(TableIndex.Document)) - this.Children.Add(new DocumentTableTreeNode(metadataFile)); - if (ShowTable(TableIndex.MethodDebugInformation)) - this.Children.Add(new MethodDebugInformationTableTreeNode(metadataFile)); - if (ShowTable(TableIndex.LocalScope)) - this.Children.Add(new LocalScopeTableTreeNode(metadataFile)); - if (ShowTable(TableIndex.LocalVariable)) - this.Children.Add(new LocalVariableTableTreeNode(metadataFile)); - if (ShowTable(TableIndex.LocalConstant)) - this.Children.Add(new LocalConstantTableTreeNode(metadataFile)); - if (ShowTable(TableIndex.ImportScope)) - this.Children.Add(new ImportScopeTableTreeNode(metadataFile)); - if (ShowTable(TableIndex.StateMachineMethod)) - this.Children.Add(new StateMachineMethodTableTreeNode(metadataFile)); - if (ShowTable(TableIndex.CustomDebugInformation)) - this.Children.Add(new CustomDebugInformationTableTreeNode(metadataFile)); - - bool ShowTable(TableIndex table) => !SettingsService.DisplaySettings.HideEmptyMetadataTables || metadataFile.Metadata.GetTableRowCount(table) > 0; - } - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - return false; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, "Metadata Tables"); - } - } -} diff --git a/ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs b/ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs deleted file mode 100644 index 28731afd4..000000000 --- a/ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Windows; -using System.Windows.Controls; - -using ICSharpCode.Decompiler.DebugInfo; -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class CustomDebugInformationTableTreeNode : DebugMetadataTableTreeNode - { - public CustomDebugInformationTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.CustomDebugInformation, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.CustomDebugInformation) - { - list.Add(new CustomDebugInformationEntry(metadataFile, row)); - } - return list; - } - - protected override void ConfigureDataGrid(DataGrid view) - { - view.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.VisibleWhenSelected; - view.RowDetailsTemplateSelector = new CustomDebugInformationDetailsTemplateSelector(); - } - - class CustomDebugInformationDetailsTemplateSelector : DataTemplateSelector - { - public override DataTemplate SelectTemplate(object item, DependencyObject container) - { - var entry = (CustomDebugInformationEntry)item; - switch (entry.kind) - { - case CustomDebugInformationEntry.CustomDebugInformationKind.StateMachineHoistedLocalScopes: - case CustomDebugInformationEntry.CustomDebugInformationKind.CompilationMetadataReferences: - case CustomDebugInformationEntry.CustomDebugInformationKind.CompilationOptions: - case CustomDebugInformationEntry.CustomDebugInformationKind.TupleElementNames: - return (DataTemplate)MetadataTableViews.Instance["CustomDebugInformationDetailsDataGrid"]; - default: - return (DataTemplate)MetadataTableViews.Instance["CustomDebugInformationDetailsTextBlob"]; - } - } - } - - internal struct CustomDebugInformationEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly CustomDebugInformationHandle handle; - readonly CustomDebugInformation debugInfo; - internal readonly CustomDebugInformationKind kind; - - internal enum CustomDebugInformationKind - { - None, - Unknown, - StateMachineHoistedLocalScopes, - DynamicLocalVariables, - DefaultNamespaces, - EditAndContinueLocalSlotMap, - EditAndContinueLambdaAndClosureMap, - EncStateMachineStateMap, - EmbeddedSource, - SourceLink, - MethodSteppingInformation, - CompilationOptions, - CompilationMetadataReferences, - TupleElementNames, - TypeDefinitionDocuments - } - - static CustomDebugInformationKind GetKind(MetadataReader metadata, GuidHandle h) - { - if (h.IsNil) - return CustomDebugInformationKind.None; - var guid = metadata.GetGuid(h); - if (KnownGuids.StateMachineHoistedLocalScopes == guid) - { - return CustomDebugInformationKind.StateMachineHoistedLocalScopes; - } - if (KnownGuids.DynamicLocalVariables == guid) - { - return CustomDebugInformationKind.DynamicLocalVariables; - } - if (KnownGuids.DefaultNamespaces == guid) - { - return CustomDebugInformationKind.DefaultNamespaces; - } - if (KnownGuids.EditAndContinueLocalSlotMap == guid) - { - return CustomDebugInformationKind.EditAndContinueLocalSlotMap; - } - if (KnownGuids.EditAndContinueLambdaAndClosureMap == guid) - { - return CustomDebugInformationKind.EditAndContinueLambdaAndClosureMap; - } - if (KnownGuids.EncStateMachineStateMap == guid) - { - return CustomDebugInformationKind.EncStateMachineStateMap; - } - if (KnownGuids.EmbeddedSource == guid) - { - return CustomDebugInformationKind.EmbeddedSource; - } - if (KnownGuids.SourceLink == guid) - { - return CustomDebugInformationKind.SourceLink; - } - if (KnownGuids.MethodSteppingInformation == guid) - { - return CustomDebugInformationKind.MethodSteppingInformation; - } - if (KnownGuids.CompilationOptions == guid) - { - return CustomDebugInformationKind.CompilationOptions; - } - if (KnownGuids.CompilationMetadataReferences == guid) - { - return CustomDebugInformationKind.CompilationMetadataReferences; - } - if (KnownGuids.TupleElementNames == guid) - { - return CustomDebugInformationKind.TupleElementNames; - } - if (KnownGuids.TypeDefinitionDocuments == guid) - { - return CustomDebugInformationKind.TypeDefinitionDocuments; - } - - return CustomDebugInformationKind.Unknown; - } - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public object Offset => offset == null ? "n/a" : (object)offset; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(debugInfo.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, debugInfo.Parent, protocol: "metadata"))); - } - - string parentTooltip; - public string ParentTooltip => GenerateTooltip(ref parentTooltip, metadataFile, debugInfo.Parent); - - string kindString; - public string Kind { - get { - if (kindString != null) - return kindString; - - Guid guid; - if (kind != CustomDebugInformationKind.None) - { - guid = metadataFile.Metadata.GetGuid(debugInfo.Kind); - } - else - { - guid = Guid.Empty; - } - kindString = kind switch { - CustomDebugInformationKind.None => "", - CustomDebugInformationKind.StateMachineHoistedLocalScopes => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - State Machine Hoisted Local Scopes (C# / VB) [{guid}]", - CustomDebugInformationKind.DynamicLocalVariables => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Dynamic Local Variables (C#) [{guid}]", - CustomDebugInformationKind.DefaultNamespaces => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Default Namespaces (VB) [{guid}]", - CustomDebugInformationKind.EditAndContinueLocalSlotMap => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Edit And Continue Local Slot Map (C# / VB) [{guid}]", - CustomDebugInformationKind.EditAndContinueLambdaAndClosureMap => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Edit And Continue Lambda And Closure Map (C# / VB) [{guid}]", - CustomDebugInformationKind.EncStateMachineStateMap => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Edit And Continue State Machine State Map (C# / VB) [{guid}]", - CustomDebugInformationKind.EmbeddedSource => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Embedded Source (C# / VB) [{guid}]", - CustomDebugInformationKind.SourceLink => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Source Link (C# / VB) [{guid}]", - CustomDebugInformationKind.MethodSteppingInformation => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Method Stepping Information (C# / VB) [{guid}]", - CustomDebugInformationKind.CompilationOptions => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Compilation Options (C# / VB) [{guid}]", - CustomDebugInformationKind.CompilationMetadataReferences => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Compilation Metadata References (C# / VB) [{guid}]", - CustomDebugInformationKind.TupleElementNames => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Tuple Element Names (C#) [{guid}]", - CustomDebugInformationKind.TypeDefinitionDocuments => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Type Definition Documents (C# / VB) [{guid}]", - _ => $"{MetadataTokens.GetHeapOffset(debugInfo.Kind):X8} - Unknown [{guid}]", - }; - return kindString; - } - } - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Value => MetadataTokens.GetHeapOffset(debugInfo.Value); - - public string ValueTooltip { - get { - if (debugInfo.Value.IsNil) - return ""; - return metadataFile.Metadata.GetBlobReader(debugInfo.Value).ToHexString(); - } - } - - object rowDetails; - - public object RowDetails { - get { - if (rowDetails != null) - return rowDetails; - - if (debugInfo.Value.IsNil) - return null; - - var reader = metadataFile.Metadata.GetBlobReader(debugInfo.Value); - ArrayList list; - - switch (kind) - { - case CustomDebugInformationKind.None: - return null; - case CustomDebugInformationKind.StateMachineHoistedLocalScopes: - list = new ArrayList(); - - while (reader.RemainingBytes > 0) - { - uint offset = reader.ReadUInt32(); - uint length = reader.ReadUInt32(); - list.Add(new { StartOffset = offset, Length = length }); - } - - return rowDetails = list; - case CustomDebugInformationKind.SourceLink: - return reader.ReadUTF8(reader.RemainingBytes); - case CustomDebugInformationKind.CompilationOptions: - list = new ArrayList(); - - while (reader.RemainingBytes > 0) - { - string name = reader.ReadUTF8StringNullTerminated(); - string value = reader.ReadUTF8StringNullTerminated(); - list.Add(new { Name = name, Value = value }); - } - - return rowDetails = list; - case CustomDebugInformationKind.CompilationMetadataReferences: - list = new ArrayList(); - - while (reader.RemainingBytes > 0) - { - string fileName = reader.ReadUTF8StringNullTerminated(); - string aliases = reader.ReadUTF8StringNullTerminated(); - byte flags = reader.ReadByte(); - uint timestamp = reader.ReadUInt32(); - uint fileSize = reader.ReadUInt32(); - Guid guid = reader.ReadGuid(); - list.Add(new { FileName = fileName, Aliases = aliases, Flags = flags, Timestamp = timestamp, FileSize = fileSize, Guid = guid }); - } - - return rowDetails = list; - case CustomDebugInformationKind.TupleElementNames: - list = new ArrayList(); - while (reader.RemainingBytes > 0) - { - list.Add(new { ElementName = reader.ReadUTF8StringNullTerminated() }); - } - return rowDetails = list; - default: - return reader.ToHexString(); - } - } - } - - public CustomDebugInformationEntry(MetadataFile metadataFile, CustomDebugInformationHandle handle) - { - this.metadataFile = metadataFile; - this.offset = metadataFile.IsEmbedded ? null : (int?)metadataFile.Metadata.GetTableMetadataOffset(TableIndex.CustomDebugInformation) - + metadataFile.Metadata.GetTableRowSize(TableIndex.CustomDebugInformation) * (MetadataTokens.GetRowNumber(handle) - 1); - this.handle = handle; - this.debugInfo = metadataFile.Metadata.GetCustomDebugInformation(handle); - this.kind = GetKind(metadataFile.Metadata, debugInfo.Kind); - } - } - } -} diff --git a/ILSpy/Metadata/DebugTables/DocumentTableTreeNode.cs b/ILSpy/Metadata/DebugTables/DocumentTableTreeNode.cs deleted file mode 100644 index ebc0136fa..000000000 --- a/ILSpy/Metadata/DebugTables/DocumentTableTreeNode.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.DebugInfo; -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class DocumentTableTreeNode : DebugMetadataTableTreeNode - { - public DocumentTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.Document, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.Documents) - { - list.Add(new DocumentEntry(metadataFile, row)); - } - - return list; - } - - internal readonly struct DocumentEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly DocumentHandle handle; - readonly Document document; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public object Offset => offset == null ? "n/a" : offset; - - public string Name => metadataFile.Metadata.GetString(document.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(document.Name):X} \"{Name}\""; - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int HashAlgorithm => MetadataTokens.GetHeapOffset(document.HashAlgorithm); - - public string HashAlgorithmTooltip { - get { - if (document.HashAlgorithm.IsNil) - return null; - Guid guid = metadataFile.Metadata.GetGuid(document.HashAlgorithm); - if (guid == KnownGuids.HashAlgorithmSHA1) - return "SHA1 [ff1816ec-aa5e-4d10-87f7-6f4963833460]"; - if (guid == KnownGuids.HashAlgorithmSHA256) - return "SHA256 [8829d00f-11b8-4213-878b-770e8597ac16]"; - return $"Unknown [" + guid + "]"; - } - } - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Hash => MetadataTokens.GetHeapOffset(document.Hash); - - public string HashTooltip { - get { - if (document.Hash.IsNil) - return null; - System.Collections.Immutable.ImmutableArray token = metadataFile.Metadata.GetBlobContent(document.Hash); - return token.ToHexString(token.Length); - } - } - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Language => MetadataTokens.GetHeapOffset(document.Language); - - public string LanguageTooltip { - get { - if (document.Language.IsNil) - return null; - Guid guid = metadataFile.Metadata.GetGuid(document.Language); - if (guid == KnownGuids.CSharpLanguageGuid) - return "Visual C# [3f5162f8-07c6-11d3-9053-00c04fa302a1]"; - if (guid == KnownGuids.VBLanguageGuid) - return "Visual Basic [3a12d0b8-c26c-11d0-b442-00a0244a1dd2]"; - if (guid == KnownGuids.FSharpLanguageGuid) - return "Visual F# [ab4f38c9-b6e6-43ba-be3b-58080b2ccce3]"; - return $"Unknown [" + guid + "]"; - } - } - - public DocumentEntry(MetadataFile metadataFile, DocumentHandle handle) - { - this.metadataFile = metadataFile; - this.offset = metadataFile.IsEmbedded ? null : (int?)metadataFile.Metadata.GetTableMetadataOffset(TableIndex.Document) - + metadataFile.Metadata.GetTableRowSize(TableIndex.Document) * (MetadataTokens.GetRowNumber(handle) - 1); - this.handle = handle; - this.document = metadataFile.Metadata.GetDocument(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DebugTables/ImportScopeTableTreeNode.cs b/ILSpy/Metadata/DebugTables/ImportScopeTableTreeNode.cs deleted file mode 100644 index 317a5cf3f..000000000 --- a/ILSpy/Metadata/DebugTables/ImportScopeTableTreeNode.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class ImportScopeTableTreeNode : DebugMetadataTableTreeNode - { - public ImportScopeTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.ImportScope, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - foreach (var row in metadataFile.Metadata.ImportScopes) - { - list.Add(new ImportScopeEntry(metadataFile, row)); - } - return list; - } - - internal readonly struct ImportScopeEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly ImportScopeHandle handle; - readonly ImportScope localScope; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public object Offset => offset == null ? "n/a" : offset; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Parent => MetadataTokens.GetToken(localScope.Parent); - - public void OnParentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, localScope.Parent, protocol: "metadata"))); - } - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Imports => MetadataTokens.GetHeapOffset(localScope.ImportsBlob); - - public ImportScopeEntry(MetadataFile metadataFile, ImportScopeHandle handle) - { - this.metadataFile = metadataFile; - this.handle = handle; - this.localScope = metadataFile.Metadata.GetImportScope(handle); - this.offset = metadataFile.IsEmbedded ? null : (int?)metadataFile.Metadata.GetTableMetadataOffset(TableIndex.ImportScope) - + metadataFile.Metadata.GetTableRowSize(TableIndex.ImportScope) * (MetadataTokens.GetRowNumber(handle) - 1); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DebugTables/LocalConstantTableTreeNode.cs b/ILSpy/Metadata/DebugTables/LocalConstantTableTreeNode.cs deleted file mode 100644 index 8b3d82c97..000000000 --- a/ILSpy/Metadata/DebugTables/LocalConstantTableTreeNode.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class LocalConstantTableTreeNode : DebugMetadataTableTreeNode - { - public LocalConstantTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.LocalConstant, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - foreach (var row in metadataFile.Metadata.LocalConstants) - { - list.Add(new LocalConstantEntry(metadataFile, row)); - } - - return list; - } - - internal readonly struct LocalConstantEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly LocalConstantHandle handle; - readonly LocalConstant localConst; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public object Offset => offset == null ? "n/a" : (object)offset; - - public string Name => metadataFile.Metadata.GetString(localConst.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(localConst.Name):X} \"{Name}\""; - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int Signature => MetadataTokens.GetHeapOffset(localConst.Signature); - - public LocalConstantEntry(MetadataFile metadataFile, LocalConstantHandle handle) - { - this.offset = metadataFile.IsEmbedded ? null : (int?)metadataFile.Metadata.GetTableMetadataOffset(TableIndex.LocalConstant) - + metadataFile.Metadata.GetTableRowSize(TableIndex.LocalConstant) * (MetadataTokens.GetRowNumber(handle) - 1); - this.metadataFile = metadataFile; - this.handle = handle; - this.localConst = metadataFile.Metadata.GetLocalConstant(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DebugTables/LocalScopeTableTreeNode.cs b/ILSpy/Metadata/DebugTables/LocalScopeTableTreeNode.cs deleted file mode 100644 index 73b722339..000000000 --- a/ILSpy/Metadata/DebugTables/LocalScopeTableTreeNode.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Linq; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class LocalScopeTableTreeNode : DebugMetadataTableTreeNode - { - public LocalScopeTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.LocalScope, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - foreach (var row in metadataFile.Metadata.LocalScopes) - { - list.Add(new LocalScopeEntry(metadataFile, row)); - } - - return list; - } - - internal struct LocalScopeEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly LocalScopeHandle handle; - readonly LocalScope localScope; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public object Offset => offset == null ? "n/a" : (object)offset; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Method => MetadataTokens.GetToken(localScope.Method); - - public void OnMethodClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, localScope.Method, protocol: "metadata"))); - } - - string methodTooltip; - public string MethodTooltip => GenerateTooltip(ref methodTooltip, metadataFile, localScope.Method); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int ImportScope => MetadataTokens.GetToken(localScope.ImportScope); - - public void OnImportScopeClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, localScope.ImportScope, protocol: "metadata"))); - } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int VariableList => MetadataTokens.GetToken(localScope.GetLocalVariables().FirstOrDefault()); - - public void OnVariableListClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, localScope.GetLocalVariables().FirstOrDefault(), protocol: "metadata"))); - } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int ConstantList => MetadataTokens.GetToken(localScope.GetLocalConstants().FirstOrDefault()); - - public void OnConstantListClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, localScope.GetLocalConstants().FirstOrDefault(), protocol: "metadata"))); - } - - public int StartOffset => localScope.StartOffset; - - public int Length => localScope.Length; - - public LocalScopeEntry(MetadataFile metadataFile, LocalScopeHandle handle) - { - this.metadataFile = metadataFile; - this.offset = metadataFile.IsEmbedded ? null : (int?)metadataFile.Metadata.GetTableMetadataOffset(TableIndex.LocalScope) - + metadataFile.Metadata.GetTableRowSize(TableIndex.LocalScope) * (MetadataTokens.GetRowNumber(handle) - 1); - this.handle = handle; - this.localScope = metadataFile.Metadata.GetLocalScope(handle); - this.methodTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DebugTables/LocalVariableTableTreeNode.cs b/ILSpy/Metadata/DebugTables/LocalVariableTableTreeNode.cs deleted file mode 100644 index 31370acab..000000000 --- a/ILSpy/Metadata/DebugTables/LocalVariableTableTreeNode.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class LocalVariableTableTreeNode : DebugMetadataTableTreeNode - { - public LocalVariableTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.LocalVariable, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - foreach (var row in metadataFile.Metadata.LocalVariables) - { - list.Add(new LocalVariableEntry(metadataFile, row)); - } - - return list; - } - - internal struct LocalVariableEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly LocalVariableHandle handle; - readonly LocalVariable localVar; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public object Offset => offset == null ? "n/a" : (object)offset; - - [ColumnInfo("X8", Kind = ColumnKind.Other)] - public LocalVariableAttributes Attributes => localVar.Attributes; - - public object AttributesTooltip => new FlagsTooltip() { - FlagGroup.CreateMultipleChoiceGroup(typeof(LocalVariableAttributes)), - }; - - public int Index => localVar.Index; - - public string Name => metadataFile.Metadata.GetString(localVar.Name); - - public string NameTooltip => $"{MetadataTokens.GetHeapOffset(localVar.Name):X} \"{Name}\""; - - public LocalVariableEntry(MetadataFile metadataFile, LocalVariableHandle handle) - { - this.metadataFile = metadataFile; - this.offset = metadataFile.IsEmbedded ? null : (int?)metadataFile.Metadata.GetTableMetadataOffset(TableIndex.LocalVariable) - + metadataFile.Metadata.GetTableRowSize(TableIndex.LocalVariable) * (MetadataTokens.GetRowNumber(handle) - 1); - this.handle = handle; - this.localVar = metadataFile.Metadata.GetLocalVariable(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DebugTables/MethodDebugInformationTableTreeNode.cs b/ILSpy/Metadata/DebugTables/MethodDebugInformationTableTreeNode.cs deleted file mode 100644 index 0f9393744..000000000 --- a/ILSpy/Metadata/DebugTables/MethodDebugInformationTableTreeNode.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Text; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Disassembler; -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class MethodDebugInformationTableTreeNode : DebugMetadataTableTreeNode - { - public MethodDebugInformationTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.MethodDebugInformation, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - - foreach (var row in metadataFile.Metadata.MethodDebugInformation) - { - list.Add(new MethodDebugInformationEntry(metadataFile, row)); - } - return list; - } - - internal struct MethodDebugInformationEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly MethodDebugInformationHandle handle; - readonly MethodDebugInformation debugInfo; - - public int RID => MetadataTokens.GetRowNumber(handle); - - public int Token => MetadataTokens.GetToken(handle); - - public object Offset => offset == null ? "n/a" : (object)offset; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int Document => MetadataTokens.GetToken(debugInfo.Document); - - public void OnDocumentClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, debugInfo.Document, protocol: "metadata"))); - } - - public string DocumentTooltip { - get { - if (debugInfo.Document.IsNil) - return null; - var document = metadataFile.Metadata.GetDocument(debugInfo.Document); - return $"{MetadataTokens.GetHeapOffset(document.Name):X} \"{metadataFile.Metadata.GetString(document.Name)}\""; - } - } - - [ColumnInfo("X8", Kind = ColumnKind.HeapOffset)] - public int SequencePoints => MetadataTokens.GetHeapOffset(debugInfo.SequencePointsBlob); - - public string SequencePointsTooltip { - get { - if (debugInfo.SequencePointsBlob.IsNil) - return null; - StringBuilder sb = new StringBuilder(); - foreach (var p in debugInfo.GetSequencePoints()) - { - sb.AppendLine($"document='{MetadataTokens.GetToken(p.Document):X8}', offset={p.Offset}, start={p.StartLine};{p.StartColumn}, end={p.EndLine};{p.EndColumn}, hidden={p.IsHidden}"); - } - return sb.ToString().TrimEnd(); - } - } - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int LocalSignature => MetadataTokens.GetToken(debugInfo.LocalSignature); - - public void OnLocalSignatureClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, debugInfo.LocalSignature, protocol: "metadata"))); - } - - public string LocalSignatureTooltip { - get { - if (debugInfo.LocalSignature.IsNil) - return null; - ITextOutput output = new PlainTextOutput(); - var context = new MetadataGenericContext(default(TypeDefinitionHandle), metadataFile.Metadata); - StandaloneSignature localSignature = metadataFile.Metadata.GetStandaloneSignature(debugInfo.LocalSignature); - var signatureDecoder = new DisassemblerSignatureTypeProvider(metadataFile, output); - int index = 0; - foreach (var item in localSignature.DecodeLocalSignature(signatureDecoder, context)) - { - if (index > 0) - output.WriteLine(); - output.Write("[{0}] ", index); - item(ILNameSyntax.Signature); - index++; - } - return output.ToString(); - } - } - - public MethodDebugInformationEntry(MetadataFile metadataFile, MethodDebugInformationHandle handle) - { - this.metadataFile = metadataFile; - this.offset = metadataFile.IsEmbedded ? null : (int?)metadataFile.Metadata.GetTableMetadataOffset(TableIndex.MethodDebugInformation) - + metadataFile.Metadata.GetTableRowSize(TableIndex.MethodDebugInformation) * (MetadataTokens.GetRowNumber(handle) - 1); - this.handle = handle; - this.debugInfo = metadataFile.Metadata.GetMethodDebugInformation(handle); - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DebugTables/StateMachineMethodTableTreeNode.cs b/ILSpy/Metadata/DebugTables/StateMachineMethodTableTreeNode.cs deleted file mode 100644 index 6f8204cc5..000000000 --- a/ILSpy/Metadata/DebugTables/StateMachineMethodTableTreeNode.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class StateMachineMethodTableTreeNode : DebugMetadataTableTreeNode - { - public StateMachineMethodTableTreeNode(MetadataFile metadataFile) - : base(TableIndex.StateMachineMethod, metadataFile) - { - } - - protected override IReadOnlyList LoadTable() - { - var list = new List(); - var length = metadataFile.Metadata.GetTableRowCount(TableIndex.StateMachineMethod); - var reader = metadataFile.Metadata.AsBlobReader(); - reader.Offset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.StateMachineMethod); - - for (int rid = 1; rid <= length; rid++) - { - list.Add(new StateMachineMethodEntry(metadataFile, ref reader, rid)); - } - return list; - } - - internal struct StateMachineMethodEntry - { - readonly int? offset; - readonly MetadataFile metadataFile; - readonly MethodDefinitionHandle moveNextMethod; - readonly MethodDefinitionHandle kickoffMethod; - - public int RID { get; } - - public int Token => 0x36000000 + RID; - - public object Offset => offset == null ? "n/a" : (object)offset; - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int MoveNextMethod => MetadataTokens.GetToken(moveNextMethod); - - public void OnMoveNextMethodClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, moveNextMethod, protocol: "metadata"))); - } - - string moveNextMethodTooltip; - public string MoveNextMethodTooltip => GenerateTooltip(ref moveNextMethodTooltip, metadataFile, moveNextMethod); - - [ColumnInfo("X8", Kind = ColumnKind.Token)] - public int KickoffMethod => MetadataTokens.GetToken(kickoffMethod); - - public void OnKickofMethodClick() - { - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(metadataFile, kickoffMethod, protocol: "metadata"))); - } - - string kickoffMethodTooltip; - public string KickoffMethodTooltip => GenerateTooltip(ref kickoffMethodTooltip, metadataFile, kickoffMethod); - - public StateMachineMethodEntry(MetadataFile metadataFile, ref BlobReader reader, int row) - { - this.metadataFile = metadataFile; - this.RID = row; - int rowOffset = metadataFile.Metadata.GetTableMetadataOffset(TableIndex.StateMachineMethod) - + metadataFile.Metadata.GetTableRowSize(TableIndex.StateMachineMethod) * (row - 1); - this.offset = metadataFile.IsEmbedded ? null : (int?)rowOffset; - - int methodDefSize = metadataFile.Metadata.GetTableRowCount(TableIndex.MethodDef) < ushort.MaxValue ? 2 : 4; - this.moveNextMethod = MetadataTokens.MethodDefinitionHandle(methodDefSize == 2 ? reader.ReadInt16() : reader.ReadInt32()); - this.kickoffMethod = MetadataTokens.MethodDefinitionHandle(methodDefSize == 2 ? reader.ReadInt16() : reader.ReadInt32()); - this.kickoffMethodTooltip = null; - this.moveNextMethodTooltip = null; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/DosHeaderTreeNode.cs b/ILSpy/Metadata/DosHeaderTreeNode.cs deleted file mode 100644 index 1deec9717..000000000 --- a/ILSpy/Metadata/DosHeaderTreeNode.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - class DosHeaderTreeNode : ILSpyTreeNode - { - private PEFile module; - - public DosHeaderTreeNode(PEFile module) - { - this.module = module; - } - - public override object Text => "DOS Header"; - - public override object NavigationText => $"{Text} ({module.Name})"; - - public override object Icon => Images.Header; - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var view = Helpers.PrepareDataGrid(tabPage, this); - var reader = module.Reader.GetEntireImage().GetReader(0, 64); - - var entries = new List(); - - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_magic", "Magic Number (MZ)")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_cblp", "Bytes on last page of file")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_cp", "Pages in file")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_crlc", "Relocations")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_cparhdr", "Size of header in paragraphs")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_minalloc", "Minimum extra paragraphs needed")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_maxalloc", "Maximum extra paragraphs needed")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_ss", "Initial (relative) SS value")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_sp", "Initial SP value")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_csum", "Checksum")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_ip", "Initial IP value")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_cs", "Initial (relative) CS value")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_lfarlc", "File address of relocation table")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_ovno", "Overlay number")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res[0]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res[1]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res[2]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res[3]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_oemid", "OEM identifier (for e_oeminfo)")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_oeminfo", "OEM information; e_oemid specific")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[0]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[1]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[2]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[3]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[4]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[5]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[6]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[7]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[8]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadUInt16(), 2, "e_res2[9]", "Reserved words")); - entries.Add(new Entry(reader.Offset, reader.ReadInt32(), 4, "e_lfanew", "File address of new exe header")); - - view.ItemsSource = entries; - - tabPage.Content = view; - return true; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - } - } -} diff --git a/ILSpy/Metadata/FlagsContentFilter.cs b/ILSpy/Metadata/FlagsContentFilter.cs deleted file mode 100644 index 1aa8b97ab..000000000 --- a/ILSpy/Metadata/FlagsContentFilter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using DataGridExtensions; - -namespace ICSharpCode.ILSpy.Metadata -{ - public class FlagsContentFilter : IContentFilter - { - public int Mask { get; } - - public FlagsContentFilter(int mask) - { - this.Mask = mask; - } - - public bool IsMatch(object value) - { - if (value == null) - return true; - - return Mask == -1 || (Mask & (int)value) != 0; - } - } -} diff --git a/ILSpy/Metadata/FlagsFilterControl.xaml b/ILSpy/Metadata/FlagsFilterControl.xaml deleted file mode 100644 index 6a2f4857f..000000000 --- a/ILSpy/Metadata/FlagsFilterControl.xaml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Metadata/FlagsFilterControl.xaml.cs b/ILSpy/Metadata/FlagsFilterControl.xaml.cs deleted file mode 100644 index 38e8e665b..000000000 --- a/ILSpy/Metadata/FlagsFilterControl.xaml.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Linq; -using System.Windows; -using System.Windows.Controls; - -using ICSharpCode.Decompiler.Util; - -namespace ICSharpCode.ILSpy.Metadata -{ - /// - /// Interaction logic for FlagsFilterControl.xaml - /// - public partial class FlagsFilterControl - { - ListBox listBox; - - public FlagsFilterControl() - { - InitializeComponent(); - } - - public FlagsContentFilter Filter { - get { return (FlagsContentFilter)GetValue(FilterProperty); } - set { SetValue(FilterProperty, value); } - } - - public Type FlagsType { get; set; } - - /// - /// Identifies the Filter dependency property - /// - public static readonly DependencyProperty FilterProperty = - DependencyProperty.Register("Filter", typeof(FlagsContentFilter), typeof(FlagsFilterControl), - new FrameworkPropertyMetadata(new FlagsContentFilter(-1), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (sender, e) => ((FlagsFilterControl)sender).Filter_Changed())); - - /// When overridden in a derived class, is invoked whenever application code or internal processes call . - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - listBox = Template.FindName("ListBox", this) as ListBox; - if (listBox != null) - { - listBox.ItemsSource = FlagGroup.GetFlags(FlagsType, neutralItem: ""); - } - - var filter = Filter; - - if (filter == null || filter.Mask == -1) - { - listBox?.SelectAll(); - } - } - - private void Filter_Changed() - { - var filter = Filter; - - if (filter == null || filter.Mask == -1) - { - listBox?.SelectAll(); - return; - } - - if (listBox?.SelectedItems.Count != 0) - return; - - foreach (var item in listBox.Items.Cast()) - { - if ((item.Value & filter.Mask) != 0 || item.Value == 0) - { - listBox.SelectedItems.Add(item); - } - } - } - - private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - if (e.RemovedItems?.OfType().Any(f => f.Value == -1) == true) - { - Filter = new FlagsContentFilter(0); - listBox.UnselectAll(); - return; - } - if (e.AddedItems?.OfType().Any(f => f.Value == -1) == true) - { - Filter = new FlagsContentFilter(-1); - listBox.SelectAll(); - return; - } - - bool deselectAny = e.RemovedItems?.OfType().Any(f => f.Value != -1) == true; - - int mask = 0; - foreach (var item in listBox.SelectedItems.Cast()) - { - if (deselectAny && item.Value == -1) - continue; - mask |= item.Value; - } - - Filter = new FlagsContentFilter(mask); - } - } -} diff --git a/ILSpy/Metadata/FlagsTooltip.xaml b/ILSpy/Metadata/FlagsTooltip.xaml deleted file mode 100644 index 1bd4892a7..000000000 --- a/ILSpy/Metadata/FlagsTooltip.xaml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Metadata/FlagsTooltip.xaml.cs b/ILSpy/Metadata/FlagsTooltip.xaml.cs deleted file mode 100644 index 3a763b2df..000000000 --- a/ILSpy/Metadata/FlagsTooltip.xaml.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Windows; -using System.Windows.Data; - -using ICSharpCode.Decompiler.Util; - -namespace ICSharpCode.ILSpy.Metadata -{ - /// - /// Interaction logic for FlagsTooltip.xaml - /// - public partial class FlagsTooltip : IEnumerable - { - public FlagsTooltip(int value = 0, Type flagsType = null) - { - InitializeComponent(); - } - - public void Add(FlagGroup group) - { - Groups.Add(group); - } - - public IEnumerator GetEnumerator() - { - return Groups.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return Groups.GetEnumerator(); - } - - public List Groups { get; } = new List(); - } - - class FlagActiveConverter : DependencyObject, IValueConverter - { - public int Value { - get { return (int)GetValue(ValueProperty); } - set { SetValue(ValueProperty, value); } - } - - public static readonly DependencyProperty ValueProperty = - DependencyProperty.Register("Value", typeof(int), typeof(FlagActiveConverter), new PropertyMetadata(0)); - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return Value == (int)value || ((int)value & Value) != 0; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } - - public readonly struct Flag - { - public string Name { get; } - public int Value { get; } - public bool IsSelected { get; } - - public Flag(string name, int value, bool isSelected) - { - this.Name = name; - this.Value = value; - this.IsSelected = isSelected; - } - } - - public abstract class FlagGroup - { - public static MultipleChoiceGroup CreateMultipleChoiceGroup(Type flagsType, string header = null, int mask = -1, int selectedValue = 0, bool includeAll = true) - { - MultipleChoiceGroup group = new MultipleChoiceGroup(GetFlags(flagsType, mask, selectedValue, includeAll ? "" : null)); - group.Header = header; - group.SelectedFlags = selectedValue; - return group; - } - - public static SingleChoiceGroup CreateSingleChoiceGroup(Type flagsType, string header = null, int mask = -1, int selectedValue = 0, Flag defaultFlag = default, bool includeAny = true) - { - var group = new SingleChoiceGroup(GetFlags(flagsType, mask, selectedValue, includeAny ? "" : null)); - group.Header = header; - group.SelectedFlag = group.Flags.SingleOrDefault(f => f.Value == selectedValue); - if (group.SelectedFlag.Name == null) - { - group.SelectedFlag = defaultFlag; - } - return group; - } - - public static IEnumerable GetFlags(Type flagsType, int mask = -1, int selectedValues = 0, string neutralItem = null) - { - if (neutralItem != null) - yield return new Flag(neutralItem, -1, false); - - foreach (var item in flagsType.GetFields(BindingFlags.Static | BindingFlags.Public)) - { - if (item.Name.EndsWith("Mask", StringComparison.Ordinal)) - continue; - int value = (int)CSharpPrimitiveCast.Cast(TypeCode.Int32, item.GetRawConstantValue(), false); - if ((value & mask) == 0) - continue; - yield return new Flag($"{item.Name} ({value:X4})", value, (selectedValues & value) != 0); - } - } - - public string Header { get; set; } - - public IList Flags { get; protected set; } - } - - public class MultipleChoiceGroup : FlagGroup - { - public MultipleChoiceGroup(IEnumerable flags) - { - this.Flags = flags.ToList(); - } - - public int SelectedFlags { get; set; } - } - - public class SingleChoiceGroup : FlagGroup - { - public SingleChoiceGroup(IEnumerable flags) - { - this.Flags = flags.ToList(); - } - - public Flag SelectedFlag { get; set; } - } - - class NullVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - return Visibility.Collapsed; - return Visibility.Visible; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/ILSpy/Metadata/GoToTokenCommand.cs b/ILSpy/Metadata/GoToTokenCommand.cs deleted file mode 100644 index cf0ae76c6..000000000 --- a/ILSpy/Metadata/GoToTokenCommand.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Composition; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata.Ecma335; -using System.Windows; -using System.Windows.Controls; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.Metadata; -using ICSharpCode.ILSpy.Properties; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy.Commands -{ - [ExportContextMenuEntry(Header = nameof(Resources.GoToToken), Order = 10)] - [Shared] - class GoToTokenCommand : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - int token = GetSelectedToken(context.DataGrid, out MetadataFile module).Value; - MessageBus.Send(this, new NavigateToReferenceEventArgs(new EntityReference(module, MetadataTokens.Handle(token), protocol: "metadata"))); - } - - public bool IsEnabled(TextViewContext context) - { - return true; - } - - public bool IsVisible(TextViewContext context) - { - return context.DataGrid?.Name == "MetadataView" && GetSelectedToken(context.DataGrid, out _) != null; - } - - private int? GetSelectedToken(DataGrid grid, out MetadataFile module) - { - module = null; - if (grid == null) - return null; - var cell = grid.CurrentCell; - if (!cell.IsValid) - return null; - Type type = cell.Item.GetType(); - var property = type.GetProperty(cell.Column.Header.ToString()); - var moduleField = type.GetField("module", BindingFlags.NonPublic | BindingFlags.Instance); - if (property == null || property.PropertyType != typeof(int) || !property.GetCustomAttributes(false).Any(a => a is ColumnInfoAttribute { Kind: ColumnKind.Token } c)) - return null; - module = (MetadataFile)moduleField.GetValue(cell.Item); - return (int)property.GetValue(cell.Item); - } - } - - [ExportContextMenuEntry(Header = nameof(Resources.Copy), Order = 10)] - [Shared] - class CopyCommand : IContextMenuEntry - { - public void Execute(TextViewContext context) - { - string content = GetSelectedCellContent(context.OriginalSource); - Clipboard.SetText(content); - } - - public bool IsEnabled(TextViewContext context) - { - return true; - } - - public bool IsVisible(TextViewContext context) - { - return context.DataGrid?.Name == "MetadataView" - && GetSelectedCellContent(context.OriginalSource) != null; - } - - private static string GetSelectedCellContent(DependencyObject originalSource) - { - var cell = originalSource.AncestorsAndSelf().OfType().FirstOrDefault(); - - return cell?.Column.OnCopyingCellClipboardContent(cell.DataContext).ToString(); - } - } -} diff --git a/ILSpy/Metadata/Heaps/BlobHeapTreeNode.cs b/ILSpy/Metadata/Heaps/BlobHeapTreeNode.cs deleted file mode 100644 index 050451de7..000000000 --- a/ILSpy/Metadata/Heaps/BlobHeapTreeNode.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class BlobHeapTreeNode : MetadataHeapTreeNode - { - readonly List list; - - public BlobHeapTreeNode(MetadataFile metadataFile) - : base(HandleKind.Blob, metadataFile) - { - list = new List(); - - var metadata = metadataFile.Metadata; - BlobHandle handle = MetadataTokens.BlobHandle(0); - do - { - BlobHeapEntry entry = new BlobHeapEntry(metadata, handle); - list.Add(entry); - handle = metadata.GetNextHandle(handle); - } while (!handle.IsNil); - } - - public override object Text => $"Blob Heap ({list.Count})"; - - public override bool View(ViewModels.TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var view = Helpers.PrepareDataGrid(tabPage, this); - - view.ItemsSource = list; - - tabPage.Content = view; - - return true; - } - - class BlobHeapEntry - { - readonly MetadataReader metadata; - readonly BlobHandle handle; - - public int Offset => metadata.GetHeapOffset(handle); - - public int Length => metadata.GetBlobReader(handle).Length; - - public string Value => metadata.GetBlobReader(handle).ToHexString(); - - public BlobHeapEntry(MetadataReader metadata, BlobHandle handle) - { - this.metadata = metadata; - this.handle = handle; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/Heaps/GuidHeapTreeNode.cs b/ILSpy/Metadata/Heaps/GuidHeapTreeNode.cs deleted file mode 100644 index 401d4564f..000000000 --- a/ILSpy/Metadata/Heaps/GuidHeapTreeNode.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2021 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class GuidHeapTreeNode : MetadataHeapTreeNode - { - readonly List list; - - public GuidHeapTreeNode(MetadataFile metadataFile) - : base(HandleKind.Guid, metadataFile) - { - list = new List(); - var metadata = metadataFile.Metadata; - int count = metadata.GetHeapSize(HeapIndex.Guid) >> 4; - for (int i = 1; i <= count; i++) - { - GuidHeapEntry entry = new GuidHeapEntry(metadata, MetadataTokens.GuidHandle(i)); - list.Add(entry); - } - } - - public override object Text => $"Guid Heap ({list.Count})"; - - public override bool View(ViewModels.TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var view = Helpers.PrepareDataGrid(tabPage, this); - - view.ItemsSource = list; - - tabPage.Content = view; - - return true; - } - - class GuidHeapEntry - { - readonly MetadataReader metadata; - readonly GuidHandle handle; - - public int Index => metadata.GetHeapOffset(handle); - - public int Length => 16; - - public string Value => metadata.GetGuid(handle).ToString(); - - public GuidHeapEntry(MetadataReader metadata, GuidHandle handle) - { - this.metadata = metadata; - this.handle = handle; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/Heaps/StringHeapTreeNode.cs b/ILSpy/Metadata/Heaps/StringHeapTreeNode.cs deleted file mode 100644 index 8a1d58fa1..000000000 --- a/ILSpy/Metadata/Heaps/StringHeapTreeNode.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class StringHeapTreeNode : MetadataHeapTreeNode - { - readonly List list; - - public StringHeapTreeNode(MetadataFile metadataFile) - : base(HandleKind.String, metadataFile) - { - list = new List(); - var metadata = metadataFile.Metadata; - StringHandle handle = MetadataTokens.StringHandle(0); - do - { - StringHeapEntry entry = new StringHeapEntry(metadata, handle); - list.Add(entry); - handle = metadata.GetNextHandle(handle); - } while (!handle.IsNil); - } - - public override object Text => $"String Heap ({list.Count})"; - - public override bool View(ViewModels.TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var view = Helpers.PrepareDataGrid(tabPage, this); - - view.ItemsSource = list; - - tabPage.Content = view; - - return true; - } - - class StringHeapEntry - { - readonly MetadataReader metadata; - readonly StringHandle handle; - - public int Offset => metadata.GetHeapOffset(handle); - - public int Length => metadata.GetString(handle).Length; - - public string Value => metadata.GetString(handle); - - public StringHeapEntry(MetadataReader metadata, StringHandle handle) - { - this.metadata = metadata; - this.handle = handle; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/Heaps/UserStringHeapTreeNode.cs b/ILSpy/Metadata/Heaps/UserStringHeapTreeNode.cs deleted file mode 100644 index fad97a9f6..000000000 --- a/ILSpy/Metadata/Heaps/UserStringHeapTreeNode.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler.Metadata; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal class UserStringHeapTreeNode : MetadataHeapTreeNode - { - readonly List list; - - public UserStringHeapTreeNode(MetadataFile metadataFile) - : base(HandleKind.UserString, metadataFile) - { - list = new List(); - var metadata = metadataFile.Metadata; - UserStringHandle handle = MetadataTokens.UserStringHandle(0); - do - { - UserStringHeapEntry entry = new UserStringHeapEntry(metadata, handle); - list.Add(entry); - handle = metadata.GetNextHandle(handle); - } while (!handle.IsNil); - } - - public override object Text => $"UserString Heap ({list.Count})"; - - public override bool View(ViewModels.TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var view = Helpers.PrepareDataGrid(tabPage, this); - - view.ItemsSource = list; - - tabPage.Content = view; - - return true; - } - - class UserStringHeapEntry - { - readonly MetadataReader metadata; - readonly UserStringHandle handle; - - public int Offset => metadata.GetHeapOffset(handle); - - public int Length => metadata.GetUserString(handle).Length; - - public string Value => metadata.GetUserString(handle); - - public UserStringHeapEntry(MetadataReader metadata, UserStringHandle handle) - { - this.metadata = metadata; - this.handle = handle; - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/Helper.wpf.cs b/ILSpy/Metadata/Helper.wpf.cs deleted file mode 100644 index c099ce59b..000000000 --- a/ILSpy/Metadata/Helper.wpf.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.ComponentModel; -using System.Reflection; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; - -namespace ICSharpCode.ILSpy.Metadata -{ - static partial class Helpers - { - private static DataTemplate GetOrCreateLinkCellTemplate(string name, PropertyDescriptor descriptor, Binding binding) - { - if (linkCellTemplates.TryGetValue(name, out var template)) - { - return template; - } - - var tb = new FrameworkElementFactory(typeof(TextBlock)); - var hyper = new FrameworkElementFactory(typeof(Hyperlink)); - tb.AppendChild(hyper); - hyper.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(Hyperlink_Click)); - var run = new FrameworkElementFactory(typeof(Run)); - hyper.AppendChild(run); - run.SetBinding(Run.TextProperty, binding); - - DataTemplate dataTemplate = new DataTemplate() { VisualTree = tb }; - linkCellTemplates.Add(name, dataTemplate); - return dataTemplate; - - void Hyperlink_Click(object sender, RoutedEventArgs e) - { - var hyperlink = (Hyperlink)sender; - var onClickMethod = descriptor.ComponentType.GetMethod("On" + name + "Click", BindingFlags.Instance | BindingFlags.Public); - if (onClickMethod != null) - { - onClickMethod.Invoke(hyperlink.DataContext, Array.Empty()); - } - } - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/Helpers.cs b/ILSpy/Metadata/Helpers.cs deleted file mode 100644 index 0ac7e6368..000000000 --- a/ILSpy/Metadata/Helpers.cs +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Media; -using System.Windows.Navigation; - -using DataGridExtensions; - -using ICSharpCode.Decompiler.Util; -using ICSharpCode.ILSpy.Controls; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -using TomsToolbox.Wpf.Interactivity; - -namespace ICSharpCode.ILSpy.Metadata -{ - static partial class Helpers - { - public static DataGrid PrepareDataGrid(TabPageModel tabPage, ILSpyTreeNode selectedNode) - { - if (!(tabPage.Content is DataGrid view && view.Name == "MetadataView")) - { - view = new MetaDataGrid() { - Name = "MetadataView", - GridLinesVisibility = DataGridGridLinesVisibility.None, - CanUserAddRows = false, - CanUserDeleteRows = false, - CanUserReorderColumns = false, - HeadersVisibility = DataGridHeadersVisibility.Column, - EnableColumnVirtualization = true, - EnableRowVirtualization = true, - RowHeight = 20, - IsReadOnly = true, - SelectionMode = DataGridSelectionMode.Single, - SelectionUnit = DataGridSelectionUnit.FullRow, - SelectedTreeNode = selectedNode, - CellStyle = (Style)MetadataTableViews.Instance["DataGridCellStyle"], - }; - ContextMenuProvider.Add(view); - DataGridFilter.SetIsAutoFilterEnabled(view, true); - DataGridFilter.SetContentFilterFactory(view, new RegexContentFilterFactory()); -#if !CROSS_PLATFORM - AdvancedScrollWheelBehavior.SetAttach(view, AdvancedScrollWheelMode.WithoutAnimation); -#endif - } - view.ItemsSource = null; - DataGridFilter.GetFilter(view).Clear(); - view.RowDetailsTemplateSelector = null; - view.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed; - view.EnableColumnVirtualization = true; - view.EnableRowVirtualization = true; - ((MetaDataGrid)view).SelectedTreeNode = selectedNode; - if (!view.AutoGenerateColumns) - view.Columns.Clear(); - view.AutoGenerateColumns = true; - - view.AutoGeneratingColumn += View_AutoGeneratingColumn; - view.AutoGeneratedColumns += View_AutoGeneratedColumns; - - return view; - } - - internal static void View_AutoGeneratedColumns(object sender, EventArgs e) - { - ((DataGrid)sender).AutoGeneratedColumns -= View_AutoGeneratedColumns; - ((DataGrid)sender).AutoGeneratingColumn -= View_AutoGeneratingColumn; - } - - internal static void View_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e) - { - var binding = new Binding(e.PropertyName) { Mode = BindingMode.OneWay }; - e.Column = GetColumn(); - switch (e.PropertyName) - { - case "RID": - case "Meaning": - e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["DefaultFilter"]); - break; - case "Token": - case "Offset": - case "RVA": - case "StartOffset": - case "Length": -#if CROSS_PLATFORM - binding.Converter = HexFormatConverter.Instance; -#else - binding.StringFormat = "X8"; -#endif - e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["HexFilter"]); - break; - case "RowDetails": - e.Cancel = true; - break; - case "Value" when e.PropertyDescriptor is PropertyDescriptor dp && dp.ComponentType == typeof(Entry): -#if CROSS_PLATFORM - binding.Path = "."; - e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["DefaultFilter"]); -#else - binding.Path = new PropertyPath("."); -#endif - binding.Converter = ByteWidthConverter.Instance; - break; - default: - e.Cancel = e.PropertyName.Contains("Tooltip"); - if (!e.Cancel) - { - e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["DefaultFilter"]); - } - break; - } - if (!e.Cancel) - { - ApplyAttributes((PropertyDescriptor)e.PropertyDescriptor, binding, e.Column); - } - - DataGridColumn GetColumn() - { - if (e.PropertyType == typeof(bool)) - { - return new DataGridCheckBoxColumn() { - Header = e.PropertyName, - SortMemberPath = e.PropertyName, - Binding = binding - }; - } - - var descriptor = (PropertyDescriptor)e.PropertyDescriptor; - - if (descriptor.Attributes.OfType().Any(c => c.Kind == ColumnKind.Token || c.LinkToTable)) - { - return new DataGridTemplateColumn() { - Header = e.PropertyName, - SortMemberPath = e.PropertyName, - CellTemplate = GetOrCreateLinkCellTemplate(e.PropertyName, descriptor, binding) - }; - } - - return new DataGridTextColumn() { - Header = e.PropertyName, - SortMemberPath = e.PropertyName, - Binding = binding - }; - } - } - - static readonly Dictionary linkCellTemplates = new Dictionary(); - - static void ApplyAttributes(PropertyDescriptor descriptor, Binding binding, DataGridColumn column) - { - if (descriptor.PropertyType.IsEnum) - { - binding.Converter = new UnderlyingEnumValueConverter(); - string key = descriptor.PropertyType.Name + "Filter"; - column.SetTemplate((ControlTemplate)MetadataTableViews.Instance[key]); - } - var columnInfo = descriptor.Attributes.OfType().FirstOrDefault(); - if (columnInfo != null) - { - binding.StringFormat = columnInfo.Format; - if (!descriptor.PropertyType.IsEnum - && columnInfo.Format.StartsWith("X", StringComparison.OrdinalIgnoreCase)) - { - column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["HexFilter"]); - } - } - } - - [Obsolete("Use safe GetValueLittleEndian(ReadOnlySpan) or appropriate BinaryPrimitives.Read* method")] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int GetValue(byte* ptr, int size) - => GetValueLittleEndian(new ReadOnlySpan(ptr, size)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int GetValueLittleEndian(ReadOnlySpan ptr, int size) - => GetValueLittleEndian(ptr.Slice(0, size)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int GetValueLittleEndian(ReadOnlySpan ptr) - { - int result = 0; - for (int i = 0; i < ptr.Length; i += 2) - { - result |= ptr[i] << 8 * i; - result |= ptr[i + 1] << 8 * (i + 1); - } - return result; - } - - static Helpers() - { - rowCounts = typeof(MetadataReader) - .GetField("TableRowCounts", BindingFlags.NonPublic | BindingFlags.Instance); - computeCodedTokenSize = typeof(MetadataReader) - .GetMethod("ComputeCodedTokenSize", BindingFlags.Instance | BindingFlags.NonPublic); - fromTypeDefOrRefTag = typeof(TypeDefinitionHandle).Assembly - .GetType("System.Reflection.Metadata.Ecma335.TypeDefOrRefTag") - .GetMethod("ConvertToHandle", BindingFlags.Static | BindingFlags.NonPublic); - fromHasFieldMarshalTag = typeof(TypeDefinitionHandle).Assembly - .GetType("System.Reflection.Metadata.Ecma335.HasFieldMarshalTag") - .GetMethod("ConvertToHandle", BindingFlags.Static | BindingFlags.NonPublic); - fromMemberForwardedTag = typeof(TypeDefinitionHandle).Assembly - .GetType("System.Reflection.Metadata.Ecma335.MemberForwardedTag") - .GetMethod("ConvertToHandle", BindingFlags.Static | BindingFlags.NonPublic); - } - - readonly static FieldInfo rowCounts; - readonly static MethodInfo computeCodedTokenSize; - readonly static MethodInfo fromTypeDefOrRefTag; - readonly static MethodInfo fromHasFieldMarshalTag; - readonly static MethodInfo fromMemberForwardedTag; - - public static EntityHandle FromHasFieldMarshalTag(uint tag) - { - return (EntityHandle)fromHasFieldMarshalTag.Invoke(null, new object[] { tag }); - } - - public static EntityHandle FromMemberForwardedTag(uint tag) - { - return (EntityHandle)fromMemberForwardedTag.Invoke(null, new object[] { tag }); - } - - public static EntityHandle FromTypeDefOrRefTag(uint tag) - { - return (EntityHandle)fromTypeDefOrRefTag.Invoke(null, new object[] { tag }); - } - - public static int ComputeCodedTokenSize(this MetadataReader metadata, int largeRowSize, - TableMask mask) - { - return (int)computeCodedTokenSize.Invoke(metadata, new object[] { - largeRowSize, rowCounts.GetValue(metadata), (ulong)mask } - ); - } - - class UnderlyingEnumValueConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var t = value.GetType(); - if (t.IsEnum) - { - return (int)CSharpPrimitiveCast.Cast(TypeCode.Int32, value, false); - } - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } - - public static string ReadUTF8StringNullTerminated(this ref BlobReader reader) - { - int length = reader.IndexOf(0); - string s = reader.ReadUTF8(length); - reader.ReadByte(); - return s; - } - } - - enum ColumnKind - { - HeapOffset, - Token, - Other - } - - [AttributeUsage(AttributeTargets.Property)] - class ColumnInfoAttribute : Attribute - { - public string Format { get; } - - public ColumnKind Kind { get; set; } - - public bool LinkToTable { get; set; } - - public ColumnInfoAttribute(string format) - { - this.Format = format; - } - } - - [Flags] - internal enum TableMask : ulong - { - Module = 0x1, - TypeRef = 0x2, - TypeDef = 0x4, - FieldPtr = 0x8, - Field = 0x10, - MethodPtr = 0x20, - MethodDef = 0x40, - ParamPtr = 0x80, - Param = 0x100, - InterfaceImpl = 0x200, - MemberRef = 0x400, - Constant = 0x800, - CustomAttribute = 0x1000, - FieldMarshal = 0x2000, - DeclSecurity = 0x4000, - ClassLayout = 0x8000, - FieldLayout = 0x10000, - StandAloneSig = 0x20000, - EventMap = 0x40000, - EventPtr = 0x80000, - Event = 0x100000, - PropertyMap = 0x200000, - PropertyPtr = 0x400000, - Property = 0x800000, - MethodSemantics = 0x1000000, - MethodImpl = 0x2000000, - ModuleRef = 0x4000000, - TypeSpec = 0x8000000, - ImplMap = 0x10000000, - FieldRva = 0x20000000, - EnCLog = 0x40000000, - EnCMap = 0x80000000, - Assembly = 0x100000000, - AssemblyRef = 0x800000000, - File = 0x4000000000, - ExportedType = 0x8000000000, - ManifestResource = 0x10000000000, - NestedClass = 0x20000000000, - GenericParam = 0x40000000000, - MethodSpec = 0x80000000000, - GenericParamConstraint = 0x100000000000, - Document = 0x1000000000000, - MethodDebugInformation = 0x2000000000000, - LocalScope = 0x4000000000000, - LocalVariable = 0x8000000000000, - LocalConstant = 0x10000000000000, - ImportScope = 0x20000000000000, - StateMachineMethod = 0x40000000000000, - CustomDebugInformation = 0x80000000000000, - PtrTables = 0x4800A8, - EncTables = 0xC0000000, - TypeSystemTables = 0x1FC9FFFFFFFF, - DebugTables = 0xFF000000000000, - AllTables = 0xFF1FC9FFFFFFFF, - ValidPortablePdbExternalTables = 0x1FC93FB7FF57 - } -} diff --git a/ILSpy/Metadata/HexFilterControl.ContentFilter.cs b/ILSpy/Metadata/HexFilterControl.ContentFilter.cs deleted file mode 100644 index 5a769ec5b..000000000 --- a/ILSpy/Metadata/HexFilterControl.ContentFilter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -using DataGridExtensions; - -namespace ICSharpCode.ILSpy.Metadata -{ - public partial class HexFilterControl - { - class ContentFilter : IContentFilter - { - readonly string filter; - - public ContentFilter(string filter) - { - this.filter = filter; - } - - public bool IsMatch(object value) - { - if (string.IsNullOrWhiteSpace(filter)) - return true; - if (value == null) - return false; - - return string.Format("{0:x8}", value).IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0; - } - - public string Value => filter; - } - } -} diff --git a/ILSpy/Metadata/HexFilterControl.xaml b/ILSpy/Metadata/HexFilterControl.xaml deleted file mode 100644 index d380709b8..000000000 --- a/ILSpy/Metadata/HexFilterControl.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Metadata/HexFilterControl.xaml.cs b/ILSpy/Metadata/HexFilterControl.xaml.cs deleted file mode 100644 index ce8fe1b68..000000000 --- a/ILSpy/Metadata/HexFilterControl.xaml.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -using DataGridExtensions; - -namespace ICSharpCode.ILSpy.Metadata -{ - /// - /// Interaction logic for HexFilterControl.xaml - /// - public partial class HexFilterControl - { - TextBox textBox; - - public HexFilterControl() - { - InitializeComponent(); - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - textBox = Template.FindName("textBox", this) as TextBox; - } - - private void TextBox_TextChanged(object sender, TextChangedEventArgs e) - { - var text = ((TextBox)sender)?.Text; - - Filter = new ContentFilter(text); - } - - public IContentFilter Filter { - get { return (IContentFilter)GetValue(FilterProperty); } - set { SetValue(FilterProperty, value); } - } - /// - /// Identifies the Filter dependency property - /// - public static readonly DependencyProperty FilterProperty = - DependencyProperty.Register("Filter", typeof(IContentFilter), typeof(HexFilterControl), - new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (o, args) => ((HexFilterControl)o).Filter_Changed(args.NewValue))); - - void Filter_Changed(object newValue) - { - var textBox = this.textBox; - if (textBox == null) - return; - - textBox.Text = (newValue as ContentFilter)?.Value ?? string.Empty; - } - } -} diff --git a/ILSpy/Metadata/MetaDataGrid.cs b/ILSpy/Metadata/MetaDataGrid.cs deleted file mode 100644 index 64d50838e..000000000 --- a/ILSpy/Metadata/MetaDataGrid.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; - -using ICSharpCode.AvalonEdit.Rendering; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - class MetaDataGrid : DataGrid, IHaveState - { - private readonly MouseHoverLogic hoverLogic; - private ToolTip toolTip; - - public ILSpyTreeNode SelectedTreeNode { get; set; } - - public MetaDataGrid() - { - this.hoverLogic = new MouseHoverLogic(this); - this.hoverLogic.MouseHover += HoverLogic_MouseHover; - this.hoverLogic.MouseHoverStopped += HoverLogic_MouseHoverStopped; - } - - private void HoverLogic_MouseHoverStopped(object sender, System.Windows.Input.MouseEventArgs e) - { - // Non-popup tooltips get closed as soon as the mouse starts moving again - if (toolTip != null) - { - toolTip.IsOpen = false; - e.Handled = true; - } - } - - private void HoverLogic_MouseHover(object sender, System.Windows.Input.MouseEventArgs e) - { - var position = e.GetPosition(this); - var hit = VisualTreeHelper.HitTest(this, position); - if (hit == null) - { - return; - } - var cell = hit.VisualHit.GetParent(); - if (cell == null) - return; - var data = cell.DataContext; - var name = (string)cell.Column.Header; - if (toolTip == null) - { - toolTip = new ToolTip(); - toolTip.Closed += ToolTipClosed; - } - toolTip.PlacementTarget = this; // required for property inheritance - - var pi = data?.GetType().GetProperty(name + "Tooltip"); - if (pi == null) - return; - object tooltip = pi.GetValue(data); - if (tooltip is string s) - { - if (string.IsNullOrWhiteSpace(s)) - return; - toolTip.Content = new TextBlock { - Text = s, - TextWrapping = TextWrapping.Wrap - }; - } - else if (tooltip != null) - { - toolTip.Content = tooltip; - } - else - { - return; - } - - e.Handled = true; - toolTip.IsOpen = true; - } - - private void ToolTipClosed(object sender, RoutedEventArgs e) - { - if (toolTip == sender) - { - toolTip = null; - } - } - - public ViewState GetState() - { - return new ViewState { - DecompiledNodes = SelectedTreeNode == null - ? null - : new HashSet(new[] { SelectedTreeNode }) - }; - } - } -} diff --git a/ILSpy/Metadata/MetadataHeapTreeNode.cs b/ILSpy/Metadata/MetadataHeapTreeNode.cs deleted file mode 100644 index a74ccd647..000000000 --- a/ILSpy/Metadata/MetadataHeapTreeNode.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Reflection.Metadata; -using System.Windows.Controls; -using System.Windows.Threading; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal abstract class MetadataHeapTreeNode : ILSpyTreeNode - { - protected MetadataFile metadataFile; - protected int scrollTarget; - - public HandleKind Kind { get; } - - public override object NavigationText => $"{Text} ({metadataFile.Name})"; - - public override object Icon => Images.Heap; - - public MetadataHeapTreeNode(HandleKind kind, MetadataFile metadataFile) - { - this.Kind = kind; - this.metadataFile = metadataFile; - } - - protected void ScrollItemIntoView(DataGrid view, object item) - { - view.Loaded += View_Loaded; - view.Dispatcher.BeginInvoke(() => view.SelectItem(item), DispatcherPriority.Background); - } - - private void View_Loaded(object sender, System.Windows.RoutedEventArgs e) - { - DataGrid view = (DataGrid)sender; - var sv = view.FindVisualChild(); - sv.ScrollToVerticalOffset(scrollTarget - 1); - view.Loaded -= View_Loaded; - this.scrollTarget = default; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/MetadataProtocolHandler.cs b/ILSpy/Metadata/MetadataProtocolHandler.cs deleted file mode 100644 index af686e78c..000000000 --- a/ILSpy/Metadata/MetadataProtocolHandler.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Linq; -using System.Reflection.Metadata; - -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.AssemblyTree; -using ICSharpCode.ILSpy.TreeNodes; - -namespace ICSharpCode.ILSpy.Metadata -{ - [Export(typeof(IProtocolHandler))] - [Shared] - class MetadataProtocolHandler(AssemblyTreeModel assemblyTreeModel) : IProtocolHandler - { - public ILSpyTreeNode Resolve(string protocol, MetadataFile module, Handle handle, out bool newTabPage) - { - newTabPage = true; - if (protocol != "metadata") - return null; - var assemblyTreeNode = assemblyTreeModel.FindTreeNode(module) as AssemblyTreeNode; - if (assemblyTreeNode == null) - return null; - var mxNode = assemblyTreeNode.Children.OfType().FirstOrDefault(); - if (mxNode != null) - { - mxNode.EnsureLazyChildren(); - var node = mxNode.FindNodeByHandleKind(handle.Kind); - node?.ScrollTo(handle); - return node; - } - return null; - } - } -} diff --git a/ILSpy/Metadata/MetadataTableTreeNode.cs b/ILSpy/Metadata/MetadataTableTreeNode.cs deleted file mode 100644 index 287908597..000000000 --- a/ILSpy/Metadata/MetadataTableTreeNode.cs +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Windows.Controls; -using System.Windows.Threading; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.IL; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - internal abstract partial class MetadataTableTreeNode : ILSpyTreeNode - { - protected readonly MetadataFile metadataFile; - protected int scrollTarget; - - public TableIndex Kind { get; } - - public override object Text => $"{(int)Kind:X2} {Kind} ({metadataFile.Metadata.GetTableRowCount(Kind)})"; - - public override object NavigationText => $"{(int)Kind:X2} {Kind} ({metadataFile.Name})"; - - public override object Icon => Images.MetadataTable; - - public MetadataTableTreeNode(TableIndex table, MetadataFile metadataFile) - { - this.Kind = table; - this.metadataFile = metadataFile; - } - - internal void ScrollTo(Handle handle) - { - this.scrollTarget = metadataFile.Metadata.GetRowNumber((EntityHandle)handle); - } - - protected static string GenerateTooltip(ref string tooltip, MetadataFile module, EntityHandle handle) - { - if (tooltip == null) - { - if (handle.IsNil) - { - return null; - } - ITextOutput output = new PlainTextOutput(); - var context = new MetadataGenericContext(default(TypeDefinitionHandle), module.Metadata); - var metadata = module.Metadata; - switch (handle.Kind) - { - case HandleKind.ModuleDefinition: - output.Write(metadata.GetString(metadata.GetModuleDefinition().Name)); - output.Write(" (this module)"); - break; - case HandleKind.ModuleReference: - ModuleReference moduleReference = metadata.GetModuleReference((ModuleReferenceHandle)handle); - output.Write(metadata.GetString(moduleReference.Name)); - break; - case HandleKind.AssemblyReference: - var asmRef = new Decompiler.Metadata.AssemblyReference(metadata, (AssemblyReferenceHandle)handle); - output.Write(asmRef.ToString()); - break; - case HandleKind.Parameter: - var param = metadata.GetParameter((ParameterHandle)handle); - output.Write(param.SequenceNumber + " - " + metadata.GetString(param.Name)); - break; - case HandleKind.EventDefinition: - var @event = metadata.GetEventDefinition((EventDefinitionHandle)handle); - output.Write(metadata.GetString(@event.Name)); - break; - case HandleKind.PropertyDefinition: - var prop = metadata.GetPropertyDefinition((PropertyDefinitionHandle)handle); - output.Write(metadata.GetString(prop.Name)); - break; - case HandleKind.AssemblyDefinition: - var ad = metadata.GetAssemblyDefinition(); - output.Write(metadata.GetString(ad.Name)); - output.Write(" (this assembly)"); - break; - case HandleKind.AssemblyFile: - var af = metadata.GetAssemblyFile((AssemblyFileHandle)handle); - output.Write(metadata.GetString(af.Name)); - break; - case HandleKind.GenericParameter: - var gp = metadata.GetGenericParameter((GenericParameterHandle)handle); - output.Write(metadata.GetString(gp.Name)); - break; - case HandleKind.ManifestResource: - var mfr = metadata.GetManifestResource((ManifestResourceHandle)handle); - output.Write(metadata.GetString(mfr.Name)); - break; - case HandleKind.Document: - var doc = metadata.GetDocument((DocumentHandle)handle); - output.Write(metadata.GetString(doc.Name)); - break; - default: - handle.WriteTo(module, output, context); - break; - } - tooltip = "(" + handle.Kind + ") " + output.ToString(); - } - return tooltip; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - } - } - - internal abstract class MetadataTableTreeNode : MetadataTableTreeNode - where TEntry : struct - { - public MetadataTableTreeNode(TableIndex kind, MetadataFile metadataFile) - : base(kind, metadataFile) - { - } - - protected abstract IReadOnlyList LoadTable(); - - protected virtual void ConfigureDataGrid(DataGrid view) - { - } - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var view = Helpers.PrepareDataGrid(tabPage, this); - ConfigureDataGrid(view); - - view.ItemsSource = LoadTable(); - tabPage.Content = view; - - ScrollRowIntoView(view, scrollTarget); - - return true; - } - } - - internal abstract class DebugMetadataTableTreeNode : MetadataTableTreeNode - where TEntry : struct - { - public DebugMetadataTableTreeNode(TableIndex kind, MetadataFile metadataFile) - : base(kind, metadataFile) - { - } - } - - internal class UnsupportedMetadataTableTreeNode : MetadataTableTreeNode - { - public UnsupportedMetadataTableTreeNode(TableIndex kind, MetadataFile file) - : base(kind, file) - { - } - public override object Text => $"{(int)Kind:X2} {Kind.ToString()} [unsupported] ({metadataFile.Metadata.GetTableRowCount(Kind)})"; - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - output.WriteLine($"Unsupported table '{(int)Kind:X2} {Kind}' contains {metadataFile.Metadata.GetTableRowCount(Kind)} rows."); - } - } -} diff --git a/ILSpy/Metadata/MetadataTableTreeNode.wpf.cs b/ILSpy/Metadata/MetadataTableTreeNode.wpf.cs deleted file mode 100644 index a9f3efe5c..000000000 --- a/ILSpy/Metadata/MetadataTableTreeNode.wpf.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Windows.Controls; -using System.Windows.Threading; - -namespace ICSharpCode.ILSpy.Metadata -{ - partial class MetadataTableTreeNode - { - - protected void ScrollRowIntoView(DataGrid view, int row) - { - if (!view.IsLoaded) - { - view.Loaded += View_Loaded; - } - else - { - View_Loaded(view, new System.Windows.RoutedEventArgs()); - } - if (row > 0 && view.Items.Count >= row) - view.Dispatcher.BeginInvoke(() => view.SelectItem(view.Items[row - 1]), DispatcherPriority.Background); - } - - private void View_Loaded(object sender, System.Windows.RoutedEventArgs e) - { - DataGrid view = (DataGrid)sender; - var sv = view.FindVisualChild(); - sv.ScrollToVerticalOffset(scrollTarget - 1); - view.Loaded -= View_Loaded; - this.scrollTarget = default; - } - } -} \ No newline at end of file diff --git a/ILSpy/Metadata/MetadataTableViews.xaml b/ILSpy/Metadata/MetadataTableViews.xaml deleted file mode 100644 index 71c9ef016..000000000 --- a/ILSpy/Metadata/MetadataTableViews.xaml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ILSpy/Metadata/MetadataTableViews.xaml.cs b/ILSpy/Metadata/MetadataTableViews.xaml.cs deleted file mode 100644 index a4960a962..000000000 --- a/ILSpy/Metadata/MetadataTableViews.xaml.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace ICSharpCode.ILSpy.Metadata -{ - /// - /// Interaction logic for MetadataTableViews.xaml - /// - public partial class MetadataTableViews : ResourceDictionary - { - public MetadataTableViews() - { - InitializeComponent(); - } - - static MetadataTableViews instance; - - public static MetadataTableViews Instance { - get { - if (instance == null) - { - instance = new MetadataTableViews(); - } - return instance; - } - } - - private void DataGrid_AutoGeneratedColumns(object sender, EventArgs e) - { - Helpers.View_AutoGeneratedColumns(sender, e); - } - - private void DataGrid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e) - { - Helpers.View_AutoGeneratingColumn(sender, e); - } - } -} diff --git a/ILSpy/Metadata/MetadataTablesTreeNode.cs b/ILSpy/Metadata/MetadataTablesTreeNode.cs deleted file mode 100644 index f00894e4b..000000000 --- a/ILSpy/Metadata/MetadataTablesTreeNode.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) 2021 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - class MetadataTablesTreeNode : ILSpyTreeNode - { - readonly MetadataFile metadataFile; - - public MetadataTablesTreeNode(MetadataFile metadataFile) - { - this.metadataFile = metadataFile; - this.LazyLoading = true; - } - - public override object Text => "Tables"; - - public override object NavigationText => $"{Text} ({metadataFile.Name})"; - - public override object Icon => Images.MetadataTableGroup; - - protected override void LoadChildren() - { - foreach (var table in Enum.GetValues()) - { - if (ShowTable(table, metadataFile.Metadata)) - this.Children.Add(CreateTableTreeNode(table, metadataFile)); - } - } - - internal static bool ShowTable(TableIndex table, MetadataReader metadata) => !SettingsService.DisplaySettings.HideEmptyMetadataTables || metadata.GetTableRowCount(table) > 0; - - internal static MetadataTableTreeNode CreateTableTreeNode(TableIndex table, MetadataFile metadataFile) - { - switch (table) - { - case TableIndex.Module: - return new ModuleTableTreeNode(metadataFile); - case TableIndex.TypeRef: - return new TypeRefTableTreeNode(metadataFile); - case TableIndex.TypeDef: - return new TypeDefTableTreeNode(metadataFile); - case TableIndex.Field: - return new FieldTableTreeNode(metadataFile); - case TableIndex.MethodDef: - return new MethodTableTreeNode(metadataFile); - case TableIndex.Param: - return new ParamTableTreeNode(metadataFile); - case TableIndex.InterfaceImpl: - return new InterfaceImplTableTreeNode(metadataFile); - case TableIndex.MemberRef: - return new MemberRefTableTreeNode(metadataFile); - case TableIndex.Constant: - return new ConstantTableTreeNode(metadataFile); - case TableIndex.CustomAttribute: - return new CustomAttributeTableTreeNode(metadataFile); - case TableIndex.FieldMarshal: - return new FieldMarshalTableTreeNode(metadataFile); - case TableIndex.DeclSecurity: - return new DeclSecurityTableTreeNode(metadataFile); - case TableIndex.ClassLayout: - return new ClassLayoutTableTreeNode(metadataFile); - case TableIndex.FieldLayout: - return new FieldLayoutTableTreeNode(metadataFile); - case TableIndex.StandAloneSig: - return new StandAloneSigTableTreeNode(metadataFile); - case TableIndex.EventMap: - return new EventMapTableTreeNode(metadataFile); - case TableIndex.Event: - return new EventTableTreeNode(metadataFile); - case TableIndex.PropertyMap: - return new PropertyMapTableTreeNode(metadataFile); - case TableIndex.Property: - return new PropertyTableTreeNode(metadataFile); - case TableIndex.MethodSemantics: - return new MethodSemanticsTableTreeNode(metadataFile); - case TableIndex.MethodImpl: - return new MethodImplTableTreeNode(metadataFile); - case TableIndex.ModuleRef: - return new ModuleRefTableTreeNode(metadataFile); - case TableIndex.TypeSpec: - return new TypeSpecTableTreeNode(metadataFile); - case TableIndex.ImplMap: - return new ImplMapTableTreeNode(metadataFile); - case TableIndex.FieldRva: - return new FieldRVATableTreeNode(metadataFile); - case TableIndex.Assembly: - return new AssemblyTableTreeNode(metadataFile); - case TableIndex.AssemblyRef: - return new AssemblyRefTableTreeNode(metadataFile); - case TableIndex.File: - return new FileTableTreeNode(metadataFile); - case TableIndex.ExportedType: - return new ExportedTypeTableTreeNode(metadataFile); - case TableIndex.ManifestResource: - return new ManifestResourceTableTreeNode(metadataFile); - case TableIndex.NestedClass: - return new NestedClassTableTreeNode(metadataFile); - case TableIndex.GenericParam: - return new GenericParamTableTreeNode(metadataFile); - case TableIndex.MethodSpec: - return new MethodSpecTableTreeNode(metadataFile); - case TableIndex.GenericParamConstraint: - return new GenericParamConstraintTableTreeNode(metadataFile); - case TableIndex.Document: - return new DocumentTableTreeNode(metadataFile); - case TableIndex.MethodDebugInformation: - return new MethodDebugInformationTableTreeNode(metadataFile); - case TableIndex.LocalScope: - return new LocalScopeTableTreeNode(metadataFile); - case TableIndex.LocalVariable: - return new LocalVariableTableTreeNode(metadataFile); - case TableIndex.LocalConstant: - return new LocalConstantTableTreeNode(metadataFile); - case TableIndex.ImportScope: - return new ImportScopeTableTreeNode(metadataFile); - case TableIndex.StateMachineMethod: - return new StateMachineMethodTableTreeNode(metadataFile); - case TableIndex.CustomDebugInformation: - return new CustomDebugInformationTableTreeNode(metadataFile); - case TableIndex.FieldPtr: - case TableIndex.EventPtr: - case TableIndex.MethodPtr: - case TableIndex.ParamPtr: - case TableIndex.PropertyPtr: - return new PtrTableTreeNode(table, metadataFile); - default: - return new UnsupportedMetadataTableTreeNode(table, metadataFile); - } - } - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - return false; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, "Metadata Tables"); - } - } -} diff --git a/ILSpy/Metadata/MetadataTreeNode.cs b/ILSpy/Metadata/MetadataTreeNode.cs deleted file mode 100644 index 771ed946b..000000000 --- a/ILSpy/Metadata/MetadataTreeNode.cs +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Windows.Data; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpy.ViewModels; - -namespace ICSharpCode.ILSpy.Metadata -{ - class MetadataTreeNode : ILSpyTreeNode - { - private readonly MetadataFile metadataFile; - private readonly string title; - - public MetadataTreeNode(MetadataFile module, string title) - { - this.metadataFile = module; - this.title = title; - this.LazyLoading = true; - } - - public override object Text => title; - - public override object NavigationText => $"{Text} ({metadataFile.Name})"; - - public override object Icon => Images.Metadata; - - public override bool View(TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - return false; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, title); - - DumpMetadataInfo(language, output, this.metadataFile.Metadata); - } - - internal static void DumpMetadataInfo(Language language, ITextOutput output, MetadataReader metadata) - { - language.WriteCommentLine(output, "MetadataKind: " + metadata.MetadataKind); - language.WriteCommentLine(output, "MetadataVersion: " + metadata.MetadataVersion); - - if (metadata.DebugMetadataHeader is { } header) - { - output.WriteLine(); - language.WriteCommentLine(output, "Header:"); - language.WriteCommentLine(output, "Id: " + header.Id.ToHexString(header.Id.Length)); - language.WriteCommentLine(output, "EntryPoint: " + MetadataTokens.GetToken(header.EntryPoint).ToString("X8")); - } - - output.WriteLine(); - language.WriteCommentLine(output, "Tables:"); - - foreach (var table in Enum.GetValues()) - { - int count = metadata.GetTableRowCount(table); - if (count > 0) - { - language.WriteCommentLine(output, $"{(byte)table:X2} {table}: {count} rows"); - } - } - } - - protected override void LoadChildren() - { - if (metadataFile is PEFile module) - { - this.Children.Add(new DosHeaderTreeNode(module)); - this.Children.Add(new CoffHeaderTreeNode(module)); - this.Children.Add(new OptionalHeaderTreeNode(module)); - this.Children.Add(new DataDirectoriesTreeNode(module)); - this.Children.Add(new DebugDirectoryTreeNode(module)); - } - this.Children.Add(new MetadataTablesTreeNode(metadataFile)); - this.Children.Add(new StringHeapTreeNode(metadataFile)); - this.Children.Add(new UserStringHeapTreeNode(metadataFile)); - this.Children.Add(new GuidHeapTreeNode(metadataFile)); - this.Children.Add(new BlobHeapTreeNode(metadataFile)); - } - - public MetadataTableTreeNode FindNodeByHandleKind(HandleKind kind) - { - return this.Children.OfType().Single() - .Children.OfType().SingleOrDefault(x => x.Kind == (TableIndex)kind); - } - } - - class Entry - { - public string Member { get; } - public int Offset { get; } - public int Size { get; } - public object Value { get; } - public string Meaning { get; } - - public IList RowDetails { get; } - - public Entry(int offset, object value, int size, string member, string meaning, IList rowDetails = null) - { - this.Member = member; - this.Offset = offset; - this.Size = size; - this.Value = value; - this.Meaning = meaning; - this.RowDetails = rowDetails; - } - } - - class BitEntry - { - public bool Value { get; } - public string Meaning { get; } - - public BitEntry(bool value, string meaning) - { - this.Value = value; - this.Meaning = meaning; - } - } - - class ByteWidthConverter : IValueConverter - { - public static readonly ByteWidthConverter Instance = new ByteWidthConverter(); - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (object.ReferenceEquals(value, null)) - return string.Empty; - - return string.Format("{0:X" + 2 * ((Entry)value).Size + "}", ((Entry)value).Value); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/ILSpy/Metadata/OptionalHeaderTreeNode.cs b/ILSpy/Metadata/OptionalHeaderTreeNode.cs deleted file mode 100644 index 7ad743f35..000000000 --- a/ILSpy/Metadata/OptionalHeaderTreeNode.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.Reflection.PortableExecutable; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; - -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Metadata; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX.Extensions; - -using TomsToolbox.Essentials; - -namespace ICSharpCode.ILSpy.Metadata -{ - class OptionalHeaderTreeNode : ILSpyTreeNode - { - private PEFile module; - - public OptionalHeaderTreeNode(PEFile module) - { - this.module = module; - } - - public override object Text => "Optional Header"; - - public override object NavigationText => $"{Text} ({module.Name})"; - - public override object Icon => Images.Header; - - public override bool View(ViewModels.TabPageModel tabPage) - { - tabPage.Title = Text.ToString(); - tabPage.SupportsLanguageSwitching = false; - - var dataGrid = Helpers.PrepareDataGrid(tabPage, this); - - dataGrid.RowDetailsTemplateSelector = new CharacteristicsDataTemplateSelector("DLL Characteristics"); - dataGrid.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed; - - dataGrid.Columns.Clear(); - dataGrid.AutoGenerateColumns = false; - dataGrid.Columns.AddRange( - new[] { - new DataGridTextColumn { IsReadOnly = true, Header = "Member", Binding = new Binding("Member") }, - new DataGridTextColumn { IsReadOnly = true, Header = "Offset", Binding = new Binding("Offset") { StringFormat = "X8" } }, - new DataGridTextColumn { IsReadOnly = true, Header = "Size", Binding = new Binding("Size") }, - new DataGridTextColumn { IsReadOnly = true, Header = "Value", Binding = new Binding(".") { Converter = ByteWidthConverter.Instance } }, - new DataGridTextColumn { IsReadOnly = true, Header = "Meaning", Binding = new Binding("Meaning") } - } - ); - - var headers = module.Reader.PEHeaders; - var reader = module.Reader.GetEntireImage().GetReader(headers.PEHeaderStartOffset, 128); - var header = headers.PEHeader; - var isPE32Plus = (header.Magic == PEMagic.PE32Plus); - - var entries = new List(); - ushort dllCharacteristics; - Entry characteristics; - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Magic", header.Magic.ToString())); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadByte(), 1, "Major Linker Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadByte(), 1, "Minor Linker Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Code Size", "Size of the code (text) section, or the sum of all code sections if there are multiple sections.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Initialized Data Size", "Size of the initialized data section, or the sum of all initialized data sections if there are multiple data sections.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Uninitialized Data Size", "Size of the uninitialized data section, or the sum of all uninitialized data sections if there are multiple uninitialized data sections.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Entry Point RVA", "RVA of entry point, needs to point to bytes 0xFF 0x25 followed by the RVA in a section marked execute / read for EXEs or 0 for DLLs")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Base Of Code", "RVA of the code section.")); - entries.Add(new Entry(isPE32Plus ? 0 : headers.PEHeaderStartOffset + reader.Offset, isPE32Plus ? 0UL : reader.ReadUInt32(), isPE32Plus ? 0 : 4, "Base Of Data", "PE32 only (not present in PE32Plus): RVA of the data section, relative to the Image Base.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, isPE32Plus ? reader.ReadUInt64() : reader.ReadUInt32(), isPE32Plus ? 8 : 4, "Image Base", "Shall be a multiple of 0x10000.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Section Alignment", "Shall be greater than File Alignment.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "File Alignment", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Major OS Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Minor OS Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Major Image Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Minor Image Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Major Subsystem Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Minor Subsystem Version", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt32(), 4, "Win32VersionValue", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Image Size", "Size, in bytes, of image, including all headers and padding; shall be a multiple of Section Alignment.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Header Size", "Combined size of MS-DOS Header, PE Header, PE Optional Header and padding; shall be a multiple of the file alignment.")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "File Checksum", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt16(), 2, "Subsystem", header.Subsystem.ToString())); - entries.Add(characteristics = new Entry(headers.PEHeaderStartOffset + reader.Offset, dllCharacteristics = reader.ReadUInt16(), 2, "DLL Characteristics", header.DllCharacteristics.ToString(), new[] { - new BitEntry((dllCharacteristics & 0x0001) != 0, "<0001> Process Init (Reserved)"), - new BitEntry((dllCharacteristics & 0x0002) != 0, "<0002> Process Term (Reserved)"), - new BitEntry((dllCharacteristics & 0x0004) != 0, "<0004> Thread Init (Reserved)"), - new BitEntry((dllCharacteristics & 0x0008) != 0, "<0008> Thread Term (Reserved)"), - new BitEntry((dllCharacteristics & 0x0010) != 0, "<0010> Unused"), - new BitEntry((dllCharacteristics & 0x0020) != 0, "<0020> Image can handle a high entropy 64-bit virtual address space (ASLR)"), - new BitEntry((dllCharacteristics & 0x0040) != 0, "<0040> DLL can be relocated at load time"), - new BitEntry((dllCharacteristics & 0x0080) != 0, "<0080> Code integrity checks are enforced"), - new BitEntry((dllCharacteristics & 0x0100) != 0, "<0100> Image is NX compatible"), - new BitEntry((dllCharacteristics & 0x0200) != 0, "<0200> Isolation aware, but do not isolate the image"), - new BitEntry((dllCharacteristics & 0x0400) != 0, "<0400> Does not use structured exception handling (SEH)"), - new BitEntry((dllCharacteristics & 0x0800) != 0, "<0800> Do not bind the image"), - new BitEntry((dllCharacteristics & 0x1000) != 0, "<1000> Image must execute in an AppContainer"), - new BitEntry((dllCharacteristics & 0x2000) != 0, "<2000> Driver is a WDM Driver"), - new BitEntry((dllCharacteristics & 0x4000) != 0, "<4000> Image supports Control Flow Guard"), - new BitEntry((dllCharacteristics & 0x8000) != 0, "<8000> Image is Terminal Server aware"), - })); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, isPE32Plus ? reader.ReadUInt64() : reader.ReadUInt32(), isPE32Plus ? 8 : 4, "Stack Reserve Size", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, isPE32Plus ? reader.ReadUInt64() : reader.ReadUInt32(), isPE32Plus ? 8 : 4, "Stack Commit Size", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, isPE32Plus ? reader.ReadUInt64() : reader.ReadUInt32(), isPE32Plus ? 8 : 4, "Heap Reserve Size", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, isPE32Plus ? reader.ReadUInt64() : reader.ReadUInt32(), isPE32Plus ? 8 : 4, "Heap Commit Size", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadUInt32(), 4, "Loader Flags", "")); - entries.Add(new Entry(headers.PEHeaderStartOffset + reader.Offset, reader.ReadInt32(), 4, "Number of Data Directories", "")); - - dataGrid.ItemsSource = entries; - dataGrid.SetDetailsVisibilityForItem(characteristics, Visibility.Visible); - - tabPage.Content = dataGrid; - return true; - } - - public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) - { - language.WriteCommentLine(output, "Optional Header"); - } - } -} diff --git a/ILSpy/NativeMethods.cs b/ILSpy/NativeMethods.cs deleted file mode 100644 index 0479f9cd0..000000000 --- a/ILSpy/NativeMethods.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Runtime.InteropServices; - -namespace ICSharpCode.ILSpy -{ - // Uses https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke-source-generation - internal static partial class NativeMethods - { - const int S_OK = 0; - - [LibraryImport("user32.dll")] - internal static partial int GetDoubleClickTime(); - - [LibraryImport("dwmapi.dll")] - internal static partial int DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttribute attr, ref int attrValue, int attrSize); - - public static bool UseImmersiveDarkMode(IntPtr hWnd, bool enable) - { - int darkMode = enable ? 1 : 0; - int hResult = DwmSetWindowAttribute(hWnd, DwmWindowAttribute.UseImmersiveDarkMode, ref darkMode, sizeof(int)); - return hResult > S_OK; - } - } - - public enum DwmWindowAttribute : uint - { - NCRenderingEnabled = 1, - NCRenderingPolicy, - TransitionsForceDisabled, - AllowNCPaint, - CaptionButtonBounds, - NonClientRtlLayout, - ForceIconicRepresentation, - Flip3DPolicy, - ExtendedFrameBounds, - HasIconicBitmap, - DisallowPeek, - ExcludedFromPeek, - Cloak, - Cloaked, - FreezeRepresentation, - PassiveUpdateMode, - UseHostBackdropBrush, - UseImmersiveDarkMode = 20, - WindowCornerPreference = 33, - BorderColor, - CaptionColor, - TextColor, - VisibleFrameBorderThickness, - SystemBackdropType, - Last - } -} diff --git a/ILSpy/NavigationHistory.cs b/ILSpy/NavigationHistory.cs deleted file mode 100644 index 6e9f6ed70..000000000 --- a/ILSpy/NavigationHistory.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; - -namespace ICSharpCode.ILSpy -{ - /// - /// Stores the navigation history. - /// - internal sealed class NavigationHistory - where T : class, IEquatable - { - private const double NavigationSecondsBeforeNewEntry = 0.5; - - private DateTime lastNavigationTime = DateTime.MinValue; - T current; - List back = new List(); - List forward = new List(); - - public T[] BackList => back.ToArray(); - public T[] ForwardList => forward.ToArray(); - - public bool CanNavigateBack { - get { return back.Count > 0; } - } - - public bool CanNavigateForward { - get { return forward.Count > 0; } - } - - public T GoBack() - { - forward.Add(current); - current = back[back.Count - 1]; - back.RemoveAt(back.Count - 1); - return current; - } - - public T GoForward() - { - back.Add(current); - current = forward[forward.Count - 1]; - forward.RemoveAt(forward.Count - 1); - return current; - } - - public void RemoveAll(Predicate predicate) - { - back.RemoveAll(predicate); - forward.RemoveAll(predicate); - } - - public void Clear() - { - back.Clear(); - forward.Clear(); - } - - public void UpdateCurrent(T node) - { - current = node; - } - - public void Record(T node) - { - var navigationTime = DateTime.Now; - var period = navigationTime - lastNavigationTime; - - if (period.TotalSeconds < NavigationSecondsBeforeNewEntry) - { - current = node; - } - else - { - if (current != null) - back.Add(current); - - // We only store a record once, and ensure it is on the top of the stack, so we just remove the old record - back.Remove(node); - current = node; - } - - forward.Clear(); - - lastNavigationTime = navigationTime; - } - } -} diff --git a/ILSpy/NavigationState.cs b/ILSpy/NavigationState.cs deleted file mode 100644 index 04057d399..000000000 --- a/ILSpy/NavigationState.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; - -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.ViewModels; -using ICSharpCode.ILSpyX.TreeView; - -namespace ICSharpCode.ILSpy -{ - [DebuggerDisplay("Nodes = {treeNodes.Count}, State = [{ViewState}]")] - public class NavigationState : IEquatable - { - private readonly HashSet treeNodes; - - public IEnumerable TreeNodes => treeNodes; - public ViewState ViewState { get; private set; } - public TabPageModel TabPage { get; private set; } - - public NavigationState(TabPageModel tabPage, ViewState viewState) - { - this.TabPage = tabPage; - this.treeNodes = new HashSet((IEnumerable)viewState.DecompiledNodes ?? Array.Empty()); - ViewState = viewState; - } - - public NavigationState(TabPageModel tabPage, IEnumerable treeNodes) - { - this.TabPage = tabPage; - this.treeNodes = new HashSet(treeNodes); - } - - public bool Equals(NavigationState other) - { - if (!this.treeNodes.SetEquals(other.treeNodes)) - return false; - - if (object.ReferenceEquals(this.ViewState, other.ViewState)) - return true; - - if (this.ViewState == null) - return false; - - return this.ViewState.Equals(other.ViewState); - } - - public object NavigationText { - get { - if (this.treeNodes.Count == 1) - return this.treeNodes.First(); - - if (this.treeNodes.Count > 0) - return string.Join(", ", treeNodes.Select(tn => tn.NavigationText)); - - if (this.ViewState?.ViewedUri is Uri uri) - return uri; - - return ToString(); - } - } - } -} diff --git a/ILSpy/Options/DecompilerSettingsPanel.xaml b/ILSpy/Options/DecompilerSettingsPanel.xaml deleted file mode 100644 index be018ee92..000000000 --- a/ILSpy/Options/DecompilerSettingsPanel.xaml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Options/DecompilerSettingsPanel.xaml.cs b/ILSpy/Options/DecompilerSettingsPanel.xaml.cs deleted file mode 100644 index 8d1132525..000000000 --- a/ILSpy/Options/DecompilerSettingsPanel.xaml.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Composition; -using System.Xml.Linq; - -using ICSharpCode.ILSpyX.Settings; - -using TomsToolbox.Wpf.Composition.AttributedModel; - -namespace ICSharpCode.ILSpy.Options -{ - /// - /// Interaction logic for DecompilerSettingsPanel.xaml - /// - [DataTemplate(typeof(DecompilerSettingsViewModel))] - [NonShared] - internal partial class DecompilerSettingsPanel - { - public DecompilerSettingsPanel() - { - InitializeComponent(); - } - } -} diff --git a/ILSpy/Options/DecompilerSettingsViewModel.cs b/ILSpy/Options/DecompilerSettingsViewModel.cs deleted file mode 100644 index dd11fae59..000000000 --- a/ILSpy/Options/DecompilerSettingsViewModel.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Collections.Generic; -using System.ComponentModel; -using System.Composition; -using System.Linq; -using System.Reflection; - -using ICSharpCode.ILSpy.Properties; -using ICSharpCode.ILSpy.TreeNodes; -using ICSharpCode.ILSpyX.Settings; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy.Options -{ - [ExportOptionPage(Order = 10)] - [NonShared] - public sealed class DecompilerSettingsViewModel : ObservableObjectBase, IOptionPage - { - private static readonly PropertyInfo[] propertyInfos = typeof(Decompiler.DecompilerSettings).GetProperties() - .Where(p => p.GetCustomAttribute()?.Browsable != false) - .ToArray(); - - public string Title => Resources.Decompiler; - - private DecompilerSettingsGroupViewModel[] settings; - public DecompilerSettingsGroupViewModel[] Settings { - get => settings; - set => SetProperty(ref settings, value); - } - - private DecompilerSettings decompilerSettings; - - public void Load(SettingsSnapshot snapshot) - { - decompilerSettings = snapshot.GetSettings(); - LoadSettings(); - } - - private void LoadSettings() - { - this.Settings = propertyInfos - .Select(p => new DecompilerSettingsItemViewModel(p, decompilerSettings)) - .OrderBy(item => item.Category, NaturalStringComparer.Instance) - .GroupBy(p => p.Category) - .Select(g => new DecompilerSettingsGroupViewModel(g.Key, g.OrderBy(i => i.Description).ToArray())) - .ToArray(); - } - - public void LoadDefaults() - { - var defaults = new Decompiler.DecompilerSettings(); - - foreach (var propertyInfo in propertyInfos) - { - propertyInfo.SetValue(decompilerSettings, propertyInfo.GetValue(defaults)); - } - - LoadSettings(); - } - } - - public sealed class DecompilerSettingsGroupViewModel : ObservableObjectBase - { - private bool? areAllItemsChecked; - - public DecompilerSettingsGroupViewModel(string category, DecompilerSettingsItemViewModel[] settings) - { - Settings = settings; - Category = category; - - areAllItemsChecked = GetAreAllItemsChecked(Settings); - - foreach (DecompilerSettingsItemViewModel viewModel in settings) - { - viewModel.PropertyChanged += Item_PropertyChanged; - } - } - - public bool? AreAllItemsChecked { - get => areAllItemsChecked; - set { - SetProperty(ref areAllItemsChecked, value); - - if (!value.HasValue) - return; - - foreach (var setting in Settings) - { - setting.IsEnabled = value.Value; - } - } - } - - public string Category { get; } - - public DecompilerSettingsItemViewModel[] Settings { get; } - - private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(DecompilerSettingsItemViewModel.IsEnabled)) - { - AreAllItemsChecked = GetAreAllItemsChecked(Settings); - } - } - - private static bool? GetAreAllItemsChecked(ICollection settings) - { - var numberOfEnabledItems = settings.Count(item => item.IsEnabled); - - if (numberOfEnabledItems == settings.Count) - return true; - - if (numberOfEnabledItems == 0) - return false; - - return null; - } - } - - public sealed class DecompilerSettingsItemViewModel(PropertyInfo property, DecompilerSettings decompilerSettings) : ObservableObjectBase - { - private bool isEnabled = property.GetValue(decompilerSettings) is true; - - public PropertyInfo Property => property; - - public bool IsEnabled { - get => isEnabled; - set { - if (SetProperty(ref isEnabled, value)) - { - property.SetValue(decompilerSettings, value); - } - } - } - - public string Description { get; set; } = GetResourceString(property.GetCustomAttribute()?.Description ?? property.Name); - - public string Category { get; set; } = GetResourceString(property.GetCustomAttribute()?.Category ?? Resources.Other); - - private static string GetResourceString(string key) - { - var str = !string.IsNullOrEmpty(key) ? Resources.ResourceManager.GetString(key) : null; - return string.IsNullOrEmpty(key) || string.IsNullOrEmpty(str) ? key : str; - } - } -} diff --git a/ILSpy/Options/DisplaySettings.cs b/ILSpy/Options/DisplaySettings.cs deleted file mode 100644 index a65748446..000000000 --- a/ILSpy/Options/DisplaySettings.cs +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System.Windows.Media; -using System.Xml.Linq; - -using ICSharpCode.ILSpyX.Settings; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpy.Options -{ - /// - /// Description of DisplaySettings. - /// - public class DisplaySettings : ObservableObjectBase, ISettingsSection - { - FontFamily selectedFont; - public FontFamily SelectedFont { - get => selectedFont; - set => SetProperty(ref selectedFont, value); - } - - double selectedFontSize; - public double SelectedFontSize { - get => selectedFontSize; - set => SetProperty(ref selectedFontSize, value); - } - - bool showLineNumbers; - public bool ShowLineNumbers { - get => showLineNumbers; - set => SetProperty(ref showLineNumbers, value); - } - - bool showMetadataTokens; - public bool ShowMetadataTokens { - get => showMetadataTokens; - set => SetProperty(ref showMetadataTokens, value); - } - - bool showMetadataTokensInBase10; - public bool ShowMetadataTokensInBase10 { - get => showMetadataTokensInBase10; - set => SetProperty(ref showMetadataTokensInBase10, value); - } - - bool enableWordWrap; - public bool EnableWordWrap { - get => enableWordWrap; - set => SetProperty(ref enableWordWrap, value); - } - - bool sortResults; - public bool SortResults { - get => sortResults; - set => SetProperty(ref sortResults, value); - } - - bool foldBraces; - public bool FoldBraces { - get => foldBraces; - set => SetProperty(ref foldBraces, value); - } - - bool expandMemberDefinitions; - public bool ExpandMemberDefinitions { - get => expandMemberDefinitions; - set => SetProperty(ref expandMemberDefinitions, value); - } - - bool expandUsingDeclarations; - public bool ExpandUsingDeclarations { - get => expandUsingDeclarations; - set => SetProperty(ref expandUsingDeclarations, value); - } - - bool showDebugInfo; - public bool ShowDebugInfo { - get => showDebugInfo; - set => SetProperty(ref showDebugInfo, value); - } - - bool indentationUseTabs; - public bool IndentationUseTabs { - get => indentationUseTabs; - set => SetProperty(ref indentationUseTabs, value); - } - - int indentationTabSize; - public int IndentationTabSize { - get => indentationTabSize; - set => SetProperty(ref indentationTabSize, value); - } - - int indentationSize; - public int IndentationSize { - get => indentationSize; - set => SetProperty(ref indentationSize, value); - } - - bool highlightMatchingBraces; - public bool HighlightMatchingBraces { - get => highlightMatchingBraces; - set => SetProperty(ref highlightMatchingBraces, value); - } - - bool highlightCurrentLine; - public bool HighlightCurrentLine { - get => highlightCurrentLine; - set => SetProperty(ref highlightCurrentLine, value); - } - - bool hideEmptyMetadataTables; - public bool HideEmptyMetadataTables { - get => hideEmptyMetadataTables; - set => SetProperty(ref hideEmptyMetadataTables, value); - } - - bool useNestedNamespaceNodes; - public bool UseNestedNamespaceNodes { - get => useNestedNamespaceNodes; - set => SetProperty(ref useNestedNamespaceNodes, value); - } - - private bool styleWindowTitleBar; - public bool StyleWindowTitleBar { - get => styleWindowTitleBar; - set => SetProperty(ref styleWindowTitleBar, value); - } - - private bool showRawOffsetsAndBytesBeforeInstruction; - public bool ShowRawOffsetsAndBytesBeforeInstruction { - get => showRawOffsetsAndBytesBeforeInstruction; - set => SetProperty(ref showRawOffsetsAndBytesBeforeInstruction, value); - } - - private bool enableSmoothScrolling; - public bool EnableSmoothScrolling { - get => enableSmoothScrolling; - set => SetProperty(ref enableSmoothScrolling, value); - } - - private bool decodeCustomAttributeBlobs; - public bool DecodeCustomAttributeBlobs { - get => decodeCustomAttributeBlobs; - set => SetProperty(ref decodeCustomAttributeBlobs, value); - } - - public XName SectionName => "DisplaySettings"; - - public void LoadFromXml(XElement section) - { - SelectedFont = new FontFamily((string)section.Attribute("Font") ?? "Consolas"); - SelectedFontSize = (double?)section.Attribute("FontSize") ?? 10.0 * 4 / 3; - ShowLineNumbers = (bool?)section.Attribute("ShowLineNumbers") ?? false; - ShowMetadataTokens = (bool?)section.Attribute("ShowMetadataTokens") ?? false; - ShowMetadataTokensInBase10 = (bool?)section.Attribute("ShowMetadataTokensInBase10") ?? false; - ShowDebugInfo = (bool?)section.Attribute("ShowDebugInfo") ?? false; - EnableWordWrap = (bool?)section.Attribute("EnableWordWrap") ?? false; - SortResults = (bool?)section.Attribute("SortResults") ?? true; - FoldBraces = (bool?)section.Attribute("FoldBraces") ?? false; - ExpandMemberDefinitions = (bool?)section.Attribute("ExpandMemberDefinitions") ?? false; - ExpandUsingDeclarations = (bool?)section.Attribute("ExpandUsingDeclarations") ?? false; - IndentationUseTabs = (bool?)section.Attribute("IndentationUseTabs") ?? true; - IndentationSize = (int?)section.Attribute("IndentationSize") ?? 4; - IndentationTabSize = (int?)section.Attribute("IndentationTabSize") ?? 4; - HighlightMatchingBraces = (bool?)section.Attribute("HighlightMatchingBraces") ?? true; - HighlightCurrentLine = (bool?)section.Attribute("HighlightCurrentLine") ?? false; - HideEmptyMetadataTables = (bool?)section.Attribute("HideEmptyMetadataTables") ?? true; - UseNestedNamespaceNodes = (bool?)section.Attribute("UseNestedNamespaceNodes") ?? false; - ShowRawOffsetsAndBytesBeforeInstruction = (bool?)section.Attribute("ShowRawOffsetsAndBytesBeforeInstruction") ?? false; - StyleWindowTitleBar = (bool?)section.Attribute("StyleWindowTitleBar") ?? false; - EnableSmoothScrolling = (bool?)section.Attribute("EnableSmoothScrolling") ?? true; - DecodeCustomAttributeBlobs = (bool?)section.Attribute("DecodeCustomAttributeBlobs") ?? false; - } - - public XElement SaveToXml() - { - var section = new XElement(SectionName); - - section.SetAttributeValue("Font", SelectedFont.Source); - section.SetAttributeValue("FontSize", SelectedFontSize); - section.SetAttributeValue("ShowLineNumbers", ShowLineNumbers); - section.SetAttributeValue("ShowMetadataTokens", ShowMetadataTokens); - section.SetAttributeValue("ShowMetadataTokensInBase10", ShowMetadataTokensInBase10); - section.SetAttributeValue("ShowDebugInfo", ShowDebugInfo); - section.SetAttributeValue("EnableWordWrap", EnableWordWrap); - section.SetAttributeValue("SortResults", SortResults); - section.SetAttributeValue("FoldBraces", FoldBraces); - section.SetAttributeValue("ExpandMemberDefinitions", ExpandMemberDefinitions); - section.SetAttributeValue("ExpandUsingDeclarations", ExpandUsingDeclarations); - section.SetAttributeValue("IndentationUseTabs", IndentationUseTabs); - section.SetAttributeValue("IndentationSize", IndentationSize); - section.SetAttributeValue("IndentationTabSize", IndentationTabSize); - section.SetAttributeValue("HighlightMatchingBraces", HighlightMatchingBraces); - section.SetAttributeValue("HighlightCurrentLine", HighlightCurrentLine); - section.SetAttributeValue("HideEmptyMetadataTables", HideEmptyMetadataTables); - section.SetAttributeValue("UseNestedNamespaceNodes", UseNestedNamespaceNodes); - section.SetAttributeValue("ShowRawOffsetsAndBytesBeforeInstruction", ShowRawOffsetsAndBytesBeforeInstruction); - section.SetAttributeValue("StyleWindowTitleBar", StyleWindowTitleBar); - section.SetAttributeValue("EnableSmoothScrolling", EnableSmoothScrolling); - section.SetAttributeValue("DecodeCustomAttributeBlobs", DecodeCustomAttributeBlobs); - - return section; - } - } -} diff --git a/ILSpy/Options/DisplaySettingsPanel.xaml b/ILSpy/Options/DisplaySettingsPanel.xaml deleted file mode 100644 index 58c7ae316..000000000 --- a/ILSpy/Options/DisplaySettingsPanel.xaml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ILSpy/Options/DisplaySettingsPanel.xaml.cs b/ILSpy/Options/DisplaySettingsPanel.xaml.cs deleted file mode 100644 index ed3fa46c9..000000000 --- a/ILSpy/Options/DisplaySettingsPanel.xaml.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Composition; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Media; -using System.Windows.Threading; -using System.Xml.Linq; - -using ICSharpCode.ILSpyX.Settings; - -using TomsToolbox.Wpf.Composition.AttributedModel; -using TomsToolbox.Wpf.Converters; - -namespace ICSharpCode.ILSpy.Options -{ - /// - /// Interaction logic for DisplaySettingsPanel.xaml - /// - [NonShared] - [DataTemplate(typeof(DisplaySettingsViewModel))] - public partial class DisplaySettingsPanel - { - public DisplaySettingsPanel() - { - InitializeComponent(); - - DataObject.AddPastingHandler(tabSizeTextBox, OnPaste); - DataObject.AddPastingHandler(indentSizeTextBox, OnPaste); - } - - private void TextBox_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e) - { - if (!e.Text.All(char.IsDigit)) - e.Handled = true; - } - - private static void OnPaste(object sender, DataObjectPastingEventArgs e) - { - if (!e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true)) - return; - - var text = (string)e.SourceDataObject.GetData(DataFormats.UnicodeText, true) ?? string.Empty; - - if (!text.All(char.IsDigit)) - e.CancelCommand(); - } - } - - public sealed class FontSizeConverter : ValueConverter - { - protected override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - if (value is double d) - { - return Math.Round(d / 4 * 3); - } - - return DependencyProperty.UnsetValue; - } - - protected override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - if (value is not string s) - return DependencyProperty.UnsetValue; - - if (double.TryParse(s, out double d)) - return d * 4 / 3; - - return 11.0 * 4 / 3; - } - } -} \ No newline at end of file diff --git a/ILSpy/Options/DisplaySettingsViewModel.cs b/ILSpy/Options/DisplaySettingsViewModel.cs deleted file mode 100644 index ec581b18d..000000000 --- a/ILSpy/Options/DisplaySettingsViewModel.cs +++ /dev/null @@ -1,94 +0,0 @@ -using ICSharpCode.ILSpyX.Settings; -using System.Windows.Media; -using System.Xml.Linq; -using System; -using System.Composition; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -using TomsToolbox.Wpf; -using ICSharpCode.ILSpy.Themes; - -namespace ICSharpCode.ILSpy.Options -{ - [ExportOptionPage(Order = 20)] - [NonShared] - public class DisplaySettingsViewModel : ObservableObjectBase, IOptionPage - { - private DisplaySettings settings = new(); - private FontFamily[] fontFamilies; - private SessionSettings sessionSettings; - - public DisplaySettingsViewModel() - { - fontFamilies = [settings.SelectedFont]; - - Task.Run(FontLoader).ContinueWith(continuation => { - FontFamilies = continuation.Result; - if (continuation.Exception == null) - return; - foreach (var ex in continuation.Exception.InnerExceptions) - { - MessageBox.Show(ex.ToString()); - } - }); - } - - public string Title => Properties.Resources.Display; - - public DisplaySettings Settings { - get => settings; - set => SetProperty(ref settings, value); - } - - public SessionSettings SessionSettings { - get => sessionSettings; - set => SetProperty(ref sessionSettings, value); - } - - public FontFamily[] FontFamilies { - get => fontFamilies; - set => SetProperty(ref fontFamilies, value); - } - - public int[] FontSizes { get; } = Enumerable.Range(6, 24 - 6 + 1).ToArray(); - - public void Load(SettingsSnapshot snapshot) - { - Settings = snapshot.GetSettings(); - SessionSettings = snapshot.GetSettings(); - } - - static bool IsSymbolFont(FontFamily fontFamily) - { - foreach (var tf in fontFamily.GetTypefaces()) - { - try - { - if (tf.TryGetGlyphTypeface(out GlyphTypeface glyph)) - return glyph.Symbol; - } - catch (Exception) - { - return true; - } - } - return false; - } - - static FontFamily[] FontLoader() - { - return Fonts.SystemFontFamilies - .Where(ff => !IsSymbolFont(ff)) - .OrderBy(ff => ff.Source) - .ToArray(); - } - - public void LoadDefaults() - { - Settings.LoadFromXml(new XElement("empty")); - SessionSettings.Theme = ThemeManager.Current.DefaultTheme; - } - } -} diff --git a/ILSpy/Options/ExportOptionPageAttribute.cs b/ILSpy/Options/ExportOptionPageAttribute.cs deleted file mode 100644 index 394c76f55..000000000 --- a/ILSpy/Options/ExportOptionPageAttribute.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Composition; - -namespace ICSharpCode.ILSpy.Options -{ - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class)] - public sealed class ExportOptionPageAttribute() : ExportAttribute("OptionPages", typeof(IOptionPage)), IOptionsMetadata - { - public int Order { get; set; } - } -} \ No newline at end of file diff --git a/ILSpy/Options/IOptionPage.cs b/ILSpy/Options/IOptionPage.cs deleted file mode 100644 index c7b1b931a..000000000 --- a/ILSpy/Options/IOptionPage.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -namespace ICSharpCode.ILSpy.Options -{ - public interface IOptionPage - { - string Title { get; } - - void Load(SettingsSnapshot settings); - - void LoadDefaults(); - } -} \ No newline at end of file diff --git a/ILSpy/Options/IOptionsMetadata.cs b/ILSpy/Options/IOptionsMetadata.cs deleted file mode 100644 index 98a3af20b..000000000 --- a/ILSpy/Options/IOptionsMetadata.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -namespace ICSharpCode.ILSpy.Options -{ - public interface IOptionsMetadata - { - int Order { get; } - } -} \ No newline at end of file diff --git a/ILSpy/Options/MiscSettings.cs b/ILSpy/Options/MiscSettings.cs deleted file mode 100644 index 32a1597c3..000000000 --- a/ILSpy/Options/MiscSettings.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2022 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Xml.Linq; - -using TomsToolbox.Wpf; - -namespace ICSharpCode.ILSpyX.Settings -{ - public class MiscSettings : ObservableObjectBase, ISettingsSection - { - private bool allowMultipleInstances; - private bool loadPreviousAssemblies = true; - - public bool AllowMultipleInstances { - get => allowMultipleInstances; - set => SetProperty(ref allowMultipleInstances, value); - } - - public bool LoadPreviousAssemblies { - get => loadPreviousAssemblies; - set => SetProperty(ref loadPreviousAssemblies, value); - } - - public XName SectionName => "MiscSettings"; - - public void LoadFromXml(XElement e) - { - AllowMultipleInstances = (bool?)e.Attribute(nameof(AllowMultipleInstances)) ?? false; - LoadPreviousAssemblies = (bool?)e.Attribute(nameof(LoadPreviousAssemblies)) ?? true; - } - - public XElement SaveToXml() - { - var section = new XElement(SectionName); - - section.SetAttributeValue(nameof(AllowMultipleInstances), AllowMultipleInstances); - section.SetAttributeValue(nameof(LoadPreviousAssemblies), LoadPreviousAssemblies); - - return section; - } - } -} - diff --git a/ILSpy/Options/MiscSettingsPanel.xaml b/ILSpy/Options/MiscSettingsPanel.xaml deleted file mode 100644 index 23e0bf231..000000000 --- a/ILSpy/Options/MiscSettingsPanel.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - -