Browse Source

Annotate service lifetime explicitly.

pull/3257/head
tom-englert 10 months ago
parent
commit
610b0c2ed5
  1. 7
      .editorconfig
  2. 6
      Directory.Packages.props
  3. 1
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.ruleset
  4. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs
  5. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/EventImplementedByAnalyzer.cs
  6. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/EventOverriddenByAnalyzer.cs
  7. 3
      ICSharpCode.ILSpyX/Analyzers/Builtin/FieldAccessAnalyzer.cs
  8. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs
  9. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/MethodImplementedByAnalyzer.cs
  10. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs
  11. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsedByAnalyzer.cs
  12. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsesAnalyzer.cs
  13. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs
  14. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs
  15. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs
  16. 3
      ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExposedByAnalyzer.cs
  17. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs
  18. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs
  19. 2
      ICSharpCode.ILSpyX/Analyzers/Builtin/TypeUsedByAnalyzer.cs
  20. 2
      ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs
  21. 1
      ILSpy.ReadyToRun/ReadyToRunLanguage.cs
  22. 2
      ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs
  23. 2
      ILSpy/AboutPage.cs
  24. 2
      ILSpy/Analyzers/AnalyzeCommand.cs
  25. 2
      ILSpy/Analyzers/CopyAnalysisResultsContextMenuEntry.cs
  26. 2
      ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs
  27. 2
      ILSpy/Commands/BrowseBackCommand.cs
  28. 2
      ILSpy/Commands/BrowseForwardCommand.cs
  29. 3
      ILSpy/Commands/CheckForUpdatesCommand.cs
  30. 2
      ILSpy/Commands/CopyFullyQualifiedNameContextMenuEntry.cs
  31. 3
      ILSpy/Commands/DecompileAllCommand.cs
  32. 2
      ILSpy/Commands/DecompileCommand.cs
  33. 2
      ILSpy/Commands/DecompileInNewViewCommand.cs
  34. 2
      ILSpy/Commands/DisassembleAllCommand.cs
  35. 3
      ILSpy/Commands/ExitCommand.cs
  36. 2
      ILSpy/Commands/ExtractPackageEntryContextMenuEntry.cs
  37. 3
      ILSpy/Commands/GeneratePdbContextMenuEntry.cs
  38. 3
      ILSpy/Commands/ManageAssemblyListsCommand.cs
  39. 2
      ILSpy/Commands/OpenCommand.cs
  40. 3
      ILSpy/Commands/OpenFromGacCommand.cs
  41. 3
      ILSpy/Commands/Pdb2XmlCommand.cs
  42. 2
      ILSpy/Commands/RefreshCommand.cs
  43. 3
      ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs
  44. 2
      ILSpy/Commands/SaveCodeContextMenuEntry.cs
  45. 2
      ILSpy/Commands/SaveCommand.cs
  46. 2
      ILSpy/Commands/ScopeSearchToAssembly.cs
  47. 2
      ILSpy/Commands/ScopeSearchToNamespace.cs
  48. 3
      ILSpy/Commands/SearchMsdnContextMenuEntry.cs
  49. 2
      ILSpy/Commands/SelectPdbContextMenuEntry.cs
  50. 2
      ILSpy/Commands/ShowCFGContextMenuEntry.cs
  51. 3
      ILSpy/Commands/SortAssemblyListCommand.cs
  52. 3
      ILSpy/Docking/CloseAllDocumentsCommand.cs
  53. 7
      ILSpy/ExportProviderAdapter.cs
  54. 5
      ILSpy/ILSpy.csproj
  55. 1
      ILSpy/Languages/CSharpILMixedLanguage.cs
  56. 1
      ILSpy/Languages/CSharpLanguage.cs
  57. 1
      ILSpy/Languages/ILLanguage.cs
  58. 3
      ILSpy/Metadata/GoToTokenCommand.cs
  59. 1
      ILSpy/Metadata/MetadataProtocolHandler.cs
  60. 2
      ILSpy/Options/DecompilerSettingsPanel.xaml.cs
  61. 2
      ILSpy/Options/DisplaySettingsPanel.xaml.cs
  62. 2
      ILSpy/Options/MiscSettingsPanel.xaml.cs
  63. 1
      ILSpy/Options/OptionsDialog.xaml.cs
  64. 2
      ILSpy/Search/SearchPane.cs
  65. 4
      ILSpy/TextView/EditorCommands.cs
  66. 3
      ILSpy/TextView/FoldingCommands.cs
  67. 7
      ILSpy/TreeNodes/AssemblyTreeNode.cs
  68. 1
      ILSpy/TreeNodes/ResourceNodes/CursorResourceEntryNode.cs
  69. 1
      ILSpy/TreeNodes/ResourceNodes/IconResourceEntryNode.cs
  70. 1
      ILSpy/TreeNodes/ResourceNodes/ImageListResourceEntryNode.cs
  71. 1
      ILSpy/TreeNodes/ResourceNodes/ImageResourceEntryNode.cs
  72. 1
      ILSpy/TreeNodes/ResourceNodes/ResourcesFileTreeNode.cs
  73. 1
      ILSpy/TreeNodes/ResourceNodes/XamlResourceNode.cs
  74. 1
      ILSpy/TreeNodes/ResourceNodes/XmlResourceNode.cs
  75. 2
      ILSpy/TreeNodes/ThreadingSupport.cs
  76. 4
      ILSpy/ViewModels/AnalyzerPaneModel.cs
  77. 4
      ILSpy/ViewModels/AssemblyListPaneModel.cs
  78. 4
      ILSpy/ViewModels/DebugStepsPaneModel.cs
  79. 4
      ILSpy/ViewModels/SearchPaneModel.cs
  80. 1
      TestPlugin/AboutPageAddition.cs
  81. 2
      TestPlugin/ContextMenuCommand.cs
  82. 1
      TestPlugin/CustomLanguage.cs
  83. 2
      TestPlugin/CustomOptionPage.xaml.cs
  84. 3
      TestPlugin/MainMenuCommand.cs

7
.editorconfig

@ -12,7 +12,7 @@ indent_size = 2 @@ -12,7 +12,7 @@ indent_size = 2
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.csproj]
[*.{csproj,props}]
indent_style = space
indent_size = 2
[*.config]
@ -119,3 +119,8 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false @@ -119,3 +119,8 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Errors and warnings
# MEF006: No importing constructor
dotnet_diagnostic.MEF006.severity = silent

6
Directory.Packages.props

@ -45,9 +45,11 @@ @@ -45,9 +45,11 @@
<PackageVersion Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="TomsToolbox.Composition.Analyzer" Version="2.18.1" />
<PackageVersion Include="TomsToolbox.Wpf.Composition" Version="2.18.1" />
<PackageVersion Include="TomsToolbox.Wpf.Styles" Version="2.18.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="TomsToolbox.Composition.Analyzer" Version="2.18.1" />
</ItemGroup>
</Project>

1
ICSharpCode.Decompiler/ICSharpCode.Decompiler.ruleset

@ -80,7 +80,6 @@ @@ -80,7 +80,6 @@
<Rule Id="RECS0001" Action="Info" />
</Rules>
<Rules AnalyzerId="TomsToolbox.Composition.Analyzer" RuleNamespace="TomsToolbox.Composition.Analyzer">
<Rule Id="MEF001" Action="Info" />
<Rule Id="MEF006" Action="Hidden" />
</Rules>
</RuleSet>

2
ICSharpCode.ILSpyX/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Reflection.Metadata;
using System.Threading;
@ -29,6 +30,7 @@ using ICSharpCode.Decompiler.Util; @@ -29,6 +30,7 @@ using ICSharpCode.Decompiler.Util;
namespace ICSharpCode.ILSpyX.Analyzers.Builtin
{
[ExportAnalyzer(Header = "Applied To", Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class AttributeAppliedToAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

2
ICSharpCode.ILSpyX/Analyzers/Builtin/EventImplementedByAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows events that implement an interface event.
/// </summary>
[ExportAnalyzer(Header = "Implemented By", Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class EventImplementedByAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

2
ICSharpCode.ILSpyX/Analyzers/Builtin/EventOverriddenByAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows events that override an event.
/// </summary>
[ExportAnalyzer(Header = "Overridden By", Order = 20)]
[PartCreationPolicy(CreationPolicy.Shared)]
class EventOverriddenByAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

3
ICSharpCode.ILSpyX/Analyzers/Builtin/FieldAccessAnalyzer.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
@ -35,6 +36,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -35,6 +36,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Finds methods where this field is read.
/// </summary>
[ExportAnalyzer(Header = "Assigned By", Order = 20)]
[PartCreationPolicy(CreationPolicy.Shared)]
class AssignedByFieldAccessAnalyzer : FieldAccessAnalyzer
{
public AssignedByFieldAccessAnalyzer() : base(true) { }
@ -44,6 +46,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -44,6 +46,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Finds methods where this field is written.
/// </summary>
[ExportAnalyzer(Header = "Read By", Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class ReadByFieldAccessAnalyzer : FieldAccessAnalyzer
{
public ReadByFieldAccessAnalyzer() : base(false) { }

2
ICSharpCode.ILSpyX/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows members from all corresponding interfaces the selected member implements.
/// </summary>
[ExportAnalyzer(Header = "Implements", Order = 40)]
[PartCreationPolicy(CreationPolicy.Shared)]
class MemberImplementsInterfaceAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

2
ICSharpCode.ILSpyX/Analyzers/Builtin/MethodImplementedByAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows methods that implement an interface method.
/// </summary>
[ExportAnalyzer(Header = "Implemented By", Order = 40)]
[PartCreationPolicy(CreationPolicy.Shared)]
class MethodImplementedByAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

2
ICSharpCode.ILSpyX/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows methods that override a method.
/// </summary>
[ExportAnalyzer(Header = "Overridden By", Order = 30)]
[PartCreationPolicy(CreationPolicy.Shared)]
class MethodOverriddenByAnalyzer : IAnalyzer
{
const GetMemberOptions Options = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

2
ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsedByAnalyzer.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
@ -32,6 +33,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -32,6 +33,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows entities that are used by a method.
/// </summary>
[ExportAnalyzer(Header = "Used By", Order = 20)]
[PartCreationPolicy(CreationPolicy.Shared)]
class MethodUsedByAnalyzer : IAnalyzer
{
const GetMemberOptions Options = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

2
ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsesAnalyzer.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Reflection.Metadata;
@ -32,6 +33,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -32,6 +33,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows entities that are used by a method.
/// </summary>
[ExportAnalyzer(Header = "Uses", Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class MethodUsesAnalyzer : IAnalyzer
{
public bool Show(ISymbol symbol) => symbol is IMethod method && method.HasBody;

2
ICSharpCode.ILSpyX/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
@ -31,6 +32,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -31,6 +32,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows entities that are used by a method.
/// </summary>
[ExportAnalyzer(Header = "Used By", Order = 20)]
[PartCreationPolicy(CreationPolicy.Shared)]
class MethodVirtualUsedByAnalyzer : IAnalyzer
{
const GetMemberOptions Options = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

2
ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows properties that implement an interface property.
/// </summary>
[ExportAnalyzer(Header = "Implemented By", Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class PropertyImplementedByAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

2
ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -28,6 +29,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows properties that override a property.
/// </summary>
[ExportAnalyzer(Header = "Overridden By", Order = 20)]
[PartCreationPolicy(CreationPolicy.Shared)]
class PropertyOverriddenByAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

3
ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExposedByAnalyzer.cs

@ -22,12 +22,15 @@ using System.Diagnostics; @@ -22,12 +22,15 @@ using System.Diagnostics;
namespace ICSharpCode.ILSpyX.Analyzers.Builtin
{
using System.ComponentModel.Composition;
using ICSharpCode.Decompiler.TypeSystem;
/// <summary>
/// Finds all entities that expose a type.
/// </summary>
[ExportAnalyzer(Header = "Exposed By", Order = 40)]
[PartCreationPolicy(CreationPolicy.Shared)]
class TypeExposedByAnalyzer : IAnalyzer
{
public bool Show(ISymbol entity) => entity is ITypeDefinition;

2
ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using ICSharpCode.Decompiler.TypeSystem;
@ -27,6 +28,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -27,6 +28,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Finds all extension methods defined for a type.
/// </summary>
[ExportAnalyzer(Header = "Extension Methods", Order = 50)]
[PartCreationPolicy(CreationPolicy.Shared)]
class TypeExtensionMethodsAnalyzer : IAnalyzer
{
public bool Show(ISymbol symbol) => symbol is ITypeDefinition entity && !entity.IsStatic;

2
ICSharpCode.ILSpyX/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
@ -33,6 +34,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -33,6 +34,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows methods that instantiate a type.
/// </summary>
[ExportAnalyzer(Header = "Instantiated By", Order = 20)]
[PartCreationPolicy(CreationPolicy.Shared)]
class TypeInstantiatedByAnalyzer : IAnalyzer
{
const GetMemberOptions Options = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

2
ICSharpCode.ILSpyX/Analyzers/Builtin/TypeUsedByAnalyzer.cs

@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
@ -34,6 +35,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin @@ -34,6 +35,7 @@ namespace ICSharpCode.ILSpyX.Analyzers.Builtin
/// Shows entities that use a type.
/// </summary>
[ExportAnalyzer(Header = "Used By", Order = 30)]
[PartCreationPolicy(CreationPolicy.Shared)]
class TypeUsedByAnalyzer : IAnalyzer
{
public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context)

2
ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs

@ -32,6 +32,7 @@ using ICSharpCode.ILSpyX.Abstractions; @@ -32,6 +32,7 @@ using ICSharpCode.ILSpyX.Abstractions;
namespace ILSpy.BamlDecompiler
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
public sealed class BamlResourceNodeFactory : IResourceNodeFactory
{
public ITreeNode CreateNode(Resource resource)
@ -44,6 +45,7 @@ namespace ILSpy.BamlDecompiler @@ -44,6 +45,7 @@ namespace ILSpy.BamlDecompiler
}
[Export(typeof(IResourceFileHandler))]
[PartCreationPolicy(CreationPolicy.Shared)]
public sealed class BamlResourceFileHandler : IResourceFileHandler
{
public string EntryType => "Page";

1
ILSpy.ReadyToRun/ReadyToRunLanguage.cs

@ -95,6 +95,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun @@ -95,6 +95,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun
#endif
[Export(typeof(Language))]
[PartCreationPolicy(CreationPolicy.Shared)]
internal class ReadyToRunLanguage : Language
{
private static readonly ConditionalWeakTable<MetadataFile, ReadyToRunReaderCacheEntry> readyToRunReaders = new ConditionalWeakTable<MetadataFile, ReadyToRunReaderCacheEntry>();

2
ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Windows.Controls;
using System.Xml.Linq;
@ -26,6 +27,7 @@ using ICSharpCode.ILSpyX.Settings; @@ -26,6 +27,7 @@ using ICSharpCode.ILSpyX.Settings;
namespace ICSharpCode.ILSpy.ReadyToRun
{
[ExportOptionPage(Title = nameof(global::ILSpy.ReadyToRun.Properties.Resources.ReadyToRun), Order = 40)]
[PartCreationPolicy(CreationPolicy.NonShared)]
partial class ReadyToRunOptionPage : UserControl, IOptionPage
{
public ReadyToRunOptionPage()

2
ILSpy/AboutPage.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel.Composition;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows;
@ -36,6 +37,7 @@ using ICSharpCode.ILSpyX.Settings; @@ -36,6 +37,7 @@ using ICSharpCode.ILSpyX.Settings;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._Help), Header = nameof(Resources._About), MenuOrder = 99999)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class AboutPage : SimpleCommand
{
public override void Execute(object parameter)

2
ILSpy/Analyzers/AnalyzeCommand.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel.Composition;
using System.Linq;
using ICSharpCode.Decompiler.Metadata;
@ -27,6 +28,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -27,6 +28,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy.Analyzers
{
[ExportContextMenuEntry(Header = nameof(Resources.Analyze), Icon = "Images/Search", Category = nameof(Resources.Analyze), InputGestureText = "Ctrl+R", Order = 100)]
[PartCreationPolicy(CreationPolicy.Shared)]
internal sealed class AnalyzeCommand : SimpleCommand, IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

2
ILSpy/Analyzers/CopyAnalysisResultsContextMenuEntry.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Windows;
@ -23,6 +24,7 @@ using System.Windows; @@ -23,6 +24,7 @@ using System.Windows;
namespace ICSharpCode.ILSpy.Analyzers
{
[ExportContextMenuEntry(Header = "Copy results", Category = "Analyze", Order = 200)]
[PartCreationPolicy(CreationPolicy.Shared)]
internal sealed class CopyAnalysisResultsContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

2
ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs

@ -16,11 +16,13 @@ @@ -16,11 +16,13 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Linq;
namespace ICSharpCode.ILSpy.Analyzers
{
[ExportContextMenuEntry(Header = "Remove", Icon = "images/Delete", Category = "Analyze", Order = 200)]
[PartCreationPolicy(CreationPolicy.Shared)]
internal sealed class RemoveAnalyzeContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

2
ILSpy/Commands/BrowseBackCommand.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows.Input;
using ICSharpCode.ILSpy.Properties;
@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties; @@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy
{
[ExportToolbarCommand(ToolTip = nameof(Resources.Back), ToolbarIcon = "Images/Back", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 0)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class BrowseBackCommand : CommandWrapper
{
public BrowseBackCommand()

2
ILSpy/Commands/BrowseForwardCommand.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows.Input;
using ICSharpCode.ILSpy.Properties;
@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties; @@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy
{
[ExportToolbarCommand(ToolTip = nameof(Resources.Forward), ToolbarIcon = "Images/Forward", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 1)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class BrowseForwardCommand : CommandWrapper
{
public BrowseForwardCommand()

3
ILSpy/Commands/CheckForUpdatesCommand.cs

@ -17,12 +17,15 @@ @@ -17,12 +17,15 @@
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpyX.Settings;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._Help), Header = nameof(Resources._CheckUpdates), MenuOrder = 5000)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class CheckForUpdatesCommand : SimpleCommand
{
public override bool CanExecute(object parameter)

2
ILSpy/Commands/CopyFullyQualifiedNameContextMenuEntry.cs

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
// 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.Composition;
using System.Windows;
using ICSharpCode.ILSpy.Properties;
@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy
{
[ExportContextMenuEntry(Header = nameof(Resources.CopyName), Icon = "images/Copy", Order = 9999)]
[PartCreationPolicy(CreationPolicy.Shared)]
public class CopyFullyQualifiedNameContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

3
ILSpy/Commands/DecompileAllCommand.cs

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
using System;
using System.Collections.Concurrent;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
@ -34,6 +35,7 @@ using TomsToolbox.Essentials; @@ -34,6 +35,7 @@ using TomsToolbox.Essentials;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDecompile), MenuCategory = nameof(Resources.Open), MenuOrder = 2.5)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class DecompileAllCommand : SimpleCommand
{
public override bool CanExecute(object parameter)
@ -86,6 +88,7 @@ namespace ICSharpCode.ILSpy @@ -86,6 +88,7 @@ namespace ICSharpCode.ILSpy
}
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDecompile100x), MenuCategory = nameof(Resources.Open), MenuOrder = 2.6)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class Decompile100TimesCommand : SimpleCommand
{
public override void Execute(object parameter)

2
ILSpy/Commands/DecompileCommand.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Linq;
using ICSharpCode.Decompiler.TypeSystem;
@ -25,6 +26,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -25,6 +26,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy.Commands
{
[ExportContextMenuEntry(Header = nameof(Resources.Decompile), Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class DecompileCommand : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

2
ILSpy/Commands/DecompileInNewViewCommand.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Windows.Threading;
@ -30,6 +31,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -30,6 +31,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy.Commands
{
[ExportContextMenuEntry(Header = nameof(Resources.DecompileToNewPanel), InputGestureText = "MMB", Icon = "images/Search", Category = nameof(Resources.Analyze), Order = 90)]
[PartCreationPolicy(CreationPolicy.Shared)]
internal sealed class DecompileInNewViewCommand : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

2
ILSpy/Commands/DisassembleAllCommand.cs

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
using System;
using System.Collections.Concurrent;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Threading.Tasks;
@ -30,6 +31,7 @@ using ICSharpCode.ILSpyX; @@ -30,6 +31,7 @@ using ICSharpCode.ILSpyX;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDisassemble), MenuCategory = nameof(Resources.Open), MenuOrder = 2.5)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class DisassembleAllCommand : SimpleCommand
{
public override bool CanExecute(object parameter)

3
ILSpy/Commands/ExitCommand.cs

@ -15,11 +15,14 @@ @@ -15,11 +15,14 @@
// 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.Composition;
using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.E_xit), MenuOrder = 99999, MenuCategory = nameof(Resources.Exit))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ExitCommand : SimpleCommand
{
public override void Execute(object parameter)

2
ILSpy/Commands/ExtractPackageEntryContextMenuEntry.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.IO;
using System.Linq;
@ -34,6 +35,7 @@ using Microsoft.Win32; @@ -34,6 +35,7 @@ using Microsoft.Win32;
namespace ICSharpCode.ILSpy
{
[ExportContextMenuEntry(Header = nameof(Resources.ExtractPackageEntry), Category = nameof(Resources.Save), Icon = "Images/Save")]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ExtractPackageEntryContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)

3
ILSpy/Commands/GeneratePdbContextMenuEntry.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.IO;
using System.Linq;
@ -38,6 +39,7 @@ using Microsoft.Win32; @@ -38,6 +39,7 @@ using Microsoft.Win32;
namespace ICSharpCode.ILSpy
{
[ExportContextMenuEntry(Header = nameof(Resources.GeneratePortable))]
[PartCreationPolicy(CreationPolicy.Shared)]
class GeneratePdbContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)
@ -103,6 +105,7 @@ namespace ICSharpCode.ILSpy @@ -103,6 +105,7 @@ namespace ICSharpCode.ILSpy
}
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.GeneratePortable), MenuCategory = nameof(Resources.Save))]
[PartCreationPolicy(CreationPolicy.Shared)]
class GeneratePdbMainMenuEntry : SimpleCommand
{
public override bool CanExecute(object parameter)

3
ILSpy/Commands/ManageAssemblyListsCommand.cs

@ -17,11 +17,14 @@ @@ -17,11 +17,14 @@
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
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)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ManageAssemblyListsCommand : SimpleCommand
{
public override void Execute(object parameter)

2
ILSpy/Commands/OpenCommand.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows.Input;
using ICSharpCode.ILSpy.Properties;
@ -24,6 +25,7 @@ namespace ICSharpCode.ILSpy @@ -24,6 +25,7 @@ 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)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class OpenCommand : CommandWrapper
{
public OpenCommand()

3
ILSpy/Commands/OpenFromGacCommand.cs

@ -16,12 +16,15 @@ @@ -16,12 +16,15 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using ICSharpCode.ILSpy.AppEnv;
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)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class OpenFromGacCommand : SimpleCommand
{
public override bool CanExecute(object parameter)

3
ILSpy/Commands/Pdb2XmlCommand.cs

@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
#if DEBUG
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@ -34,6 +35,7 @@ using Microsoft.DiaSymReader.Tools; @@ -34,6 +35,7 @@ using Microsoft.DiaSymReader.Tools;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.DEBUGDumpPDBAsXML), MenuCategory = nameof(Resources.Open), MenuOrder = 2.6)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class Pdb2XmlCommand : SimpleCommand
{
public override bool CanExecute(object parameter)
@ -70,6 +72,7 @@ namespace ICSharpCode.ILSpy @@ -70,6 +72,7 @@ namespace ICSharpCode.ILSpy
}
[ExportContextMenuEntry(Header = nameof(Resources.DEBUGDumpPDBAsXML))]
[PartCreationPolicy(CreationPolicy.Shared)]
class Pdb2XmlCommandContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)

2
ILSpy/Commands/RefreshCommand.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows.Input;
using ICSharpCode.ILSpy.Properties;
@ -24,6 +25,7 @@ namespace ICSharpCode.ILSpy @@ -24,6 +25,7 @@ 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)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class RefreshCommand : CommandWrapper
{
public RefreshCommand()

3
ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Linq;
using ICSharpCode.ILSpy.Properties;
@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties; @@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources._RemoveAssembliesWithLoadErrors), MenuCategory = nameof(Resources.Remove), MenuOrder = 2.6)]
[PartCreationPolicy(CreationPolicy.Shared)]
class RemoveAssembliesWithLoadErrors : SimpleCommand
{
public override bool CanExecute(object parameter)
@ -44,6 +46,7 @@ namespace ICSharpCode.ILSpy @@ -44,6 +46,7 @@ namespace ICSharpCode.ILSpy
}
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.ClearAssemblyList), MenuCategory = nameof(Resources.Remove), MenuOrder = 2.6)]
[PartCreationPolicy(CreationPolicy.Shared)]
class ClearAssemblyList : SimpleCommand
{
public override bool CanExecute(object parameter)

2
ILSpy/Commands/SaveCodeContextMenuEntry.cs

@ -30,10 +30,12 @@ using ICSharpCode.ILSpy.ViewModels; @@ -30,10 +30,12 @@ using ICSharpCode.ILSpy.ViewModels;
using Microsoft.Win32;
using ICSharpCode.ILSpyX.TreeView;
using System.ComponentModel.Composition;
namespace ICSharpCode.ILSpy.TextView
{
[ExportContextMenuEntry(Header = nameof(Resources._SaveCode), Category = nameof(Resources.Save), Icon = "Images/Save")]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class SaveCodeContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)

2
ILSpy/Commands/SaveCommand.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows.Input;
using ICSharpCode.ILSpy.Properties;
@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties; @@ -23,6 +24,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources._SaveCode), MenuIcon = "Images/Save", MenuCategory = nameof(Resources.Save), MenuOrder = 0)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class SaveCommand : CommandWrapper
{
public SaveCommand()

2
ILSpy/Commands/ScopeSearchToAssembly.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
#nullable enable
using System;
using System.ComponentModel.Composition;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.AppEnv;
@ -27,6 +28,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -27,6 +28,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy
{
[ExportContextMenuEntry(Header = nameof(Resources.ScopeSearchToThisAssembly), Category = nameof(Resources.Analyze), Order = 9999)]
[PartCreationPolicy(CreationPolicy.Shared)]
public class ScopeSearchToAssembly : IContextMenuEntry
{
public void Execute(TextViewContext context)

2
ILSpy/Commands/ScopeSearchToNamespace.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// 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.Composition;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.AppEnv;
@ -25,6 +26,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -25,6 +26,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy
{
[ExportContextMenuEntry(Header = nameof(Resources.ScopeSearchToThisNamespace), Category = nameof(Resources.Analyze), Order = 9999)]
[PartCreationPolicy(CreationPolicy.Shared)]
public class ScopeSearchToNamespace : IContextMenuEntry
{
public void Execute(TextViewContext context)

3
ILSpy/Commands/SearchMsdnContextMenuEntry.cs

@ -23,9 +23,12 @@ using ICSharpCode.ILSpy.Properties; @@ -23,9 +23,12 @@ using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy
{
using System.ComponentModel.Composition;
using ICSharpCode.Decompiler.TypeSystem;
[ExportContextMenuEntry(Header = nameof(Resources.SearchMSDN), Icon = "images/SearchMsdn", Order = 9999)]
[PartCreationPolicy(CreationPolicy.Shared)]
internal sealed class SearchMsdnContextMenuEntry : IContextMenuEntry
{
private static string msdnAddress = "https://docs.microsoft.com/dotnet/api/{0}";

2
ILSpy/Commands/SelectPdbContextMenuEntry.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
@ -27,6 +28,7 @@ using Microsoft.Win32; @@ -27,6 +28,7 @@ using Microsoft.Win32;
namespace ICSharpCode.ILSpy
{
[ExportContextMenuEntry(Header = nameof(Resources.SelectPDB))]
[PartCreationPolicy(CreationPolicy.Shared)]
class SelectPdbContextMenuEntry : IContextMenuEntry
{
public async void Execute(TextViewContext context)

2
ILSpy/Commands/ShowCFGContextMenuEntry.cs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows;
using ICSharpCode.Decompiler.FlowAnalysis;
@ -11,6 +12,7 @@ namespace ICSharpCode.ILSpy.Commands @@ -11,6 +12,7 @@ namespace ICSharpCode.ILSpy.Commands
{
#if DEBUG
[ExportContextMenuEntry(Header = "DEBUG -- Show CFG")]
[PartCreationPolicy(CreationPolicy.Shared)]
internal class ShowCFGContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)

3
ILSpy/Commands/SortAssemblyListCommand.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpyX;
@ -27,6 +28,7 @@ namespace ICSharpCode.ILSpy @@ -27,6 +28,7 @@ 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))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class SortAssemblyListCommand : SimpleCommand, IComparer<LoadedAssembly>
{
public override void Execute(object parameter)
@ -43,6 +45,7 @@ namespace ICSharpCode.ILSpy @@ -43,6 +45,7 @@ namespace ICSharpCode.ILSpy
[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))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class CollapseAllCommand : SimpleCommand
{
public override void Execute(object parameter)

3
ILSpy/Docking/CloseAllDocumentsCommand.cs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -9,6 +10,7 @@ using ICSharpCode.ILSpy.Properties; @@ -9,6 +10,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy.Docking
{
[ExportMainMenuCommand(Header = nameof(Resources.Window_CloseAllDocuments), ParentMenuID = nameof(Resources._Window))]
[PartCreationPolicy(CreationPolicy.Shared)]
class CloseAllDocumentsCommand : SimpleCommand
{
public override void Execute(object parameter)
@ -18,6 +20,7 @@ namespace ICSharpCode.ILSpy.Docking @@ -18,6 +20,7 @@ namespace ICSharpCode.ILSpy.Docking
}
[ExportMainMenuCommand(Header = nameof(Resources.Window_ResetLayout), ParentMenuID = nameof(Resources._Window))]
[PartCreationPolicy(CreationPolicy.Shared)]
class ResetLayoutCommand : SimpleCommand
{
public override void Execute(object parameter)

7
ILSpy/ExportProviderAdapter.cs

@ -15,7 +15,7 @@ namespace ICSharpCode.ILSpy; @@ -15,7 +15,7 @@ namespace ICSharpCode.ILSpy;
/// <summary>
/// Adapter for Microsoft.VisualStudio.Composition.<see cref="ExportProvider"/> to <see cref="IExportProvider"/>.
/// </summary>
public class ExportProviderAdapter : IExportProvider
public sealed class ExportProviderAdapter : IExportProvider
{
private static readonly Type DefaultMetadataType = typeof(Dictionary<string, object>);
@ -42,10 +42,7 @@ public class ExportProviderAdapter : IExportProvider @@ -42,10 +42,7 @@ public class ExportProviderAdapter : IExportProvider
return _exportProvider.GetExportedValues<T>(contractName).SingleOrDefault();
}
#pragma warning disable CS8769 // Nullability of reference types in type of parameter doesn't match implemented member (possibly because of nullability attributes).
// can't apply NotNullWhen here, because ICSharpCode.Decompiler defines a duplicate attribute, and uses InternalsVisibleTo("ILSpy"), so this attribute is now ambiguous!
bool IExportProvider.TryGetExportedValue<T>(string? contractName, /*[NotNullWhen(true)]*/ out T? value) where T : class
#pragma warning restore CS8769 // Nullability of reference types in type of parameter doesn't match implemented member (possibly because of nullability attributes).
bool IExportProvider.TryGetExportedValue<T>(string? contractName, [NotNullWhen(true)] out T? value) where T : class
{
value = _exportProvider.GetExportedValues<T>(contractName).SingleOrDefault();

5
ILSpy/ILSpy.csproj

@ -50,7 +50,6 @@ @@ -50,7 +50,6 @@
<PackageReference Include="DataGridExtensions" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" />
<PackageReference Include="NaturalSort.Extension" />
<PackageReference Include="TomsToolbox.Composition.Analyzer" />
<PackageReference Include="TomsToolbox.Wpf.Composition" />
<PackageReference Include="TomsToolbox.Wpf.Styles" />
</ItemGroup>
@ -92,8 +91,8 @@ @@ -92,8 +91,8 @@
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<PackageReference Include="Microsoft.DiaSymReader.Converter.Xml" />
<PackageReference Include="Microsoft.DiaSymReader" />
<PackageReference Include="Microsoft.DiaSymReader.Native" />
<PackageReference Include="Microsoft.DiaSymReader" />
<PackageReference Include="Microsoft.DiaSymReader.Native" />
</ItemGroup>
<PropertyGroup>

1
ILSpy/Languages/CSharpILMixedLanguage.cs

@ -42,6 +42,7 @@ namespace ICSharpCode.ILSpy @@ -42,6 +42,7 @@ namespace ICSharpCode.ILSpy
using SequencePoint = ICSharpCode.Decompiler.DebugInfo.SequencePoint;
[Export(typeof(Language))]
[PartCreationPolicy(CreationPolicy.Shared)]
class CSharpILMixedLanguage : ILLanguage
{
public override string Name => "IL with C#";

1
ILSpy/Languages/CSharpLanguage.cs

@ -53,6 +53,7 @@ namespace ICSharpCode.ILSpy @@ -53,6 +53,7 @@ namespace ICSharpCode.ILSpy
/// please directly use the CSharpDecompiler class.
/// </summary>
[Export(typeof(Language))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class CSharpLanguage : Language
{
string name = "C#";

1
ILSpy/Languages/ILLanguage.cs

@ -42,6 +42,7 @@ namespace ICSharpCode.ILSpy @@ -42,6 +42,7 @@ namespace ICSharpCode.ILSpy
/// flat IL (detectControlStructure=false) and structured IL (detectControlStructure=true).
/// </remarks>
[Export(typeof(Language))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class ILLanguage : Language
{
protected bool detectControlStructure = true;

3
ILSpy/Metadata/GoToTokenCommand.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel.Composition;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata.Ecma335;
@ -31,6 +32,7 @@ using ICSharpCode.ILSpy.Properties; @@ -31,6 +32,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy.Commands
{
[ExportContextMenuEntry(Header = nameof(Resources.GoToToken), Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class GoToTokenCommand : IContextMenuEntry
{
public void Execute(TextViewContext context)
@ -68,6 +70,7 @@ namespace ICSharpCode.ILSpy.Commands @@ -68,6 +70,7 @@ namespace ICSharpCode.ILSpy.Commands
}
[ExportContextMenuEntry(Header = nameof(Resources.Copy), Order = 10)]
[PartCreationPolicy(CreationPolicy.Shared)]
class CopyCommand : IContextMenuEntry
{
public void Execute(TextViewContext context)

1
ILSpy/Metadata/MetadataProtocolHandler.cs

@ -26,6 +26,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -26,6 +26,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy.Metadata
{
[Export(typeof(IProtocolHandler))]
[PartCreationPolicy(CreationPolicy.Shared)]
class MetadataProtocolHandler : IProtocolHandler
{
public ILSpyTreeNode Resolve(string protocol, MetadataFile module, Handle handle, out bool newTabPage)

2
ILSpy/Options/DecompilerSettingsPanel.xaml.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Xml.Linq;
using ICSharpCode.ILSpyX.Settings;
@ -26,6 +27,7 @@ namespace ICSharpCode.ILSpy.Options @@ -26,6 +27,7 @@ namespace ICSharpCode.ILSpy.Options
/// Interaction logic for DecompilerSettingsPanel.xaml
/// </summary>
[ExportOptionPage(Title = nameof(Properties.Resources.Decompiler), Order = 10)]
[PartCreationPolicy(CreationPolicy.NonShared)]
internal partial class DecompilerSettingsPanel : IOptionPage
{
public DecompilerSettingsPanel()

2
ILSpy/Options/DisplaySettingsPanel.xaml.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
@ -34,6 +35,7 @@ namespace ICSharpCode.ILSpy.Options @@ -34,6 +35,7 @@ namespace ICSharpCode.ILSpy.Options
/// Interaction logic for DisplaySettingsPanel.xaml
/// </summary>
[ExportOptionPage(Title = nameof(Properties.Resources.Display), Order = 20)]
[PartCreationPolicy(CreationPolicy.NonShared)]
public partial class DisplaySettingsPanel : UserControl, IOptionPage
{
public DisplaySettingsPanel()

2
ILSpy/Options/MiscSettingsPanel.xaml.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows.Controls;
using System.Xml.Linq;
@ -27,6 +28,7 @@ namespace ICSharpCode.ILSpy.Options @@ -27,6 +28,7 @@ namespace ICSharpCode.ILSpy.Options
/// Interaction logic for MiscSettingsPanel.xaml
/// </summary>
[ExportOptionPage(Title = nameof(Properties.Resources.Misc), Order = 30)]
[PartCreationPolicy(CreationPolicy.NonShared)]
public partial class MiscSettingsPanel : UserControl, IOptionPage
{
public MiscSettingsPanel()

1
ILSpy/Options/OptionsDialog.xaml.cs

@ -121,6 +121,7 @@ namespace ICSharpCode.ILSpy.Options @@ -121,6 +121,7 @@ namespace ICSharpCode.ILSpy.Options
}
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._View), Header = nameof(Resources._Options), MenuCategory = nameof(Resources.Options), MenuOrder = 999)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ShowOptionsCommand : SimpleCommand
{
public override void Execute(object parameter)

2
ILSpy/Search/SearchPane.cs

@ -21,6 +21,7 @@ using System.Collections.Concurrent; @@ -21,6 +21,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
@ -531,6 +532,7 @@ namespace ICSharpCode.ILSpy.Search @@ -531,6 +532,7 @@ namespace ICSharpCode.ILSpy.Search
}
[ExportToolbarCommand(ToolTip = nameof(Properties.Resources.SearchCtrlShiftFOrCtrlE), ToolbarIcon = "Images/Search", ToolbarCategory = nameof(Properties.Resources.View), ToolbarOrder = 100)]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ShowSearchCommand : CommandWrapper
{
public ShowSearchCommand()

4
ILSpy/TextView/EditorCommands.cs

@ -16,11 +16,14 @@ @@ -16,11 +16,14 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy.TextView
{
[ExportContextMenuEntry(Header = nameof(Resources.Copy), Category = nameof(Resources.Editor))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class CopyContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@ -40,6 +43,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -40,6 +43,7 @@ namespace ICSharpCode.ILSpy.TextView
}
[ExportContextMenuEntry(Header = nameof(Resources.Select), Category = nameof(Resources.Editor))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class SelectAllContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

3
ILSpy/TextView/FoldingCommands.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Linq;
using ICSharpCode.AvalonEdit;
@ -25,6 +26,7 @@ using ICSharpCode.ILSpy.Properties; @@ -25,6 +26,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy.TextView
{
[ExportContextMenuEntryAttribute(Header = nameof(Resources.ToggleFolding), Category = nameof(Resources.Folding))]
[PartCreationPolicy(CreationPolicy.Shared)]
internal sealed class ToggleAllContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@ -61,6 +63,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -61,6 +63,7 @@ namespace ICSharpCode.ILSpy.TextView
}
[ExportContextMenuEntryAttribute(Header = nameof(Resources._ToggleFolding), Category = nameof(Resources.Folding))]
[PartCreationPolicy(CreationPolicy.Shared)]
internal sealed class ToggleContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

7
ILSpy/TreeNodes/AssemblyTreeNode.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@ -577,6 +578,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -577,6 +578,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
}
[ExportContextMenuEntry(Header = nameof(Resources._Remove), Icon = "images/Delete")]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class RemoveAssembly : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@ -603,6 +605,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -603,6 +605,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
}
[ExportContextMenuEntry(Header = nameof(Resources._Reload), Icon = "images/Refresh")]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ReloadAssembly : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@ -637,6 +640,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -637,6 +640,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
}
[ExportContextMenuEntry(Header = nameof(Resources._LoadDependencies), Category = nameof(Resources.Dependencies))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class LoadDependencies : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@ -676,6 +680,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -676,6 +680,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
}
[ExportContextMenuEntry(Header = nameof(Resources._AddMainList), Category = nameof(Resources.Dependencies))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class AddToMainList : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@ -710,6 +715,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -710,6 +715,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
}
[ExportContextMenuEntry(Header = nameof(Resources._OpenContainingFolder), Category = nameof(Resources.Shell))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class OpenContainingFolder : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@ -762,6 +768,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -762,6 +768,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
}
[ExportContextMenuEntry(Header = nameof(Resources._OpenCommandLineHere), Category = nameof(Resources.Shell))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class OpenCmdHere : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

1
ILSpy/TreeNodes/ResourceNodes/CursorResourceEntryNode.cs

@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions; @@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions;
namespace ICSharpCode.ILSpy.TreeNodes
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class CursorResourceNodeFactory : IResourceNodeFactory
{
static readonly string[] imageFileExtensions = { ".cur" };

1
ILSpy/TreeNodes/ResourceNodes/IconResourceEntryNode.cs

@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions; @@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions;
namespace ICSharpCode.ILSpy.TreeNodes
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class IconResourceNodeFactory : IResourceNodeFactory
{
public ITreeNode CreateNode(Resource resource)

1
ILSpy/TreeNodes/ResourceNodes/ImageListResourceEntryNode.cs

@ -28,6 +28,7 @@ using ICSharpCode.ILSpyX.Abstractions; @@ -28,6 +28,7 @@ using ICSharpCode.ILSpyX.Abstractions;
namespace ICSharpCode.ILSpy.TreeNodes
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ImageListResourceEntryNodeFactory : IResourceNodeFactory
{
public ITreeNode CreateNode(Resource resource)

1
ILSpy/TreeNodes/ResourceNodes/ImageResourceEntryNode.cs

@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions; @@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions;
namespace ICSharpCode.ILSpy.TreeNodes
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ImageResourceNodeFactory : IResourceNodeFactory
{
static readonly string[] imageFileExtensions = { ".png", ".gif", ".bmp", ".jpg" };

1
ILSpy/TreeNodes/ResourceNodes/ResourcesFileTreeNode.cs

@ -38,6 +38,7 @@ using Microsoft.Win32; @@ -38,6 +38,7 @@ using Microsoft.Win32;
namespace ICSharpCode.ILSpy.TreeNodes
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class ResourcesFileTreeNodeFactory : IResourceNodeFactory
{
public ITreeNode CreateNode(Resource resource)

1
ILSpy/TreeNodes/ResourceNodes/XamlResourceNode.cs

@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions; @@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions;
namespace ICSharpCode.ILSpy.Xaml
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class XamlResourceNodeFactory : IResourceNodeFactory
{
public ITreeNode CreateNode(Resource resource)

1
ILSpy/TreeNodes/ResourceNodes/XmlResourceNode.cs

@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions; @@ -31,6 +31,7 @@ using ICSharpCode.ILSpyX.Abstractions;
namespace ICSharpCode.ILSpy.Xaml
{
[Export(typeof(IResourceNodeFactory))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class XmlResourceNodeFactory : IResourceNodeFactory
{
private readonly static string[] xmlFileExtensions = { ".xml", ".xsd", ".xslt" };

2
ILSpy/TreeNodes/ThreadingSupport.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Text;
@ -171,6 +172,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -171,6 +172,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
}
[ExportContextMenuEntry(Header = nameof(Resources.CopyErrorMessage))]
[PartCreationPolicy(CreationPolicy.Shared)]
sealed class CopyErrorMessageContextMenu : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

4
ILSpy/ViewModels/AnalyzerPaneModel.cs

@ -16,17 +16,19 @@ @@ -16,17 +16,19 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Input;
namespace ICSharpCode.ILSpy.ViewModels
{
[ExportToolPane(ContentId = PaneContentId)]
[PartCreationPolicy(CreationPolicy.Shared)]
public class AnalyzerPaneModel : ToolPaneModel
{
public const string PaneContentId = "analyzerPane";
private AnalyzerPaneModel()
public AnalyzerPaneModel()
{
ContentId = PaneContentId;
Title = Properties.Resources.Analyze;

4
ILSpy/ViewModels/AssemblyListPaneModel.cs

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Input;
@ -24,11 +25,12 @@ using ICSharpCode.ILSpy.Properties; @@ -24,11 +25,12 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy.ViewModels
{
[ExportToolPane(ContentId = PaneContentId)]
[PartCreationPolicy(CreationPolicy.Shared)]
public class AssemblyListPaneModel : ToolPaneModel
{
public const string PaneContentId = "assemblyListPane";
private AssemblyListPaneModel()
public AssemblyListPaneModel()
{
Title = Resources.Assemblies;
ContentId = PaneContentId;

4
ILSpy/ViewModels/DebugStepsPaneModel.cs

@ -16,18 +16,20 @@ @@ -16,18 +16,20 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows;
namespace ICSharpCode.ILSpy.ViewModels
{
#if DEBUG
[ExportToolPane(ContentId = PaneContentId)]
[PartCreationPolicy(CreationPolicy.Shared)]
#endif
public class DebugStepsPaneModel : ToolPaneModel
{
public const string PaneContentId = "debugStepsPane";
private DebugStepsPaneModel()
public DebugStepsPaneModel()
{
ContentId = PaneContentId;
Title = Properties.Resources.DebugSteps;

4
ILSpy/ViewModels/SearchPaneModel.cs

@ -16,17 +16,19 @@ @@ -16,17 +16,19 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Input;
namespace ICSharpCode.ILSpy.ViewModels
{
[ExportToolPane(ContentId = PaneContentId)]
[PartCreationPolicy(CreationPolicy.Shared)]
public class SearchPaneModel : ToolPaneModel
{
public const string PaneContentId = "searchPane";
private SearchPaneModel()
public SearchPaneModel()
{
ContentId = PaneContentId;
Title = Properties.Resources.SearchPane_Search;

1
TestPlugin/AboutPageAddition.cs

@ -11,6 +11,7 @@ using ICSharpCode.ILSpy; @@ -11,6 +11,7 @@ using ICSharpCode.ILSpy;
namespace TestPlugin
{
[Export(typeof(IAboutPageAddition))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class AboutPageAddition : IAboutPageAddition
{
public void Write(ISmartTextOutput textOutput)

2
TestPlugin/ContextMenuCommand.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System.ComponentModel.Composition;
using System.Linq;
using ICSharpCode.ILSpy;
@ -9,6 +10,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -9,6 +10,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace TestPlugin
{
[ExportContextMenuEntryAttribute(Header = "_Save Assembly")]
[PartCreationPolicy(CreationPolicy.Shared)]
public class SaveAssembly : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

1
TestPlugin/CustomLanguage.cs

@ -15,6 +15,7 @@ namespace TestPlugin @@ -15,6 +15,7 @@ namespace TestPlugin
/// Adds a new language to the decompiler.
/// </summary>
[Export(typeof(Language))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class CustomLanguage : Language
{
public override string Name {

2
TestPlugin/CustomOptionPage.xaml.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Windows.Controls;
using System.Xml.Linq;
@ -12,6 +13,7 @@ using ICSharpCode.ILSpyX.Settings; @@ -12,6 +13,7 @@ using ICSharpCode.ILSpyX.Settings;
namespace TestPlugin
{
[ExportOptionPage(Title = "TestPlugin", Order = 0)]
[PartCreationPolicy(CreationPolicy.NonShared)]
partial class CustomOptionPage : UserControl, IOptionPage
{
static readonly XNamespace ns = "http://www.ilspy.net/testplugin";

3
TestPlugin/MainMenuCommand.cs

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System.ComponentModel.Composition;
using ICSharpCode.ILSpy;
namespace TestPlugin
@ -16,6 +18,7 @@ namespace TestPlugin @@ -16,6 +18,7 @@ namespace TestPlugin
// ToolbarCategory: optional, used for grouping related toolbar items together. A separator is added between different groups.
// ToolbarOrder: controls the order in which the items appear (items are sorted by this value)
[ExportToolbarCommand(ToolTip = "Clears the current assembly list", ToolbarIcon = "Clear.png", ToolbarCategory = "Open", ToolbarOrder = 1.5)]
[PartCreationPolicy(CreationPolicy.Shared)]
public class UnloadAllAssembliesCommand : SimpleCommand
{
public override void Execute(object parameter)

Loading…
Cancel
Save