From 62f1921011993a69afdea8c56e5bcd452041cdfd Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Date: Fri, 25 Oct 2019 16:07:05 -0300 Subject: [PATCH] Added IsSealed and IsAbstract attribute (for typedef) and update CCIProvider --- CCIProvider/TypeExtractor.cs | 8 ++++++++ Model/Types/TypeDefinitions.cs | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CCIProvider/TypeExtractor.cs b/CCIProvider/TypeExtractor.cs index 19e64dda..42b48f49 100644 --- a/CCIProvider/TypeExtractor.cs +++ b/CCIProvider/TypeExtractor.cs @@ -66,6 +66,8 @@ public TypeDefinition ExtractEnum(Cci.INamedTypeDefinition typedef) type.UnderlayingType = ExtractType(typedef.UnderlyingType) as IBasicType; ExtractAttributes(type.Attributes, typedef.Attributes); ExtractConstants(type, type.Fields, typedef.Fields); + type.IsSealed = typedef.IsSealed; + type.IsAbstract = typedef.IsAbstract; return type; } @@ -79,6 +81,8 @@ public TypeDefinition ExtractInterface(Cci.INamedTypeDefinition typedef, Cci.ISo ExtractGenericTypeParameters(type, typedef); ExtractInterfaces(type.Interfaces, typedef.Interfaces); ExtractMethods(type, type.Methods, typedef.Methods, sourceLocationProvider); + type.IsSealed = typedef.IsSealed; + type.IsAbstract = typedef.IsAbstract; defGenericContext.TypeParameters.Clear(); return type; @@ -107,6 +111,8 @@ public TypeDefinition ExtractClass(Cci.INamedTypeDefinition typedef, Cci.ISource ExtractInterfaces(type.Interfaces, typedef.Interfaces); ExtractFields(type, type.Fields, typedef.Fields); ExtractMethods(type, type.Methods, typedef.Methods, sourceLocationProvider); + type.IsSealed = typedef.IsSealed; + type.IsAbstract = typedef.IsAbstract; defGenericContext.TypeParameters.Clear(); return type; @@ -122,6 +128,8 @@ public TypeDefinition ExtractStruct(Cci.INamedTypeDefinition typedef, Cci.ISourc ExtractInterfaces(type.Interfaces, typedef.Interfaces); ExtractFields(type, type.Fields, typedef.Fields); ExtractMethods(type, type.Methods, typedef.Methods, sourceLocationProvider); + type.IsSealed = typedef.IsSealed; + type.IsAbstract = typedef.IsAbstract; defGenericContext.TypeParameters.Clear(); return type; diff --git a/Model/Types/TypeDefinitions.cs b/Model/Types/TypeDefinitions.cs index 27062ea7..e048c381 100644 --- a/Model/Types/TypeDefinitions.cs +++ b/Model/Types/TypeDefinitions.cs @@ -623,7 +623,8 @@ 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 IsSealed { get; set; } + public bool IsAbstract { get; set; } public TypeDefinition(string name, TypeKind typeKind = TypeKind.Unknown, TypeDefinitionKind kind = TypeDefinitionKind.Unknown) { this.Name = name;