Stubs.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. * [email protected]. 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. using System;
  16. using System.Diagnostics;
  17. using System.Dynamic.Utils;
  18. #if SILVERLIGHT // Stubs
  19. // This is needed so we can build Silverlight version on Codeplex
  20. // where System.Core namespace is not defined.
  21. namespace System.Core
  22. {
  23. class Dummy { }
  24. }
  25. namespace System {
  26. /// <summary>
  27. /// An application exception.
  28. /// </summary>
  29. public class ApplicationException : Exception {
  30. private const int error = unchecked((int)0x80131600);
  31. /// <summary>
  32. /// The constructor.
  33. /// </summary>
  34. public ApplicationException()
  35. : base("Application Exception") {
  36. HResult = error;
  37. }
  38. /// <summary>
  39. /// The constructor.
  40. /// </summary>
  41. /// <param name="message">The message.</param>
  42. public ApplicationException(string message)
  43. : base(message) {
  44. HResult = error;
  45. }
  46. /// <summary>
  47. /// The constructor.
  48. /// </summary>
  49. /// <param name="message">The message.</param>
  50. /// <param name="innerException">The inner exception.</param>
  51. public ApplicationException(string message, Exception innerException)
  52. : base(message, innerException) {
  53. HResult = error;
  54. }
  55. }
  56. namespace Runtime.InteropServices {
  57. /// <summary>
  58. /// The Default Parameter Value Attribute.
  59. /// </summary>
  60. public sealed class DefaultParameterValueAttribute : Attribute {
  61. /// <summary>
  62. /// The constructor
  63. /// </summary>
  64. /// <param name="value">The value.</param>
  65. public DefaultParameterValueAttribute(object value) { }
  66. }
  67. }
  68. // We reference these namespaces via "using"
  69. // We don't actually use them because the code is #if !SILVERLIGHT
  70. // Rather than fix the usings all over the place, just define these here
  71. namespace Runtime.Remoting { class Dummy {} }
  72. namespace Security.Policy { class Dummy {} }
  73. namespace Xml.XPath { class Dummy {} }
  74. namespace Reflection {
  75. /// <summary>
  76. /// PortableExecutableKinds enum.
  77. /// </summary>
  78. public enum PortableExecutableKinds {
  79. /// <summary>
  80. /// ILOnly
  81. /// </summary>
  82. ILOnly = 0
  83. }
  84. /// <summary>
  85. /// ImageFileMachine enum.
  86. /// </summary>
  87. public enum ImageFileMachine {
  88. /// <summary>
  89. /// I386
  90. /// </summary>
  91. I386 = 1
  92. }
  93. }
  94. namespace ComponentModel {
  95. /// <summary>
  96. /// The Warning exception.
  97. /// </summary>
  98. public class WarningException : SystemException {
  99. /// <summary>
  100. /// The constructor.
  101. /// </summary>
  102. /// <param name="message">The message.</param>
  103. public WarningException(string message) : base(message) { }
  104. }
  105. }
  106. /// <summary>
  107. /// The serializable attribute.
  108. /// </summary>
  109. public class SerializableAttribute : Attribute {
  110. }
  111. /// <summary>
  112. /// Non serializable attribute.
  113. /// </summary>
  114. public class NonSerializedAttribute : Attribute {
  115. }
  116. namespace Runtime.Serialization {
  117. /// <summary>
  118. /// ISerializable interface.
  119. /// </summary>
  120. public interface ISerializable {
  121. }
  122. }
  123. /// <summary>
  124. /// The ConsoleColor enum.
  125. /// </summary>
  126. public enum ConsoleColor {
  127. /// <summary>
  128. /// Black.
  129. /// </summary>
  130. Black = 0,
  131. /// <summary>
  132. /// DarkBlue.
  133. /// </summary>
  134. DarkBlue = 1,
  135. /// <summary>
  136. /// DarkGreen.
  137. /// </summary>
  138. DarkGreen = 2,
  139. /// <summary>
  140. /// DaryCyan.
  141. /// </summary>
  142. DarkCyan = 3,
  143. /// <summary>
  144. /// DarkRed
  145. /// </summary>
  146. DarkRed = 4,
  147. /// <summary>
  148. /// DarkMagenta
  149. /// </summary>
  150. DarkMagenta = 5,
  151. /// <summary>
  152. /// DarkYellow
  153. /// </summary>
  154. DarkYellow = 6,
  155. /// <summary>
  156. /// Gray
  157. /// </summary>
  158. Gray = 7,
  159. /// <summary>
  160. /// DarkGray
  161. /// </summary>
  162. DarkGray = 8,
  163. /// <summary>
  164. /// Blue
  165. /// </summary>
  166. Blue = 9,
  167. /// <summary>
  168. /// Green
  169. /// </summary>
  170. Green = 10,
  171. /// <summary>
  172. /// Cyan
  173. /// </summary>
  174. Cyan = 11,
  175. /// <summary>
  176. /// Red
  177. /// </summary>
  178. Red = 12,
  179. /// <summary>
  180. /// Magenta
  181. /// </summary>
  182. Magenta = 13,
  183. /// <summary>
  184. /// Yellow
  185. /// </summary>
  186. Yellow = 14,
  187. /// <summary>
  188. /// White
  189. /// </summary>
  190. White = 15,
  191. }
  192. }
  193. #endif