// Author:
// Jb Evain (jbevain@gmail.com)
//
-// Copyright (c) 2008 - 2010 Jb Evain
+// Copyright (c) 2008 - 2011 Jb Evain
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System;
-
+using Mono.Cecil.Metadata;
using Mono.Collections.Generic;
namespace Mono.Cecil {
}
}
- internal new bool HasImage {
- get { return Module != null && Module.HasImage; }
- }
-
public bool HasMethods {
get {
if (methods != null)
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); }
}
}
+ 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; }
}