diff --git a/ICSharpCode.Decompiler/CodeMappings.cs b/ICSharpCode.Decompiler/CodeMappings.cs index a67385fa5..9ecd90b5f 100644 --- a/ICSharpCode.Decompiler/CodeMappings.cs +++ b/ICSharpCode.Decompiler/CodeMappings.cs @@ -27,17 +27,17 @@ namespace ICSharpCode.Decompiler /// /// Gets or sets the source code line number in the output. /// - public int SourceCodeLine { get; set; } + public int SourceCodeLine { get; internal set; } /// /// Gets or sets IL Range offset for the source code line. E.g.: 13-19 <-> 135. /// - public ILRange ILInstructionOffset { get; set; } + public ILRange ILInstructionOffset { get; internal set; } /// /// Gets or sets the member mapping this source code mapping belongs to. /// - public MemberMapping MemberMapping { get; set; } + public MemberMapping MemberMapping { get; internal set; } /// /// Retrieves the array that contains the IL range and the missing gaps between ranges. @@ -83,22 +83,22 @@ namespace ICSharpCode.Decompiler /// /// Gets or sets the type of the mapping. /// - public TypeDefinition Type { get; set; } + public TypeDefinition Type { get; internal set; } /// /// Metadata token of the method. /// - public uint MetadataToken { get; set; } + public uint MetadataToken { get; internal set; } /// /// Gets or sets the code size for the member mapping. /// - public int CodeSize { get; set; } + public int CodeSize { get; internal set; } /// /// Gets or sets the source code mappings. /// - public List MemberCodeMappings { get; set; } + public List MemberCodeMappings { get; internal set; } /// /// Gets the inverted IL Ranges.
@@ -118,8 +118,16 @@ namespace ICSharpCode.Decompiler } } + /// + /// Code mappings helper class. + /// public static class CodeMappings { + /// + /// Gets the storage of code mappings for a language. + /// + /// A language. + /// The storage of code mappings. public static ConcurrentDictionary> GetStorage(DecompiledLanguages language) { ConcurrentDictionary> storage = null; @@ -143,7 +151,7 @@ namespace ICSharpCode.Decompiler ///
/// Method to create the mapping for. /// Source code mapping storage. - public static MemberMapping CreateCodeMapping( + internal static MemberMapping CreateCodeMapping( this MethodDefinition member, ConcurrentDictionary> codeMappings) { @@ -211,6 +219,15 @@ namespace ICSharpCode.Decompiler return null; } + /// + /// Gets a mapping given a type, a token and an IL offset. + /// + /// Code mappings storage. + /// Type name. + /// Token. + /// IL offset. + /// True, if perfect match. + /// A code mapping. public static SourceCodeMapping GetInstructionByTypeTokenAndOffset( this ConcurrentDictionary> codeMappings, string typeName,