+2010-06-21 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * Type.cs (StructLayoutAttribute): This raises on v4.
+
+ * MonoType.cs (StructLayoutAttribute): Implement this
+ under v4.
+
2010-06-21 Jb Evain <jbevain@novell.com>
* TimeSpan.cs: add the net_4_0 parsing code in Moonlight.
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
+using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Security;
{
get { return get_core_clr_security_level () == 1; }
}
+
+ public override StructLayoutAttribute StructLayoutAttribute {
+ get {
+ return GetStructLayoutAttribute ();
+ }
+ }
#endif
}
public virtual StructLayoutAttribute StructLayoutAttribute {
get {
- LayoutKind kind;
+#if NET_4_0
+ throw CreateNIE ();
+#else
+ return GetStructLayoutAttribute ();
+#endif
+ }
+ }
+
+ internal StructLayoutAttribute GetStructLayoutAttribute ()
+ {
+ LayoutKind kind;
- if (IsLayoutSequential)
- kind = LayoutKind.Sequential;
- else if (IsExplicitLayout)
- kind = LayoutKind.Explicit;
- else
- kind = LayoutKind.Auto;
+ if (IsLayoutSequential)
+ kind = LayoutKind.Sequential;
+ else if (IsExplicitLayout)
+ kind = LayoutKind.Explicit;
+ else
+ kind = LayoutKind.Auto;
- StructLayoutAttribute attr = new StructLayoutAttribute (kind);
+ StructLayoutAttribute attr = new StructLayoutAttribute (kind);
- if (IsUnicodeClass)
- attr.CharSet = CharSet.Unicode;
- else if (IsAnsiClass)
- attr.CharSet = CharSet.Ansi;
- else
- attr.CharSet = CharSet.Auto;
+ if (IsUnicodeClass)
+ attr.CharSet = CharSet.Unicode;
+ else if (IsAnsiClass)
+ attr.CharSet = CharSet.Ansi;
+ else
+ attr.CharSet = CharSet.Auto;
- if (kind != LayoutKind.Auto)
- GetPacking (out attr.Pack, out attr.Size);
+ if (kind != LayoutKind.Auto)
+ GetPacking (out attr.Pack, out attr.Size);
- return attr;
- }
+ return attr;
}
internal object[] GetPseudoCustomAttributes ()