diff --git a/corlib/System.Runtime.InteropServices/CharSet.cs b/corlib/System.Runtime.InteropServices/CharSet.cs index d506e2a..a9ef5a9 100644 --- a/corlib/System.Runtime.InteropServices/CharSet.cs +++ b/corlib/System.Runtime.InteropServices/CharSet.cs @@ -21,6 +21,7 @@ #if !LOCALTEST namespace System.Runtime.InteropServices { + [Serializable] public enum CharSet { None = 1, Ansi = 2, diff --git a/corlib/System.Runtime.InteropServices/LayoutKind.cs b/corlib/System.Runtime.InteropServices/LayoutKind.cs new file mode 100644 index 0000000..1266c4f --- /dev/null +++ b/corlib/System.Runtime.InteropServices/LayoutKind.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2012 DotNetAnywhere +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#if !LOCALTEST + +namespace System.Runtime.InteropServices { + [Serializable] + public enum LayoutKind { + Sequential = 0, + Explicit = 2, + Auto = 3 + } +} + +#endif diff --git a/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs b/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs new file mode 100644 index 0000000..5d3c9bc --- /dev/null +++ b/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2012 DotNetAnywhere +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#if !LOCALTEST + +namespace System.Runtime.InteropServices { + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] + public sealed class StructLayoutAttribute : Attribute { + + private readonly LayoutKind _value; + + public LayoutKind Value { get { return _value; } } + + public int Pack; + + public int Size; + + public CharSet CharSet; + + public StructLayoutAttribute(LayoutKind layoutKind) { + _value = layoutKind; + } + + public StructLayoutAttribute(short layoutKind) { + _value = (LayoutKind)layoutKind; + } + } +} + +#endif \ No newline at end of file diff --git a/corlib/System/AttributeTargets.cs b/corlib/System/AttributeTargets.cs index 77a9818..ea55153 100644 --- a/corlib/System/AttributeTargets.cs +++ b/corlib/System/AttributeTargets.cs @@ -22,6 +22,7 @@ namespace System { + [Flags, Serializable] public enum AttributeTargets { Assembly = 0x00000001, Module = 0x00000002, diff --git a/corlib/System/SerializableAttribute.cs b/corlib/System/SerializableAttribute.cs new file mode 100644 index 0000000..32a0249 --- /dev/null +++ b/corlib/System/SerializableAttribute.cs @@ -0,0 +1,31 @@ +// Copyright (c) 2012 DotNetAnywhere +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#if !LOCALTEST + +namespace System { + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)] + public sealed class SerializableAttribute : Attribute { + } + +} + +#endif \ No newline at end of file diff --git a/corlib/corlib.csproj b/corlib/corlib.csproj index 0f58710..a1fcf10 100644 --- a/corlib/corlib.csproj +++ b/corlib/corlib.csproj @@ -135,6 +135,7 @@ + @@ -145,7 +146,9 @@ + + @@ -229,6 +232,7 @@ +