Skip to content

Commit

Permalink
Add enum value and properties for Windows Runtime.
Browse files Browse the repository at this point in the history
This corresponds to the 'windowsruntime' IL keyword.
  • Loading branch information
dgrunwald committed Feb 29, 2012
1 parent 1d446c7 commit a2c944b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Mono.Cecil/AssemblyFlags.cs
Expand Up @@ -35,6 +35,7 @@ public enum AssemblyAttributes : uint {
PublicKey = 0x0001,
SideBySideCompatible = 0x0000,
Retargetable = 0x0100,
WindowsRuntime = 0x0200,
DisableJITCompileOptimizer = 0x4000,
EnableJITCompileTracking = 0x8000,
}
Expand Down
5 changes: 5 additions & 0 deletions Mono.Cecil/AssemblyNameReference.cs
Expand Up @@ -92,6 +92,11 @@ public class AssemblyNameReference : IMetadataScope {
set { attributes = attributes.SetAttributes ((uint) AssemblyAttributes.Retargetable, value); }
}

public bool IsWindowsRuntime {
get { return attributes.GetAttributes ((uint) AssemblyAttributes.WindowsRuntime); }
set { attributes = attributes.SetAttributes ((uint) AssemblyAttributes.WindowsRuntime, value); }
}

public byte [] PublicKey {
get { return public_key; }
set {
Expand Down
1 change: 1 addition & 0 deletions Mono.Cecil/TypeAttributes.cs
Expand Up @@ -62,6 +62,7 @@ public enum TypeAttributes : uint {
// Implementation attributes
Import = 0x00001000, // Class/Interface is imported
Serializable = 0x00002000, // Class is serializable
WindowsRuntime = 0x00004000, // Windows Runtime type

// String formatting attributes
StringFormatMask = 0x00030000, // Use this mask to retrieve string information for native interop
Expand Down
5 changes: 5 additions & 0 deletions Mono.Cecil/TypeDefinition.cs
Expand Up @@ -389,6 +389,11 @@ void ResolveLayout ()
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); }
Expand Down

0 comments on commit a2c944b

Please sign in to comment.