diff --git a/MetadataProvider/AssemblyExtractor.cs b/MetadataProvider/AssemblyExtractor.cs index 66787d90..8868ae6a 100644 --- a/MetadataProvider/AssemblyExtractor.cs +++ b/MetadataProvider/AssemblyExtractor.cs @@ -246,6 +246,25 @@ private void ExtractType(SRM.TypeDefinitionHandle typedefHandle) type.ContainingType = currentType; type.ContainingAssembly = assembly; type.ContainingNamespace = currentNamespace; + if (typedef.Attributes.HasFlag(SR.TypeAttributes.Abstract)) + { + if (typedef.Attributes.HasFlag(SR.TypeAttributes.Sealed)) + { + type.IsStatic = true; + } + else + { + type.IsAbstract = true; + } + } + else if (typedef.Attributes.HasFlag(SR.TypeAttributes.Sealed)) + { + type.IsSealed = true; + } + + type.BeforeFieldInit = typedef.Attributes.HasFlag(SR.TypeAttributes.BeforeFieldInit); + type.Serializable = typedef.Attributes.HasFlag(SR.TypeAttributes.Serializable); + currentType = type; foreach (var handle in typedef.GetGenericParameters()) @@ -471,6 +490,10 @@ private void ExtractField(SRM.FieldDefinitionHandle handle) field.IsStatic = fielddef.Attributes.HasFlag(SR.FieldAttributes.Static); field.Visibility = GetVisibilityKind(fielddef.Attributes); field.Value = ExtractFieldDefaultValue(fielddef); + field.IsReadonly = fielddef.Attributes.HasFlag(SR.FieldAttributes.InitOnly); + field.IsLiteral = fielddef.Attributes.HasFlag(SR.FieldAttributes.Literal); + field.SpecialName = fielddef.Attributes.HasFlag(SR.FieldAttributes.SpecialName); + field.RuntimeSpecialName = fielddef.Attributes.HasFlag(SR.FieldAttributes.RTSpecialName); currentType.Fields.Add(field); } @@ -508,7 +531,11 @@ private void ExtractMethod(SRM.MethodDefinitionHandle methoddefHandle) method.IsVirtual = methoddef.Attributes.HasFlag(SR.MethodAttributes.Virtual); method.IsExternal = methoddef.Attributes.HasFlag(SR.MethodAttributes.PinvokeImpl); method.IsConstructor = method.Name.EndsWith(".ctor"); - + method.HidesMember = methoddef.Attributes.HasFlag(SR.MethodAttributes.NewSlot); + method.IsSealed = methoddef.Attributes.HasFlag(SR.MethodAttributes.Final); + method.SpecialName = methoddef.Attributes.HasFlag(SR.MethodAttributes.SpecialName); + method.RuntimeSpecialName = methoddef.Attributes.HasFlag(SR.MethodAttributes.RTSpecialName); + currentType.Methods.Add(method); currentMethod = method; diff --git a/Model/Types/TypeDefinitions.cs b/Model/Types/TypeDefinitions.cs index 27062ea7..8bf35d25 100644 --- a/Model/Types/TypeDefinitions.cs +++ b/Model/Types/TypeDefinitions.cs @@ -112,6 +112,10 @@ public class FieldDefinition : ITypeMemberDefinition, IFieldReference public Constant Value { get; set; } public bool IsStatic { get; set; } + public bool IsReadonly { get; set; } + public bool IsLiteral { get; set; } + public bool SpecialName { get; set; } + public bool RuntimeSpecialName { get; set; } public FieldDefinition(string name, IType type) { @@ -412,6 +416,10 @@ public class MethodDefinition : ITypeMemberDefinition, IMethodReference, IGeneri public bool IsVirtual { get; set; } public bool IsConstructor { get; set; } public bool IsExternal { get; set; } + public bool HidesMember { get; set; } + public bool IsSealed { get; set; } + public bool SpecialName { get; set; } + public bool RuntimeSpecialName { get; set; } public MethodBody Body { get; set; } public MethodDefinition(string name, IType returnType) @@ -623,6 +631,11 @@ public class TypeDefinition : IBasicType, IGenericDefinition, ITypeMemberDefinit public IList Methods { get; private set; } public IList Types { get; private set; } public IBasicType UnderlayingType { get; set; } + public bool IsStatic { get; set; } + public bool IsAbstract { get; set; } + public bool IsSealed { get; set; } + public bool BeforeFieldInit { get; set; } + public bool Serializable { get; set; } public TypeDefinition(string name, TypeKind typeKind = TypeKind.Unknown, TypeDefinitionKind kind = TypeDefinitionKind.Unknown) {