public static Dictionary<MemberIdentifier, CodeSpan> GenerateMemberMapping(string assemblyFilePath, StringWriter writer, List<WritingInfo> writingInfos) { string theText = writer.ToString(); Dictionary<MemberIdentifier, CodeSpan> mapping = new Dictionary<MemberIdentifier, CodeSpan>(); TwoDimensionalString twoDString = new TwoDimensionalString(theText, writer.NewLine, false); foreach (WritingInfo memberInfo in writingInfos) { foreach (KeyValuePair<IMemberDefinition, OffsetSpan> item in memberInfo.MemberDeclarationToCodePostionMap) { IMemberDefinition member = item.Key; OffsetSpan position = item.Value; // Get/set keywords are printed alone in a lane. // This should trim the tabulations before them. position = twoDString.TrimStart(position); CodeSpan codeSpan = GetSpan(twoDString, position); mapping.Add(GetIdentifier(assemblyFilePath, member), codeSpan); } } return mapping; }
public static Dictionary <MemberIdentifier, CodeSpan> GenerateMemberMapping(string assemblyFilePath, StringWriter writer, List <WritingInfo> writingInfos) { string theText = writer.ToString(); Dictionary <MemberIdentifier, CodeSpan> mapping = new Dictionary <MemberIdentifier, CodeSpan>(); TwoDimensionalString twoDString = new TwoDimensionalString(theText, writer.NewLine, false); foreach (WritingInfo memberInfo in writingInfos) { foreach (KeyValuePair <IMemberDefinition, OffsetSpan> item in memberInfo.MemberDeclarationToCodePostionMap) { IMemberDefinition member = item.Key; OffsetSpan position = item.Value; // Get/set keywords are printed alone in a lane. // This should trim the tabulations before them. position = twoDString.TrimStart(position); CodeSpan codeSpan = GetSpan(twoDString, position); mapping.Add(GetIdentifier(assemblyFilePath, member), codeSpan); } } return(mapping); }
public static Dictionary <MemberIdentifier, CodeSpan> GenerateMemberMapping(string assemblyFilePath, StringWriter writer, List <WritingInfo> writingInfos) { stackVariable1 = writer.ToString(); V_0 = new Dictionary <MemberIdentifier, CodeSpan>(); V_1 = new TwoDimensionalString(stackVariable1, writer.get_NewLine(), false); V_2 = writingInfos.GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current().get_MemberDeclarationToCodePostionMap().GetEnumerator(); try { while (V_3.MoveNext()) { V_4 = V_3.get_Current(); V_5 = V_4.get_Key(); V_6 = V_4.get_Value(); V_7 = ExternallyVisibleDecompilationUtilities.GetSpan(V_1, V_1.TrimStart(V_6)); V_0.Add(ExternallyVisibleDecompilationUtilities.GetIdentifier(assemblyFilePath, V_5), V_7); } } finally { ((IDisposable)V_3).Dispose(); } } } finally { ((IDisposable)V_2).Dispose(); } return(V_0); }