Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / dlr / Runtime / Microsoft.Scripting / Stubs.cs
1 /* ****************************************************************************
2  *
3  * Copyright (c) Microsoft Corporation. 
4  *
5  * This source code is subject to terms and conditions of the Apache License, Version 2.0. A 
6  * copy of the license can be found in the License.html file at the root of this distribution. If 
7  * you cannot locate the  Apache License, Version 2.0, please send an email to 
8  * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
9  * by the terms of the Apache License, Version 2.0.
10  *
11  * You must not remove this notice, or any other, from this software.
12  *
13  *
14  * ***************************************************************************/
15
16 #if WIN8
17
18 // When compiled with Dev10 VS CSC reports errors if this is not defined
19 // error CS0656: Missing compiler required member 'System.Threading.Thread.get_ManagedThreadId'
20 // error CS0656: Missing compiler required member 'System.Threading.Thread.get_CurrentThread'
21 namespace System.Threading {
22     internal class Thread {
23         public int ManagedThreadId { get { throw new NotImplementedException(); } }
24         public static Thread CurrentThread { get { throw new NotImplementedException(); } }
25     }
26 }
27
28 namespace System.IO {
29     [Serializable]
30     public enum FileMode {
31         CreateNew = 1,
32         Create,
33         Open,
34         OpenOrCreate,
35         Truncate,
36         Append
37     }
38
39     [Serializable]
40     public enum FileAccess {
41         Read = 1,
42         Write = 2,
43         ReadWrite = 3
44     }
45
46     [Serializable]
47     public enum FileShare {
48         None = 0,
49         Read = 1,
50         Write = 2,
51         ReadWrite = 3,
52         Delete = 4,
53         Inheritable = 16
54     }
55 }
56 #else
57 namespace System {
58     public static class TypeExtensions {
59 #if !FEATURE_GET_TYPE_INFO
60         public static Type GetTypeInfo(this Type type) {
61             return type;
62         }
63 #endif
64
65         public static Type AsType(this Type type) {
66             return type;
67         }
68     }
69 }
70 #endif
71
72 #if !FEATURE_SERIALIZATION
73
74 namespace System {
75     using System.Diagnostics;
76
77     [Conditional("STUB")]
78     public class SerializableAttribute : Attribute {
79     }
80
81     [Conditional("STUB")]
82     public class NonSerializedAttribute : Attribute {
83     }
84
85     namespace Runtime.Serialization {
86         public interface ISerializable {
87         }
88
89         public interface IDeserializationCallback {
90         }
91     }
92
93     public class SerializationException : Exception {
94     }
95 }
96
97 #endif
98
99 #if SILVERLIGHT && !CLR2
100
101 namespace System {
102     namespace Runtime.InteropServices {
103         /// <summary>
104         /// The Default Parameter Value Attribute.
105         /// </summary>
106         public sealed class DefaultParameterValueAttribute : Attribute {
107             /// <summary>
108             /// The constructor
109             /// </summary>
110             /// <param name="value">The value.</param>
111             public DefaultParameterValueAttribute(object value) { }
112         }
113     }
114 }
115
116 #endif