Exemplo n.º 1
0
			V_1 = Type.GetTypeFromHandle(// 
			// Current member / type: System.Collections.Generic.HashSet`1<System.String> Telerik.JustDecompiler.Languages.IL.ILHelpers::BuildKeywordList(System.String[])
			// Exception in: System.Collections.Generic.HashSet<System.String> BuildKeywordList(System.String[])
			// Specified method is not supported.
			// 
			// mailto: [email protected]


		internal static MemberMapping CreateCodeMapping(MethodDefinition member, CodeMappings codeMappings)
		{
			V_0 = new ILHelpers.u003cu003ec__DisplayClass5_0();
			V_0.member = member;
			if (V_0.member == null || !V_0.member.get_HasBody())
			{
				return null;
			}
			if (codeMappings == null)
			{
				return null;
			}
			V_1 = null;
			if (String.op_Equality(codeMappings.get_FullName(), V_0.member.get_DeclaringType().get_FullName()))
			{
				V_2 = codeMappings.get_Mapping();
				if (V_2.Find(new Predicate<MemberMapping>(V_0.u003cCreateCodeMappingu003eb__0)) == null)
				{
					stackVariable26 = new MemberMapping();
					V_3 = V_0.member.get_MetadataToken();
					stackVariable26.set_MetadataToken(V_3.ToInt32());
					stackVariable26.set_MemberReference(V_0.member.get_DeclaringType().Resolve());
					stackVariable26.set_MemberCodeMappings(new List<SourceCodeMapping>());
					stackVariable26.set_CodeSize(V_0.member.get_Body().get_CodeSize());
					V_1 = stackVariable26;
					V_2.Add(V_1);
				}
			}
			return V_1;
		}
Exemplo n.º 2
0
		internal static MemberMapping CreateCodeMapping(MethodDefinition member, CodeMappings codeMappings)
		{
			if (member == null || !member.HasBody)
				return null;
			
			if (codeMappings == null)
				return null;
			
			MemberMapping currentMemberMapping = null;
			if (codeMappings.FullName == member.DeclaringType.FullName)
			{
				var mapping = codeMappings.Mapping;
				if (mapping.Find(map => (int)map.MetadataToken == member.MetadataToken.ToInt32()) == null)
				{
					currentMemberMapping = new MemberMapping()
					{
						MetadataToken = (uint)member.MetadataToken.ToInt32(),
						MemberReference = member.DeclaringType.Resolve(),
						MemberCodeMappings = new List<SourceCodeMapping>(),
						CodeSize = member.Body.CodeSize
					};
					mapping.Add(currentMemberMapping);
				}
			}
			
			return currentMemberMapping;
		}
Exemplo n.º 3
0
        internal static MemberMapping CreateCodeMapping(MethodDefinition member, CodeMappings codeMappings)
        {
            if (member == null || !member.HasBody)
            {
                return(null);
            }

            if (codeMappings == null)
            {
                return(null);
            }

            MemberMapping currentMemberMapping = null;

            if (codeMappings.FullName == member.DeclaringType.FullName)
            {
                var mapping = codeMappings.Mapping;
                if (mapping.Find(map => (int)map.MetadataToken == member.MetadataToken.ToInt32()) == null)
                {
                    currentMemberMapping = new MemberMapping()
                    {
                        MetadataToken      = (uint)member.MetadataToken.ToInt32(),
                        MemberReference    = member.DeclaringType.Resolve(),
                        MemberCodeMappings = new List <SourceCodeMapping>(),
                        CodeSize           = member.Body.CodeSize
                    };
                    mapping.Add(currentMemberMapping);
                }
            }

            return(currentMemberMapping);
        }
        protected override string WriteTypeDeclaration(TypeDefinition type, bool isPartial = false)
        {
            if (this.CodeMappings == null)
            {
                this.CodeMappings = new IL.CodeMappings { FullName = type.FullName, Mapping = new List<MemberMapping>() };
            }

            WriteKeyWordPostSpace(".class");

            if ((type.Attributes & TypeAttributes.ClassSemanticMask) == TypeAttributes.Interface)
            {
                WriteKeyWordPostSpace("interface");
            }

            flagsWriter.WriteTypeVisibility(type);
            flagsWriter.WriteTypeLayoutFlags(type);
            flagsWriter.WriteTypeStringFormat(type);
            flagsWriter.WriteTypeAttributes(type);

            int startIndex = this.formatter.CurrentPosition;
            WriteReference(ILHelpers.Escape(type.DeclaringType != null ? type.Name : type.FullName), type);
            int endIndex = this.formatter.CurrentPosition - 1;
            this.currentWritingInfo.MemberDeclarationToCodePostionMap[type] = new OffsetSpan(startIndex, endIndex);
            WriteTypeParameters(type);
            WriteLine();

            if (type.BaseType != null)
            {
                Indent();
                WriteKeyWordPostSpace("extends");
                WriteTypeReference(type.BaseType, ILNameSyntax.TypeName);
                WriteLine();
                Outdent();
            }
            if (type.HasInterfaces)
            {
                Indent();
                for (int index = 0; index < type.Interfaces.Count; index++)
                {
                    if (index > 0)
                    {
                        WriteToken(",");
                        WriteLine();
                    }
                    if (index == 0)
                    {
                        WriteKeyWordPostSpace("implements");
                    }
                    else
                    {
                        Write("           ");
                    }
                    WriteTypeReference(type.Interfaces[index], ILNameSyntax.TypeName);
                }
                WriteLine();
                Outdent();
            }
            return string.Empty;
        }