X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMono.Cecil%2FMono.Cecil%2FTypeDefinition.cs;h=4079406d4054087f9004bbecf9d143d5201db1dc;hb=a42e4b3a4070b0a86ab9b3d19c4268e48e26d915;hp=a1575e1b0ec70f3975ccca8a766cdf3e75dceeb3;hpb=5a35198e2fdb794d48af81d80e783644a29d7291;p=mono.git diff --git a/mcs/class/Mono.Cecil/Mono.Cecil/TypeDefinition.cs b/mcs/class/Mono.Cecil/Mono.Cecil/TypeDefinition.cs index a1575e1b0ec..4079406d405 100644 --- a/mcs/class/Mono.Cecil/Mono.Cecil/TypeDefinition.cs +++ b/mcs/class/Mono.Cecil/Mono.Cecil/TypeDefinition.cs @@ -27,7 +27,7 @@ // using System; - +using Mono.Cecil.Metadata; using Mono.Collections.Generic; namespace Mono.Cecil { @@ -388,6 +388,11 @@ namespace Mono.Cecil { set { attributes = attributes.SetAttributes ((uint) TypeAttributes.Serializable, value); } } + public bool IsWindowsRuntime { + get { return attributes.GetAttributes ((uint) TypeAttributes.WindowsRuntime); } + set { attributes = attributes.SetAttributes ((uint) TypeAttributes.WindowsRuntime, value); } + } + public bool IsAnsiClass { get { return attributes.GetMaskedAttributes ((uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AnsiClass); } set { attributes = attributes.SetMaskedAttributes ((uint) TypeAttributes.StringFormatMask, (uint) TypeAttributes.AnsiClass, value); } @@ -433,6 +438,23 @@ namespace Mono.Cecil { } } + public override bool IsPrimitive { + get { + ElementType primitive_etype; + return MetadataSystem.TryGetPrimitiveElementType (this, out primitive_etype); + } + } + + public override MetadataType MetadataType { + get { + ElementType primitive_etype; + if (MetadataSystem.TryGetPrimitiveElementType (this, out primitive_etype)) + return (MetadataType) primitive_etype; + + return base.MetadataType; + } + } + public override bool IsDefinition { get { return true; } }