{
get { return Environment.GetResourceString("ObjectDisposed_StreamIsClosed"); }
}
+
+ internal static string Arg_SystemException
+ {
+ get { return Environment.GetResourceString("Arg_SystemException"); }
+ }
+
+ internal static string Arg_StackOverflowException
+ {
+ get { return Environment.GetResourceString("Arg_StackOverflowException"); }
+ }
+
+ internal static string Arg_DataMisalignedException
+ {
+ get { return Environment.GetResourceString("Arg_DataMisalignedException"); }
+ }
+
+ internal static string Arg_ExecutionEngineException
+ {
+ get { return Environment.GetResourceString("Arg_ExecutionEngineException"); }
+ }
+
+ internal static string Arg_AccessException
+ {
+ get { return Environment.GetResourceString("Arg_AccessException"); }
+ }
+
+ internal static string Arg_AccessViolationException
+ {
+ get { return Environment.GetResourceString("Arg_AccessViolationException"); }
+ }
+
+ internal static string Arg_ApplicationException
+ {
+ get { return Environment.GetResourceString("Arg_ApplicationException"); }
+ }
+
+ internal static string Arg_ArgumentException
+ {
+ get { return Environment.GetResourceString("Arg_ArgumentException"); }
+ }
+
+ internal static string Arg_ParamName_Name
+ {
+ get { return Environment.GetResourceString("Arg_ParamName_Name"); }
+ }
+
+ internal static string ArgumentNull_Generic
+ {
+ get { return Environment.GetResourceString("ArgumentNull_Generic"); }
+ }
+
+ internal static string Arg_ArithmeticException
+ {
+ get { return Environment.GetResourceString("Arg_ArithmeticException"); }
+ }
+
+ internal static string Arg_ArrayTypeMismatchException
+ {
+ get { return Environment.GetResourceString("Arg_ArrayTypeMismatchException"); }
+ }
+
+ internal static string Arg_DivideByZero
+ {
+ get { return Environment.GetResourceString("Arg_DivideByZero"); }
+ }
+
+ internal static string Arg_DuplicateWaitObjectException
+ {
+ get { return Environment.GetResourceString("Arg_DuplicateWaitObjectException"); }
+ }
+
+ internal static string Arg_EntryPointNotFoundException
+ {
+ get { return Environment.GetResourceString("Arg_EntryPointNotFoundException"); }
+ }
+
+ internal static string Arg_FieldAccessException
+ {
+ get { return Environment.GetResourceString("Arg_FieldAccessException"); }
+ }
+
+ internal static string Arg_FormatException
+ {
+ get { return Environment.GetResourceString("Arg_FormatException"); }
+ }
+
+ internal static string Arg_IndexOutOfRangeException
+ {
+ get { return Environment.GetResourceString("Arg_IndexOutOfRangeException"); }
+ }
+
+ internal static string Arg_InsufficientExecutionStackException
+ {
+ get { return Environment.GetResourceString("Arg_InsufficientExecutionStackException"); }
+ }
+
+ internal static string Arg_InvalidCastException
+ {
+ get { return Environment.GetResourceString("Arg_InvalidCastException"); }
+ }
+
+ internal static string Arg_InvalidOperationException
+ {
+ get { return Environment.GetResourceString("Arg_InvalidOperationException"); }
+ }
+
+ internal static string InvalidProgram_Default
+ {
+ get { return Environment.GetResourceString("InvalidProgram_Default"); }
+ }
+
+ internal static string Arg_MethodAccessException
+ {
+ get { return Environment.GetResourceString("Arg_MethodAccessException"); }
+ }
+
+ internal static string Arg_MulticastNotSupportedException
+ {
+ get { return Environment.GetResourceString("Arg_MulticastNotSupportedException"); }
+ }
+
+ internal static string Arg_NotFiniteNumberException
+ {
+ get { return Environment.GetResourceString("Arg_NotFiniteNumberException"); }
+ }
+
+ internal static string Arg_NotImplementedException
+ {
+ get { return Environment.GetResourceString("Arg_NotImplementedException"); }
+ }
+
+ internal static string Arg_NotSupportedException
+ {
+ get { return Environment.GetResourceString("Arg_NotSupportedException"); }
+ }
+
+ internal static string Arg_NullReferenceException
+ {
+ get { return Environment.GetResourceString("Arg_NullReferenceException"); }
+ }
+
+ internal static string ObjectDisposed_Generic
+ {
+ get { return Environment.GetResourceString("ObjectDisposed_Generic"); }
+ }
+
+ internal static string ObjectDisposed_ObjectName_Name
+ {
+ get { return Environment.GetResourceString("ObjectDisposed_ObjectName_Name"); }
+ }
+
+ internal static string Arg_OverflowException
+ {
+ get { return Environment.GetResourceString("Arg_OverflowException"); }
+ }
+
+ internal static string Arg_PlatformNotSupported
+ {
+ get { return Environment.GetResourceString("Arg_PlatformNotSupported"); }
+ }
+
+ internal static string Arg_RankException
+ {
+ get { return Environment.GetResourceString("Arg_RankException"); }
+ }
+
+ internal static string Arg_TimeoutException
+ {
+ get { return Environment.GetResourceString("Arg_TimeoutException"); }
+ }
+
+ internal static string Arg_TypeAccessException
+ {
+ get { return Environment.GetResourceString("Arg_TypeAccessException"); }
+ }
+
+ internal static string TypeInitialization_Default
+ {
+ get { return Environment.GetResourceString("TypeInitialization_Default"); }
+ }
+
+ internal static string TypeInitialization_Type
+ {
+ get { return Environment.GetResourceString("TypeInitialization_Type"); }
+ }
+
+ internal static string Arg_UnauthorizedAccessException
+ {
+ get { return Environment.GetResourceString("Arg_UnauthorizedAccessException"); }
+ }
}
**
=============================================================================*/
-namespace System
-{
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System;
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class AccessViolationException : SystemException
+ public class AccessViolationException : SystemException
{
- public AccessViolationException()
- : base(Environment.GetResourceString("Arg_AccessViolationException"))
+ public AccessViolationException()
+ : base(SR.Arg_AccessViolationException)
{
- SetErrorCode(__HResults.E_POINTER);
+ HResult = __HResults.E_POINTER;
}
-
- public AccessViolationException(String message)
- : base(message)
+
+ public AccessViolationException(String message)
+ : base(message)
{
- SetErrorCode(__HResults.E_POINTER);
+ HResult = __HResults.E_POINTER;
}
-
- public AccessViolationException(String message, Exception innerException)
- : base(message, innerException)
+
+ public AccessViolationException(String message, Exception innerException)
+ : base(message, innerException)
{
- SetErrorCode(__HResults.E_POINTER);
+ HResult = __HResults.E_POINTER;
}
- protected AccessViolationException(SerializationInfo info, StreamingContext context) : base(info, context) {}
+ protected AccessViolationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#pragma warning disable 169 // Field is not used from managed.
private IntPtr _ip; // Address of faulting instruction.
private IntPtr _target; // Address that could not be accessed.
private int _accessType; // 0:read, 1:write
#pragma warning restore 169
-
}
-
}
{
public delegate void Action<in T>(T obj);
- // Action/Func delegates first shipped with .NET Framework 3.5 in System.Core.dll as part of LINQ
- // These were type forwarded to mscorlib.dll in .NET Framework 4.0 and in Silverlight 5.0
public delegate void Action();
public delegate void Action<in T1,in T2>(T1 arg1, T2 arg2);
public delegate void Action<in T1,in T2,in T3>(T1 arg1, T2 arg2, T3 arg3);
public delegate int Comparison<in T>(T x, T y);
public delegate TOutput Converter<in TInput, out TOutput>(TInput input);
-
- public delegate bool Predicate<in T>(T obj);
+ public delegate bool Predicate<in T>(T obj);
}
-
**
=============================================================================*/
-namespace System {
-
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+
+namespace System
+{
// The ApplicationException is the base class for nonfatal,
// application errors that occur. These exceptions are generated
// (i.e., thrown) by an application, not the Runtime. Applications that need
// ApplicationException extends but adds no new functionality to
// RecoverableException.
//
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class ApplicationException : Exception {
-
+ public class ApplicationException : Exception
+ {
// Creates a new ApplicationException with its message string set to
// the empty string, its HRESULT set to COR_E_APPLICATION,
// and its ExceptionInfo reference set to null.
- public ApplicationException()
- : base(Environment.GetResourceString("Arg_ApplicationException")) {
- SetErrorCode(__HResults.COR_E_APPLICATION);
+ public ApplicationException()
+ : base(SR.Arg_ApplicationException)
+ {
+ HResult = __HResults.COR_E_APPLICATION;
}
-
+
// Creates a new ApplicationException with its message string set to
// message, its HRESULT set to COR_E_APPLICATION,
// and its ExceptionInfo reference set to null.
//
- public ApplicationException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_APPLICATION);
- }
-
- public ApplicationException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_APPLICATION);
+ public ApplicationException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_APPLICATION;
}
- protected ApplicationException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public ApplicationException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_APPLICATION;
}
+ protected ApplicationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Remoting;
- using System.Runtime.Serialization;
- using System.Globalization;
- using System.Security.Permissions;
- using System.Diagnostics.Contracts;
+using System.Globalization;
+using System.Runtime.Serialization;
+
+namespace System
+{
// The ArgumentException is thrown when an argument does not meet
// the contract of the method. Ideally it should give a meaningful error
// message describing what was wrong and which parameter is incorrect.
//
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class ArgumentException : SystemException, ISerializable {
- private String m_paramName;
-
+ public class ArgumentException : SystemException, ISerializable
+ {
+ private String _paramName;
+
// Creates a new ArgumentException with its message
// string set to the empty string.
- public ArgumentException()
- : base(Environment.GetResourceString("Arg_ArgumentException")) {
- SetErrorCode(__HResults.COR_E_ARGUMENT);
+ public ArgumentException()
+ : base(SR.Arg_ArgumentException)
+ {
+ HResult = __HResults.COR_E_ARGUMENT;
}
-
+
// Creates a new ArgumentException with its message
// string set to message.
//
- public ArgumentException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_ARGUMENT);
+ public ArgumentException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_ARGUMENT;
}
-
- public ArgumentException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_ARGUMENT);
+
+ public ArgumentException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_ARGUMENT;
}
- public ArgumentException(String message, String paramName, Exception innerException)
- : base(message, innerException) {
- m_paramName = paramName;
- SetErrorCode(__HResults.COR_E_ARGUMENT);
+ public ArgumentException(String message, String paramName, Exception innerException)
+ : base(message, innerException)
+ {
+ _paramName = paramName;
+ HResult = __HResults.COR_E_ARGUMENT;
}
-
- public ArgumentException (String message, String paramName)
-
- : base (message) {
- m_paramName = paramName;
- SetErrorCode(__HResults.COR_E_ARGUMENT);
+
+ public ArgumentException(String message, String paramName)
+ : base(message)
+ {
+ _paramName = paramName;
+ HResult = __HResults.COR_E_ARGUMENT;
}
- protected ArgumentException(SerializationInfo info, StreamingContext context) : base(info, context) {
- m_paramName = info.GetString("ParamName");
+ protected ArgumentException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ _paramName = info.GetString("ParamName");
}
-
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("ParamName", _paramName, typeof(String));
+ }
+
public override String Message
{
- get {
+ get
+ {
String s = base.Message;
- if (!String.IsNullOrEmpty(m_paramName)) {
- String resourceString = Environment.GetResourceString("Arg_ParamName_Name", m_paramName);
+ if (!String.IsNullOrEmpty(_paramName))
+ {
+ String resourceString = SR.Format(SR.Arg_ParamName_Name, _paramName);
return s + Environment.NewLine + resourceString;
}
else
return s;
}
}
-
- public virtual String ParamName {
- get { return m_paramName; }
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context) {
- if (info==null) {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
- base.GetObjectData(info, context);
- info.AddValue("ParamName", m_paramName, typeof(String));
+
+ public virtual String ParamName
+ {
+ get { return _paramName; }
}
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- using System.Runtime.Remoting;
- using System.Security.Permissions;
-
+using System.Runtime.Serialization;
+
+namespace System
+{
// The ArgumentException is thrown when an argument
// is null when it shouldn't be.
//
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
public class ArgumentNullException : ArgumentException
{
// Creates a new ArgumentNullException with its message
// string set to a default message explaining an argument was null.
- public ArgumentNullException()
- : base(Environment.GetResourceString("ArgumentNull_Generic")) {
- // Use E_POINTER - COM used that for null pointers. Description is "invalid pointer"
- SetErrorCode(__HResults.E_POINTER);
+ public ArgumentNullException()
+ : base(SR.ArgumentNull_Generic)
+ {
+ // Use E_POINTER - COM used that for null pointers. Description is "invalid pointer"
+ HResult = __HResults.E_POINTER;
}
- public ArgumentNullException(String paramName)
- : base(Environment.GetResourceString("ArgumentNull_Generic"), paramName) {
- SetErrorCode(__HResults.E_POINTER);
+ public ArgumentNullException(String paramName)
+ : base(SR.ArgumentNull_Generic, paramName)
+ {
+ HResult = __HResults.E_POINTER;
}
- public ArgumentNullException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.E_POINTER);
- }
-
- public ArgumentNullException(String paramName, String message)
- : base(message, paramName) {
- SetErrorCode(__HResults.E_POINTER);
+ public ArgumentNullException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.E_POINTER;
}
- protected ArgumentNullException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public ArgumentNullException(String paramName, String message)
+ : base(message, paramName)
+ {
+ HResult = __HResults.E_POINTER;
}
+
+ protected ArgumentNullException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+
+namespace System
+{
// The ArithmeticException is thrown when overflow or underflow
// occurs.
//
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
public class ArithmeticException : SystemException
- {
+ {
// Creates a new ArithmeticException with its message string set to
// the empty string, its HRESULT set to COR_E_ARITHMETIC,
// and its ExceptionInfo reference set to null.
- public ArithmeticException()
- : base(Environment.GetResourceString("Arg_ArithmeticException")) {
- SetErrorCode(__HResults.COR_E_ARITHMETIC);
+ public ArithmeticException()
+ : base(SR.Arg_ArithmeticException)
+ {
+ HResult = __HResults.COR_E_ARITHMETIC;
}
-
+
// Creates a new ArithmeticException with its message string set to
// message, its HRESULT set to COR_E_ARITHMETIC,
// and its ExceptionInfo reference set to null.
//
- public ArithmeticException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_ARITHMETIC);
- }
-
- public ArithmeticException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_ARITHMETIC);
+ public ArithmeticException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_ARITHMETIC;
}
- protected ArithmeticException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public ArithmeticException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_ARITHMETIC;
}
+ protected ArithmeticException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+
+namespace System
+{
// The ArrayMismatchException is thrown when an attempt to store
// an object of the wrong type within an array occurs.
//
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class ArrayTypeMismatchException : SystemException {
-
+ public class ArrayTypeMismatchException : SystemException
+ {
// Creates a new ArrayMismatchException with its message string set to
// the empty string, its HRESULT set to COR_E_ARRAYTYPEMISMATCH,
// and its ExceptionInfo reference set to null.
- public ArrayTypeMismatchException()
- : base(Environment.GetResourceString("Arg_ArrayTypeMismatchException")) {
- SetErrorCode(__HResults.COR_E_ARRAYTYPEMISMATCH);
+ public ArrayTypeMismatchException()
+ : base(SR.Arg_ArrayTypeMismatchException)
+ {
+ HResult = __HResults.COR_E_ARRAYTYPEMISMATCH;
}
-
+
// Creates a new ArrayMismatchException with its message string set to
// message, its HRESULT set to COR_E_ARRAYTYPEMISMATCH,
// and its ExceptionInfo reference set to null.
//
- public ArrayTypeMismatchException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_ARRAYTYPEMISMATCH);
- }
-
- public ArrayTypeMismatchException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_ARRAYTYPEMISMATCH);
+ public ArrayTypeMismatchException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_ARRAYTYPEMISMATCH;
}
- protected ArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public ArrayTypeMismatchException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_ARRAYTYPEMISMATCH;
}
+ protected ArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
** Purpose: Type of callback for async operations
**
===========================================================*/
-namespace System {
+
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
public delegate void AsyncCallback(IAsyncResult ar);
-
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
-namespace System {
-
- using System;
-
+
+namespace System
+{
// Enum used to indicate all the elements of the
// VOS it is valid to attach this element to.
-[Serializable]
[Flags]
-[System.Runtime.InteropServices.ComVisible(true)]
+ [Serializable]
public enum AttributeTargets
{
- Assembly = 0x0001,
- Module = 0x0002,
- Class = 0x0004,
- Struct = 0x0008,
- Enum = 0x0010,
- Constructor = 0x0020,
- Method = 0x0040,
- Property = 0x0080,
- Field = 0x0100,
- Event = 0x0200,
- Interface = 0x0400,
- Parameter = 0x0800,
- Delegate = 0x1000,
- ReturnValue = 0x2000,
- //@todo GENERICS: document GenericParameter
+ Assembly = 0x0001,
+ Module = 0x0002,
+ Class = 0x0004,
+ Struct = 0x0008,
+ Enum = 0x0010,
+ Constructor = 0x0020,
+ Method = 0x0040,
+ Property = 0x0080,
+ Field = 0x0100,
+ Event = 0x0200,
+ Interface = 0x0400,
+ Parameter = 0x0800,
+ Delegate = 0x1000,
+ ReturnValue = 0x2000,
GenericParameter = 0x4000,
-
-
- All = Assembly | Module | Class | Struct | Enum | Constructor |
- Method | Property | Field | Event | Interface | Parameter |
- Delegate | ReturnValue | GenericParameter,
+
+ All = Assembly | Module | Class | Struct | Enum | Constructor |
+ Method | Property | Field | Event | Interface | Parameter |
+ Delegate | ReturnValue | GenericParameter
}
}
**
=============================================================================*/
-namespace System {
-[Serializable]
- [AttributeUsage (AttributeTargets.All, Inherited=true, AllowMultiple=false)]
-[System.Runtime.InteropServices.ComVisible(true)]
- public sealed class CLSCompliantAttribute : Attribute
+namespace System
+{
+ [Serializable]
+ [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)]
+ public sealed class CLSCompliantAttribute : Attribute
{
- private bool m_compliant;
+ private bool _compliant;
- public CLSCompliantAttribute (bool isCompliant)
+ public CLSCompliantAttribute(bool isCompliant)
{
- m_compliant = isCompliant;
+ _compliant = isCompliant;
}
- public bool IsCompliant
+ public bool IsCompliant
{
- get
+ get
{
- return m_compliant;
+ return _compliant;
}
}
}
**
**
============================================================*/
-namespace System {
- using System.Collections;
- using System.Collections.Generic;
- using System.Diagnostics.Contracts;
+using System.Collections;
+using System.Collections.Generic;
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- public sealed class CharEnumerator : IEnumerator, ICloneable, IEnumerator<char>, IDisposable {
- private String str;
- private int index;
- private char currentElement;
+namespace System
+{
+ public sealed class CharEnumerator : IEnumerator, IEnumerator<char>, IDisposable, ICloneable
+ {
+ private String _str;
+ private int _index;
+ private char _currentElement;
- internal CharEnumerator(String str) {
- Contract.Requires(str != null);
- this.str = str;
- this.index = -1;
+ internal CharEnumerator(String str)
+ {
+ _str = str;
+ _index = -1;
}
- public Object Clone() {
+ public object Clone()
+ {
return MemberwiseClone();
}
-
- public bool MoveNext() {
- if (index < (str.Length-1)) {
- index++;
- currentElement = str[index];
+
+ public bool MoveNext()
+ {
+ if (_index < (_str.Length - 1))
+ {
+ _index++;
+ _currentElement = _str[_index];
return true;
}
else
- index = str.Length;
+ _index = _str.Length;
return false;
-
}
- public void Dispose() {
- if (str != null)
- index = str.Length;
- str = null;
+ public void Dispose()
+ {
+ if (_str != null)
+ _index = _str.Length;
+ _str = null;
}
-
+
/// <internalonly/>
- Object IEnumerator.Current {
+ Object IEnumerator.Current
+ {
get { return Current; }
}
-
- public char Current {
- get {
- if (index == -1)
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- if (index >= str.Length)
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
- return currentElement;
+
+ public char Current
+ {
+ get
+ {
+ if (_index == -1)
+ throw new InvalidOperationException(SR.InvalidOperation_EnumNotStarted);
+ if (_index >= _str.Length)
+ throw new InvalidOperationException(SR.InvalidOperation_EnumEnded);
+ return _currentElement;
}
}
- public void Reset() {
- currentElement = (char)0;
- index = -1;
+ public void Reset()
+ {
+ _currentElement = (char)0;
+ _index = -1;
}
}
}
**
=============================================================================*/
-namespace System
-{
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
public sealed class DataMisalignedException : SystemException
{
- public DataMisalignedException()
- : base(Environment.GetResourceString("Arg_DataMisalignedException"))
- {
- SetErrorCode(__HResults.COR_E_DATAMISALIGNED);
- }
-
- public DataMisalignedException(String message)
- : base(message)
+ public DataMisalignedException()
+ : base(SR.Arg_DataMisalignedException)
{
- SetErrorCode(__HResults.COR_E_DATAMISALIGNED);
+ HResult = __HResults.COR_E_DATAMISALIGNED;
}
- public DataMisalignedException(String message, Exception innerException)
- : base(message, innerException)
+ public DataMisalignedException(String message)
+ : base(message)
{
- SetErrorCode(__HResults.COR_E_DATAMISALIGNED);
+ HResult = __HResults.COR_E_DATAMISALIGNED;
}
- internal DataMisalignedException(SerializationInfo info, StreamingContext context)
- : base (info, context)
+ public DataMisalignedException(String message, Exception innerException)
+ : base(message, innerException)
{
+ HResult = __HResults.COR_E_DATAMISALIGNED;
}
- }
+ internal DataMisalignedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-
-namespace System {
-
+namespace System
+{
// This enum is used to indentify DateTime instances in cases when they are known to be in local time,
// UTC time or if this information has not been specified or is not applicable.
[Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
public enum DateTimeKind
{
Unspecified = 0,
**
**
============================================================*/
-namespace System {
+namespace System
+{
[Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public enum DayOfWeek {
+ public enum DayOfWeek
+ {
Sunday = 0,
Monday = 1,
Tuesday = 2,
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
-[System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class DivideByZeroException : ArithmeticException {
- public DivideByZeroException()
- : base(Environment.GetResourceString("Arg_DivideByZero")) {
- SetErrorCode(__HResults.COR_E_DIVIDEBYZERO);
- }
-
- public DivideByZeroException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_DIVIDEBYZERO);
+ public class DivideByZeroException : ArithmeticException
+ {
+ public DivideByZeroException()
+ : base(SR.Arg_DivideByZero)
+ {
+ HResult = __HResults.COR_E_DIVIDEBYZERO;
}
-
- public DivideByZeroException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_DIVIDEBYZERO);
+
+ public DivideByZeroException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_DIVIDEBYZERO;
}
- protected DivideByZeroException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public DivideByZeroException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_DIVIDEBYZERO;
}
+
+ protected DivideByZeroException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Remoting;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+namespace System
+{
// The DuplicateWaitObjectException is thrown when an object
// appears more than once in the list of objects to WaitAll or WaitAny.
//
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class DuplicateWaitObjectException : ArgumentException {
+ public class DuplicateWaitObjectException : ArgumentException
+ {
+ private static volatile String s_duplicateWaitObjectMessage = null;
- private static volatile String _duplicateWaitObjectMessage = null;
-
- private static String DuplicateWaitObjectMessage {
- get {
- if (_duplicateWaitObjectMessage == null)
- _duplicateWaitObjectMessage = Environment.GetResourceString("Arg_DuplicateWaitObjectException");
- return _duplicateWaitObjectMessage;
+ private static String DuplicateWaitObjectMessage
+ {
+ get
+ {
+ if (s_duplicateWaitObjectMessage == null)
+ s_duplicateWaitObjectMessage = SR.Arg_DuplicateWaitObjectException;
+ return s_duplicateWaitObjectMessage;
}
}
// Creates a new DuplicateWaitObjectException with its message
// string set to a default message.
- public DuplicateWaitObjectException()
- : base(DuplicateWaitObjectMessage) {
- SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
+ public DuplicateWaitObjectException()
+ : base(DuplicateWaitObjectMessage)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
}
- public DuplicateWaitObjectException(String parameterName)
- : base(DuplicateWaitObjectMessage, parameterName) {
- SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
+ public DuplicateWaitObjectException(String parameterName)
+ : base(DuplicateWaitObjectMessage, parameterName)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
}
- public DuplicateWaitObjectException(String parameterName, String message)
- : base(message, parameterName) {
- SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
+ public DuplicateWaitObjectException(String parameterName, String message)
+ : base(message, parameterName)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
}
- public DuplicateWaitObjectException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
+ public DuplicateWaitObjectException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_DUPLICATEWAITOBJECT;
}
// This constructor is required for serialization
- protected DuplicateWaitObjectException(SerializationInfo info, StreamingContext context) : base (info, context) {
- }
+ protected DuplicateWaitObjectException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System;
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class EntryPointNotFoundException : TypeLoadException {
- public EntryPointNotFoundException()
- : base(Environment.GetResourceString("Arg_EntryPointNotFoundException")) {
- SetErrorCode(__HResults.COR_E_ENTRYPOINTNOTFOUND);
- }
-
- public EntryPointNotFoundException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_ENTRYPOINTNOTFOUND);
+ public class EntryPointNotFoundException : TypeLoadException
+ {
+ public EntryPointNotFoundException()
+ : base(SR.Arg_EntryPointNotFoundException)
+ {
+ HResult = __HResults.COR_E_ENTRYPOINTNOTFOUND;
}
-
- public EntryPointNotFoundException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_ENTRYPOINTNOTFOUND);
+
+ public EntryPointNotFoundException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_ENTRYPOINTNOTFOUND;
}
- protected EntryPointNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public EntryPointNotFoundException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_ENTRYPOINTNOTFOUND;
}
-
-
- }
+ protected EntryPointNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
+using System;
+
+namespace System
+{
// The base class for all event classes.
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public class EventArgs {
+ public class EventArgs
+ {
public static readonly EventArgs Empty = new EventArgs();
-
- public EventArgs()
+
+ public EventArgs()
{
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
+using System;
+
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
public delegate void EventHandler(Object sender, EventArgs e);
[Serializable]
**
=============================================================================*/
-namespace System {
+using System;
+using System.Runtime.Serialization;
- using System;
- using System.Runtime.Serialization;
+namespace System
+{
[Obsolete("This type previously indicated an unspecified fatal error in the runtime. The runtime no longer raises this exception so this type is obsolete.")]
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public sealed class ExecutionEngineException : SystemException {
- public ExecutionEngineException()
- : base(Environment.GetResourceString("Arg_ExecutionEngineException")) {
- SetErrorCode(__HResults.COR_E_EXECUTIONENGINE);
+ public sealed class ExecutionEngineException : SystemException
+ {
+ public ExecutionEngineException()
+ : base(SR.Arg_ExecutionEngineException)
+ {
+ HResult = __HResults.COR_E_EXECUTIONENGINE;
}
-
- public ExecutionEngineException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_EXECUTIONENGINE);
- }
-
- public ExecutionEngineException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_EXECUTIONENGINE);
+
+ public ExecutionEngineException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_EXECUTIONENGINE;
}
- internal ExecutionEngineException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public ExecutionEngineException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_EXECUTIONENGINE;
}
+
+ internal ExecutionEngineException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class FieldAccessException : MemberAccessException {
- public FieldAccessException()
- : base(Environment.GetResourceString("Arg_FieldAccessException")) {
- SetErrorCode(__HResults.COR_E_FIELDACCESS);
- }
-
- public FieldAccessException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_FIELDACCESS);
+ public class FieldAccessException : MemberAccessException
+ {
+ public FieldAccessException()
+ : base(SR.Arg_FieldAccessException)
+ {
+ HResult = __HResults.COR_E_FIELDACCESS;
}
-
- public FieldAccessException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_FIELDACCESS);
+
+ public FieldAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_FIELDACCESS;
}
- protected FieldAccessException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public FieldAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_FIELDACCESS;
}
+ protected FieldAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
-namespace System {
-
- using System;
+
+namespace System
+{
// Custom attribute to indicate that the enum
// should be treated as a bitfield (or set of flags).
// An IDE may use this information to provide a richer
// development experience.
[Serializable]
[AttributeUsage(AttributeTargets.Enum, Inherited = false)]
- [System.Runtime.InteropServices.ComVisible(true)]
public class FlagsAttribute : Attribute
{
public FlagsAttribute()
**
**
===========================================================*/
-namespace System {
-
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class FormatException : SystemException {
- public FormatException()
- : base(Environment.GetResourceString("Arg_FormatException")) {
- SetErrorCode(__HResults.COR_E_FORMAT);
- }
-
- public FormatException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_FORMAT);
+ public class FormatException : SystemException
+ {
+ public FormatException()
+ : base(SR.Arg_FormatException)
+ {
+ HResult = __HResults.COR_E_FORMAT;
}
-
- public FormatException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_FORMAT);
+
+ public FormatException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_FORMAT;
}
- protected FormatException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public FormatException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_FORMAT;
}
+ protected FormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
/*============================================================
**
-** Class: FormattableString
**
**
** Purpose: implementation of the FormattableString
** class.
**
===========================================================*/
+
namespace System
{
/// <summary>
** operation
**
===========================================================*/
-namespace System {
-
- using System;
- using System.Threading;
-[System.Runtime.InteropServices.ComVisible(true)]
+
+using System;
+using System.Threading;
+
+namespace System
+{
public interface IAsyncResult
{
bool IsCompleted { get; }
WaitHandle AsyncWaitHandle { get; }
- Object AsyncState { get; }
+ Object AsyncState { get; }
- bool CompletedSynchronously { get; }
-
-
+ bool CompletedSynchronously { get; }
}
-
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
+namespace System
+{
// The IComparable interface is implemented by classes that support an
// ordering of instances of the class. The ordering represented by
// IComparable can be used to sort arrays and collections of objects
// that implement the interface.
//
-[System.Runtime.InteropServices.ComVisible(true)]
public interface IComparable
{
- // Interface does not need to be marked with the serializable attribute
+ // Interface does not need to be marked with the serializable attribute
// Compares this object to another object, returning an integer that
// indicates the relationship. An implementation of this method must return
// a value less than zero if this is less than object, zero
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System.Diagnostics.Contracts;
- using System.Threading;
-
+namespace System
+{
// The IConvertible interface represents an object that contains a value. This
// interface is implemented by the following types in the System namespace:
// Boolean, Char, SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64,
- // Single, Double, Decimal, DateTime, TimeSpan, and String. The interface may
+ // Single, Double, Decimal, DateTime, and String. The interface may
// be implemented by other types that are to be considered values. For example,
// a library of nullable database types could implement IConvertible.
//
// IConvertible implementation should simply throw an InvalidCastException.
[CLSCompliant(false)]
- [System.Runtime.InteropServices.ComVisible(true)]
public interface IConvertible
{
// Returns the type code of this object. An implementation of this method
**
**
===========================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System;
+
+namespace System
+{
public interface ICustomFormatter
{
// Interface does not need to be marked with the serializable attribute
- String Format (String format, Object arg, IFormatProvider formatProvider);
+ String Format(String format, Object arg, IFormatProvider formatProvider);
}
}
**
**
===========================================================*/
-namespace System {
+
+namespace System
+{
// IDisposable is an attempt at helping to solve problems with deterministic
// finalization. The GC of course doesn't leave any way to deterministically
// know when a finalizer will run. This forces classes that hold onto OS
// data buffered by the StreamWriter cannot be written to the Stream. In this
// case, it doesn't make much sense to provide a finalizer on the StreamWriter
// since you cannot solve this problem correctly.
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface IDisposable {
+ public interface IDisposable
+ {
void Dispose();
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
+using System;
+
+namespace System
+{
public interface IEquatable<T>
{
bool Equals(T other);
}
-
}
**
**
============================================================*/
-namespace System {
-
- using System;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System;
+
+namespace System
+{
public interface IFormatProvider
{
// Interface does not need to be marked with the serializable attribute
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
- using System.Diagnostics.Contracts;
+using System;
+using System.Diagnostics.Contracts;
- [System.Runtime.InteropServices.ComVisible(true)]
+namespace System
+{
public interface IFormattable
{
[Pure]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-**
-**
-** Purpose: Interface for exposing an Observable in the
-** Observer pattern
-**
-**
-===========================================================*/
-
namespace System
{
public interface IObservable<out T>
{
IDisposable Subscribe(IObserver<T> observer);
}
-
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-**
-**
-** Purpose: Interface for exposing an Observer in the
-** Observer pattern
-**
-**
-===========================================================*/
-
-using System;
-
namespace System
{
public interface IObserver<in T>
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-**
-**
-** Purpose: Interface for providing progress updates.
-**
-**
-===========================================================*/
-
namespace System
{
/// <summary>Defines a provider for progress updates.</summary>
**
=============================================================================*/
-namespace System {
-
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public sealed class IndexOutOfRangeException : SystemException {
- public IndexOutOfRangeException()
- : base(Environment.GetResourceString("Arg_IndexOutOfRangeException")) {
- SetErrorCode(__HResults.COR_E_INDEXOUTOFRANGE);
- }
-
- public IndexOutOfRangeException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_INDEXOUTOFRANGE);
+ public sealed class IndexOutOfRangeException : SystemException
+ {
+ public IndexOutOfRangeException()
+ : base(SR.Arg_IndexOutOfRangeException)
+ {
+ HResult = __HResults.COR_E_INDEXOUTOFRANGE;
}
-
- public IndexOutOfRangeException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_INDEXOUTOFRANGE);
+
+ public IndexOutOfRangeException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INDEXOUTOFRANGE;
}
- internal IndexOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public IndexOutOfRangeException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_INDEXOUTOFRANGE;
}
+ internal IndexOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*=============================================================================
-**
-**
-**
-** Purpose: The exception class used when there is insufficient execution stack
-** to allow most Framework methods to execute.
-**
-**
-=============================================================================*/
-
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+namespace System
+{
[Serializable]
- public sealed class InsufficientExecutionStackException : SystemException
+ public sealed class InsufficientExecutionStackException : SystemException
{
public InsufficientExecutionStackException()
- : base(Environment.GetResourceString("Arg_InsufficientExecutionStackException"))
- {
- SetErrorCode(__HResults.COR_E_INSUFFICIENTEXECUTIONSTACK);
- }
-
- public InsufficientExecutionStackException(String message)
- : base(message)
+ : base(SR.Arg_InsufficientExecutionStackException)
{
- SetErrorCode(__HResults.COR_E_INSUFFICIENTEXECUTIONSTACK);
+ HResult = __HResults.COR_E_INSUFFICIENTEXECUTIONSTACK;
}
-
- public InsufficientExecutionStackException(String message, Exception innerException)
- : base(message, innerException)
+
+ public InsufficientExecutionStackException(String message)
+ : base(message)
{
- SetErrorCode(__HResults.COR_E_INSUFFICIENTEXECUTIONSTACK);
+ HResult = __HResults.COR_E_INSUFFICIENTEXECUTIONSTACK;
}
- private InsufficientExecutionStackException(SerializationInfo info, StreamingContext context)
- : base(info, context)
+ public InsufficientExecutionStackException(String message, Exception innerException)
+ : base(message, innerException)
{
+ HResult = __HResults.COR_E_INSUFFICIENTEXECUTIONSTACK;
}
-
+
+ internal InsufficientExecutionStackException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
/*=============================================================================
**
-**
-**
-** Purpose: Exception class for bad cast conditions!
-**
+** Purpose: Exception class for invalid cast conditions!
**
=============================================================================*/
-namespace System {
-
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class InvalidCastException : SystemException {
- public InvalidCastException()
- : base(Environment.GetResourceString("Arg_InvalidCastException")) {
- SetErrorCode(__HResults.COR_E_INVALIDCAST);
- }
-
- public InvalidCastException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_INVALIDCAST);
+ public class InvalidCastException : SystemException
+ {
+ public InvalidCastException()
+ : base(SR.Arg_InvalidCastException)
+ {
+ HResult = __HResults.COR_E_INVALIDCAST;
}
- public InvalidCastException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_INVALIDCAST);
+ public InvalidCastException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INVALIDCAST;
}
- protected InvalidCastException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public InvalidCastException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_INVALIDCAST;
}
- public InvalidCastException(String message, int errorCode)
- : base(message) {
- SetErrorCode(errorCode);
+ public InvalidCastException(String message, int errorCode)
+ : base(message)
+ {
+ HResult = errorCode;
}
+ protected InvalidCastException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
**
**
=============================================================================*/
-namespace System {
-
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
public class InvalidOperationException : SystemException
{
- public InvalidOperationException()
- : base(Environment.GetResourceString("Arg_InvalidOperationException")) {
- SetErrorCode(__HResults.COR_E_INVALIDOPERATION);
- }
-
- public InvalidOperationException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_INVALIDOPERATION);
+ public InvalidOperationException()
+ : base(SR.Arg_InvalidOperationException)
+ {
+ HResult = __HResults.COR_E_INVALIDOPERATION;
}
-
- public InvalidOperationException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_INVALIDOPERATION);
+
+ public InvalidOperationException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INVALIDOPERATION;
}
- protected InvalidOperationException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public InvalidOperationException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_INVALIDOPERATION;
}
+ protected InvalidOperationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
-
**
=============================================================================*/
-namespace System {
+using System.Runtime.Serialization;
- using System;
- using System.Runtime.Serialization;
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class InvalidProgramException : SystemException {
- public InvalidProgramException()
- : base(Environment.GetResourceString("InvalidProgram_Default")) {
- SetErrorCode(__HResults.COR_E_INVALIDPROGRAM);
+ public sealed class InvalidProgramException : SystemException
+ {
+ public InvalidProgramException()
+ : base(SR.InvalidProgram_Default)
+ {
+ HResult = __HResults.COR_E_INVALIDPROGRAM;
}
-
- public InvalidProgramException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_INVALIDPROGRAM);
- }
-
- public InvalidProgramException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_INVALIDPROGRAM);
+
+ public InvalidProgramException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_INVALIDPROGRAM;
}
- internal InvalidProgramException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public InvalidProgramException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_INVALIDPROGRAM;
}
+ internal InvalidProgramException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
namespace System
{
- [Serializable]
- [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
- public class InvalidTimeZoneException : Exception
- {
- public InvalidTimeZoneException(String message)
- : base(message) { }
+ [Serializable]
+ public class InvalidTimeZoneException : Exception
+ {
+ public InvalidTimeZoneException()
+ {
+ }
- public InvalidTimeZoneException(String message, Exception innerException)
- : base(message, innerException) { }
+ public InvalidTimeZoneException(String message)
+ : base(message)
+ {
+ }
- protected InvalidTimeZoneException(SerializationInfo info, StreamingContext context)
- : base(info, context) { }
+ public InvalidTimeZoneException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
- public InvalidTimeZoneException() { }
- }
+ protected InvalidTimeZoneException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-**
-** Purpose: Defines the root type for all marshal by reference aka
-** AppDomain bound types
-**
-**
-**
-===========================================================*/
namespace System
{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public abstract class MarshalByRefObject
+ public abstract class MarshalByRefObject
{
- protected MarshalByRefObject() { }
+ protected MarshalByRefObject()
+ {
+ }
+
public object GetLifetimeService()
{
throw new PlatformNotSupportedException();
}
+
public virtual object InitializeLifetimeService()
{
throw new PlatformNotSupportedException();
}
+
protected MarshalByRefObject MemberwiseClone(bool cloneIdentity)
{
MarshalByRefObject mbr = (MarshalByRefObject)base.MemberwiseClone();
// access, due to it being removed, private or something similar.
////////////////////////////////////////////////////////////////////////////////
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+
+namespace System
+{
// The MemberAccessException is thrown when trying to access a class
// member fails.
//
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class MemberAccessException : SystemException {
-
+ public class MemberAccessException : SystemException
+ {
// Creates a new MemberAccessException with its message string set to
// the empty string, its HRESULT set to COR_E_MEMBERACCESS,
// and its ExceptionInfo reference set to null.
- public MemberAccessException()
- : base(Environment.GetResourceString("Arg_AccessException")) {
- SetErrorCode(__HResults.COR_E_MEMBERACCESS);
+ public MemberAccessException()
+ : base(SR.Arg_AccessException)
+ {
+ HResult = __HResults.COR_E_MEMBERACCESS;
}
-
+
// Creates a new MemberAccessException with its message string set to
// message, its HRESULT set to COR_E_ACCESS,
// and its ExceptionInfo reference set to null.
//
- public MemberAccessException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_MEMBERACCESS);
- }
-
- public MemberAccessException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_MEMBERACCESS);
+ public MemberAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_MEMBERACCESS;
}
- protected MemberAccessException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public MemberAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_MEMBERACCESS;
}
+ protected MemberAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class MethodAccessException : MemberAccessException {
- public MethodAccessException()
- : base(Environment.GetResourceString("Arg_MethodAccessException")) {
- SetErrorCode(__HResults.COR_E_METHODACCESS);
- }
-
- public MethodAccessException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_METHODACCESS);
+ public class MethodAccessException : MemberAccessException
+ {
+ public MethodAccessException()
+ : base(SR.Arg_MethodAccessException)
+ {
+ HResult = __HResults.COR_E_METHODACCESS;
}
-
- public MethodAccessException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_METHODACCESS);
+
+ public MethodAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_METHODACCESS;
}
- protected MethodAccessException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public MethodAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_METHODACCESS;
}
+ protected MethodAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-
-namespace System {
-
-[System.Runtime.InteropServices.ComVisible(true)]
- public enum MidpointRounding {
+namespace System
+{
+ public enum MidpointRounding
+ {
ToEven = 0,
AwayFromZero = 1,
}
// This is thrown when you add multiple callbacks to a non-multicast delegate.
////////////////////////////////////////////////////////////////////////////////
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public sealed class MulticastNotSupportedException : SystemException {
-
- public MulticastNotSupportedException()
- : base(Environment.GetResourceString("Arg_MulticastNotSupportedException")) {
- SetErrorCode(__HResults.COR_E_MULTICASTNOTSUPPORTED);
- }
-
- public MulticastNotSupportedException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_MULTICASTNOTSUPPORTED);
+ public sealed class MulticastNotSupportedException : SystemException
+ {
+ public MulticastNotSupportedException()
+ : base(SR.Arg_MulticastNotSupportedException)
+ {
+ HResult = __HResults.COR_E_MULTICASTNOTSUPPORTED;
}
-
- public MulticastNotSupportedException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_MULTICASTNOTSUPPORTED);
+
+ public MulticastNotSupportedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_MULTICASTNOTSUPPORTED;
}
- internal MulticastNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public MulticastNotSupportedException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_MULTICASTNOTSUPPORTED;
}
+ internal MulticastNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- using System.Security.Permissions;
- using System.Diagnostics.Contracts;
+using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+namespace System
+{
[Serializable]
- public class NotFiniteNumberException : ArithmeticException {
+ public class NotFiniteNumberException : ArithmeticException
+ {
private double _offendingNumber;
public NotFiniteNumberException()
- : base(Environment.GetResourceString("Arg_NotFiniteNumberException")) {
+ : base(SR.Arg_NotFiniteNumberException)
+ {
_offendingNumber = 0;
- SetErrorCode(__HResults.COR_E_NOTFINITENUMBER);
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
}
public NotFiniteNumberException(double offendingNumber)
- : base() {
+ : base()
+ {
_offendingNumber = offendingNumber;
- SetErrorCode(__HResults.COR_E_NOTFINITENUMBER);
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
}
public NotFiniteNumberException(String message)
- : base(message) {
+ : base(message)
+ {
_offendingNumber = 0;
- SetErrorCode(__HResults.COR_E_NOTFINITENUMBER);
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
}
public NotFiniteNumberException(String message, double offendingNumber)
- : base(message) {
+ : base(message)
+ {
_offendingNumber = offendingNumber;
- SetErrorCode(__HResults.COR_E_NOTFINITENUMBER);
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
}
public NotFiniteNumberException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_NOTFINITENUMBER);
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
}
public NotFiniteNumberException(String message, double offendingNumber, Exception innerException)
- : base(message, innerException) {
+ : base(message, innerException)
+ {
_offendingNumber = offendingNumber;
- SetErrorCode(__HResults.COR_E_NOTFINITENUMBER);
+ HResult = __HResults.COR_E_NOTFINITENUMBER;
}
- protected NotFiniteNumberException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ protected NotFiniteNumberException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
_offendingNumber = info.GetInt32("OffendingNumber");
}
- public double OffendingNumber {
- get { return _offendingNumber; }
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context) {
- if (info==null) {
- throw new ArgumentNullException(nameof(info));
- }
- Contract.EndContractBlock();
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
base.GetObjectData(info, context);
info.AddValue("OffendingNumber", _offendingNumber, typeof(Int32));
}
+
+ public double OffendingNumber
+ {
+ get { return _offendingNumber; }
+ }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+namespace System
+{
[Serializable]
public class NotImplementedException : SystemException
{
- public NotImplementedException()
- : base(Environment.GetResourceString("Arg_NotImplementedException")) {
- SetErrorCode(__HResults.E_NOTIMPL);
+ public NotImplementedException()
+ : base(SR.Arg_NotImplementedException)
+ {
+ HResult = __HResults.E_NOTIMPL;
}
- public NotImplementedException(String message)
- : base(message) {
- SetErrorCode(__HResults.E_NOTIMPL);
+ public NotImplementedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.E_NOTIMPL;
}
- public NotImplementedException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.E_NOTIMPL);
+ public NotImplementedException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.E_NOTIMPL;
}
- protected NotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context) {
- }
+ protected NotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
public class NotSupportedException : SystemException
{
- public NotSupportedException()
- : base(Environment.GetResourceString("Arg_NotSupportedException")) {
- SetErrorCode(__HResults.COR_E_NOTSUPPORTED);
- }
-
- public NotSupportedException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_NOTSUPPORTED);
+ public NotSupportedException()
+ : base(SR.Arg_NotSupportedException)
+ {
+ HResult = __HResults.COR_E_NOTSUPPORTED;
}
-
- public NotSupportedException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_NOTSUPPORTED);
+
+ public NotSupportedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_NOTSUPPORTED;
}
- protected NotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public NotSupportedException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_NOTSUPPORTED;
}
+ protected NotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class NullReferenceException : SystemException {
- public NullReferenceException()
- : base(Environment.GetResourceString("Arg_NullReferenceException")) {
- SetErrorCode(__HResults.COR_E_NULLREFERENCE);
- }
-
- public NullReferenceException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_NULLREFERENCE);
+ public class NullReferenceException : SystemException
+ {
+ public NullReferenceException()
+ : base(SR.Arg_NullReferenceException)
+ {
+ HResult = __HResults.COR_E_NULLREFERENCE;
}
-
- public NullReferenceException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_NULLREFERENCE);
+
+ public NullReferenceException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_NULLREFERENCE;
}
- protected NullReferenceException(SerializationInfo info, StreamingContext context) : base(info, context) {}
+ public NullReferenceException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_NULLREFERENCE;
+ }
+ protected NullReferenceException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
- using System;
- using System.Runtime.Serialization;
- using System.Globalization;
- using System.Security.Permissions;
+using System.Globalization;
+using System.Runtime.Serialization;
+namespace System
+{
/// <devdoc>
/// <para> The exception that is thrown when accessing an object that was
/// disposed.</para>
/// </devdoc>
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class ObjectDisposedException : InvalidOperationException {
- private String objectName;
+ public class ObjectDisposedException : InvalidOperationException
+ {
+ private String _objectName;
// This constructor should only be called by the EE (COMPlusThrow)
- private ObjectDisposedException() :
- this(null ,Environment.GetResourceString("ObjectDisposed_Generic")) {
+ private ObjectDisposedException() :
+ this(null, SR.ObjectDisposed_Generic)
+ {
}
- public ObjectDisposedException(String objectName) :
- this(objectName, Environment.GetResourceString("ObjectDisposed_Generic")) {
+ public ObjectDisposedException(String objectName) :
+ this(objectName, SR.ObjectDisposed_Generic)
+ {
}
- public ObjectDisposedException(String objectName, String message) : base(message) {
- SetErrorCode(__HResults.COR_E_OBJECTDISPOSED);
- this.objectName = objectName;
+ public ObjectDisposedException(String objectName, String message) : base(message)
+ {
+ HResult = __HResults.COR_E_OBJECTDISPOSED;
+ _objectName = objectName;
}
- public ObjectDisposedException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_OBJECTDISPOSED);
+ public ObjectDisposedException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_OBJECTDISPOSED;
+ }
+
+ protected ObjectDisposedException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ _objectName = info.GetString("ObjectName");
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("ObjectName",ObjectName,typeof(String));
}
/// <devdoc>
/// <para>Gets the text for the message for this exception.</para>
/// </devdoc>
- public override String Message {
- get {
+ public override String Message
+ {
+ get
+ {
String name = ObjectName;
if (name == null || name.Length == 0)
return base.Message;
- String objectDisposed = Environment.GetResourceString("ObjectDisposed_ObjectName_Name", name);
+ String objectDisposed = SR.Format(SR.ObjectDisposed_ObjectName_Name, name);
return base.Message + Environment.NewLine + objectDisposed;
}
}
- public String ObjectName {
- get {
- if (objectName == null)
+ public String ObjectName
+ {
+ get
+ {
+ if ((_objectName == null)) // && !CompatibilitySwitches.IsAppEarlierThanWindowsPhone8)
{
return String.Empty;
}
- return objectName;
+ return _objectName;
}
}
-
- protected ObjectDisposedException(SerializationInfo info, StreamingContext context) : base(info, context) {
- objectName = info.GetString("ObjectName");
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context) {
- base.GetObjectData(info, context);
- info.AddValue("ObjectName",ObjectName,typeof(String));
- }
-
}
}
**
**
===========================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Remoting;
+
+using System;
+
+namespace System
+{
// This attribute is attached to members that are not to be used any longer.
// Message is some human readable explanation of what to use
// Error indicates if the compiler should treat usage of such a method as an
// error. (this would be used if the actual implementation of the obsolete
// method's implementation had changed).
//
-[Serializable]
-[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum |
- AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method| AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate
+ [Serializable]
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum |
+ AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate
, Inherited = false)]
-[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ObsoleteAttribute : Attribute
{
private String _message;
private bool _error;
-
- public ObsoleteAttribute ()
+
+ public ObsoleteAttribute()
{
_message = null;
_error = false;
}
-
- public ObsoleteAttribute (String message)
+
+ public ObsoleteAttribute(String message)
{
_message = message;
_error = false;
}
-
- public ObsoleteAttribute (String message, bool error)
+
+ public ObsoleteAttribute(String message, bool error)
{
_message = message;
_error = error;
}
-
- public String Message {
- get {return _message;}
+
+ public String Message
+ {
+ get { return _message; }
}
-
- public bool IsError{
- get {return _error;}
+
+ public bool IsError
+ {
+ get { return _error; }
}
-
}
}
**
=============================================================================*/
-namespace System {
-
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public class OverflowException : ArithmeticException {
- public OverflowException()
- : base(Environment.GetResourceString("Arg_OverflowException")) {
- SetErrorCode(__HResults.COR_E_OVERFLOW);
- }
-
- public OverflowException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_OVERFLOW);
+ public class OverflowException : ArithmeticException
+ {
+ public OverflowException()
+ : base(SR.Arg_OverflowException)
+ {
+ HResult = __HResults.COR_E_OVERFLOW;
}
-
- public OverflowException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_OVERFLOW);
+
+ public OverflowException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_OVERFLOW;
}
- protected OverflowException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public OverflowException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_OVERFLOW;
}
+ protected OverflowException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
-
}
**
**
=============================================================================*/
+
namespace System
{
-//This class contains only static members and does not need to be serializable
- [AttributeUsage (AttributeTargets.Parameter, Inherited=true, AllowMultiple=false)]
-[System.Runtime.InteropServices.ComVisible(true)]
- public sealed class ParamArrayAttribute : Attribute
- {
- public ParamArrayAttribute () {}
- }
+ [AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
+ public sealed class ParamArrayAttribute : Attribute
+ {
+ public ParamArrayAttribute() { }
+ }
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+namespace System
+{
[Serializable]
public class PlatformNotSupportedException : NotSupportedException
{
- public PlatformNotSupportedException()
- : base(Environment.GetResourceString("Arg_PlatformNotSupported")) {
- SetErrorCode(__HResults.COR_E_PLATFORMNOTSUPPORTED);
+ public PlatformNotSupportedException()
+ : base(SR.Arg_PlatformNotSupported)
+ {
+ HResult = __HResults.COR_E_PLATFORMNOTSUPPORTED;
}
-
- public PlatformNotSupportedException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_PLATFORMNOTSUPPORTED);
- }
-
- public PlatformNotSupportedException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_PLATFORMNOTSUPPORTED);
+
+ public PlatformNotSupportedException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_PLATFORMNOTSUPPORTED;
}
- protected PlatformNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public PlatformNotSupportedException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_PLATFORMNOTSUPPORTED;
}
+ protected PlatformNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-/*============================================================
-**
-**
-**
-**
-**
-** Purpose: Event-based implementation of IProgress<T>.
-**
-**
-===========================================================*/
-
using System;
using System.Threading;
using System.Diagnostics;
-using System.Diagnostics.Contracts;
namespace System
{
public class Progress<T> : IProgress<T>
{
/// <summary>The synchronization context captured upon construction. This will never be null.</summary>
- private readonly SynchronizationContext m_synchronizationContext;
+ private readonly SynchronizationContext _synchronizationContext;
/// <summary>The handler specified to the constructor. This may be null.</summary>
- private readonly Action<T> m_handler;
+ private readonly Action<T> _handler;
/// <summary>A cached delegate used to post invocation to the synchronization context.</summary>
- private readonly SendOrPostCallback m_invokeHandlers;
+ private readonly SendOrPostCallback _invokeHandlers;
/// <summary>Initializes the <see cref="Progress{T}"/>.</summary>
public Progress()
{
- // Capture the current synchronization context. "current" is determined by CurrentNoFlow,
- // which doesn't consider the sync ctx flown with an ExecutionContext, avoiding
- // sync ctx reference identity issues where the sync ctx for one thread could be Current on another.
+ // Capture the current synchronization context.
// If there is no current context, we use a default instance targeting the ThreadPool.
- m_synchronizationContext = SynchronizationContext.CurrentNoFlow ?? ProgressStatics.DefaultContext;
- Debug.Assert(m_synchronizationContext != null);
- m_invokeHandlers = new SendOrPostCallback(InvokeHandlers);
+ _synchronizationContext = SynchronizationContext.Current ?? ProgressStatics.DefaultContext;
+ Debug.Assert(_synchronizationContext != null);
+ _invokeHandlers = new SendOrPostCallback(InvokeHandlers);
}
/// <summary>Initializes the <see cref="Progress{T}"/> with the specified callback.</summary>
public Progress(Action<T> handler) : this()
{
if (handler == null) throw new ArgumentNullException(nameof(handler));
- m_handler = handler;
+ _handler = handler;
}
/// <summary>Raised for each reported progress value.</summary>
// If there's no handler, don't bother going through the sync context.
// Inside the callback, we'll need to check again, in case
// an event handler is removed between now and then.
- Action<T> handler = m_handler;
+ Action<T> handler = _handler;
EventHandler<T> changedEvent = ProgressChanged;
if (handler != null || changedEvent != null)
{
// Post the processing to the sync context.
// (If T is a value type, it will get boxed here.)
- m_synchronizationContext.Post(m_invokeHandlers, value);
+ _synchronizationContext.Post(_invokeHandlers, value);
}
}
{
T value = (T)state;
- Action<T> handler = m_handler;
+ Action<T> handler = _handler;
EventHandler<T> changedEvent = ProgressChanged;
if (handler != null) handler(value);
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
public class RankException : SystemException
{
- public RankException()
- : base(Environment.GetResourceString("Arg_RankException")) {
- SetErrorCode(__HResults.COR_E_RANK);
- }
-
- public RankException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_RANK);
+ public RankException()
+ : base(SR.Arg_RankException)
+ {
+ HResult = __HResults.COR_E_RANK;
}
-
- public RankException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_RANK);
+
+ public RankException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_RANK;
}
- protected RankException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public RankException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_RANK;
}
+ protected RankException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- public sealed class StackOverflowException : SystemException {
- public StackOverflowException()
- : base(Environment.GetResourceString("Arg_StackOverflowException")) {
- SetErrorCode(__HResults.COR_E_STACKOVERFLOW);
- }
-
- public StackOverflowException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_STACKOVERFLOW);
+ public sealed class StackOverflowException : SystemException
+ {
+ public StackOverflowException()
+ : base(SR.Arg_StackOverflowException)
+ {
+ HResult = __HResults.COR_E_STACKOVERFLOW;
}
-
- public StackOverflowException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_STACKOVERFLOW);
+
+ public StackOverflowException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_STACKOVERFLOW;
}
- internal StackOverflowException(SerializationInfo info, StreamingContext context) : base (info, context) {
+ public StackOverflowException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_STACKOVERFLOW;
}
-
+
+ internal StackOverflowException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
**
**
===========================================================*/
-namespace System{
-
+
+namespace System
+{
[Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public enum StringComparison {
+ public enum StringComparison
+ {
CurrentCulture = 0,
CurrentCultureIgnoreCase = 1,
InvariantCulture = 2,
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using System.Runtime.InteropServices;
-
namespace System
{
- [ComVisible(false)]
[Flags]
public enum StringSplitOptions
{
None = 0,
RemoveEmptyEntries = 1
}
-}
+}
\ No newline at end of file
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
public class SystemException : Exception
{
- public SystemException()
- : base(Environment.GetResourceString("Arg_SystemException")) {
- SetErrorCode(__HResults.COR_E_SYSTEM);
- }
-
- public SystemException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_SYSTEM);
+ public SystemException()
+ : base(SR.Arg_SystemException)
+ {
+ HResult = __HResults.COR_E_SYSTEM;
}
-
- public SystemException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_SYSTEM);
+
+ public SystemException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_SYSTEM;
}
- protected SystemException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public SystemException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_SYSTEM;
}
+
+ protected SystemException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
/*=============================================================================
**
-**
-**
** Purpose: For Threads-related custom attributes.
**
-**
=============================================================================*/
-namespace System {
- [AttributeUsage (AttributeTargets.Method)]
-[System.Runtime.InteropServices.ComVisible(true)]
+namespace System
+{
+ [AttributeUsage(AttributeTargets.Method)]
public sealed class STAThreadAttribute : Attribute
{
public STAThreadAttribute()
}
}
- [AttributeUsage (AttributeTargets.Method)]
-[System.Runtime.InteropServices.ComVisible(true)]
+ [AttributeUsage(AttributeTargets.Method)]
public sealed class MTAThreadAttribute : Attribute
{
public MTAThreadAttribute()
**
**
===========================================================*/
-namespace System {
-
- using System;
-[Serializable]
+using System;
+
+namespace System
+{
+ [Serializable]
[AttributeUsage(AttributeTargets.Field, Inherited = false)]
-[System.Runtime.InteropServices.ComVisible(true)]
- public class ThreadStaticAttribute : Attribute
+ public class ThreadStaticAttribute : Attribute
{
public ThreadStaticAttribute()
{
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
- using System.Runtime.Serialization;
- using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
- [Serializable]
- [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
- public class TimeZoneNotFoundException : Exception {
- public TimeZoneNotFoundException(String message)
- : base(message) { }
+namespace System
+{
+ [Serializable]
+ public class TimeZoneNotFoundException : Exception
+ {
+ public TimeZoneNotFoundException()
+ {
+ }
- public TimeZoneNotFoundException(String message, Exception innerException)
- : base(message, innerException) { }
+ public TimeZoneNotFoundException(String message)
+ : base(message)
+ {
+ }
- protected TimeZoneNotFoundException(SerializationInfo info, StreamingContext context)
- : base(info, context) { }
+ public TimeZoneNotFoundException(String message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
- public TimeZoneNotFoundException() { }
- }
+ protected TimeZoneNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
}
**
=============================================================================*/
-namespace System
-{
- using System.Runtime.Serialization;
+using System.Runtime.Serialization;
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public class TimeoutException : SystemException {
-
- public TimeoutException()
- : base(Environment.GetResourceString("Arg_TimeoutException")) {
- SetErrorCode(__HResults.COR_E_TIMEOUT);
+ public class TimeoutException : SystemException
+ {
+ public TimeoutException()
+ : base(SR.Arg_TimeoutException)
+ {
+ HResult = __HResults.COR_E_TIMEOUT;
}
-
- public TimeoutException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_TIMEOUT);
+
+ public TimeoutException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_TIMEOUT;
}
-
+
public TimeoutException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_TIMEOUT);
- }
-
- //
- //This constructor is required for serialization.
- //
- protected TimeoutException(SerializationInfo info, StreamingContext context)
- : base(info, context) {
+ : base(message, innerException)
+ {
+ HResult = __HResults.COR_E_TIMEOUT;
}
+
+ protected TimeoutException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
-
// See the LICENSE file in the project root for more information.
using System.ComponentModel;
-
using System.Runtime.CompilerServices;
namespace System
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-
using System.Runtime.Serialization;
-using System.Security;
namespace System
{
public class TypeAccessException : TypeLoadException
{
public TypeAccessException()
- : base(Environment.GetResourceString("Arg_TypeAccessException"))
+ : base(SR.Arg_TypeAccessException)
{
- SetErrorCode(__HResults.COR_E_TYPEACCESS);
+ HResult = __HResults.COR_E_TYPEACCESS;
}
- public TypeAccessException(string message)
+ public TypeAccessException(string message)
: base(message)
{
- SetErrorCode(__HResults.COR_E_TYPEACCESS);
+ HResult = __HResults.COR_E_TYPEACCESS;
}
-
- public TypeAccessException(string message, Exception inner)
+
+ public TypeAccessException(string message, Exception inner)
: base(message, inner)
{
- SetErrorCode(__HResults.COR_E_TYPEACCESS);
+ HResult = __HResults.COR_E_TYPEACCESS;
}
-
- protected TypeAccessException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- SetErrorCode(__HResults.COR_E_TYPEACCESS);
- }
+
+ protected TypeAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
// These types of values are instead represented as classes. When the type code
// of an object is TypeCode.Object, a further instance-of check can be used to
// determine if the object is one of these values.
-namespace System {
+
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum TypeCode {
+ public enum TypeCode
+ {
Empty = 0, // Null reference
Object = 1, // Instance that isn't a value
DBNull = 2, // Database null value
String = 18, // Unicode character string
}
}
-
-
**
**
=============================================================================*/
-using System;
-using System.Runtime.Serialization;
+
using System.Globalization;
-using System.Security.Permissions;
+using System.Runtime.Serialization;
-namespace System {
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class TypeInitializationException : SystemException {
+ public sealed class TypeInitializationException : SystemException
+ {
private String _typeName;
// This exception is not creatable without specifying the
// inner exception.
private TypeInitializationException()
- : base(Environment.GetResourceString("TypeInitialization_Default")) {
- SetErrorCode(__HResults.COR_E_TYPEINITIALIZATION);
+ : base(SR.TypeInitialization_Default)
+ {
+ HResult = __HResults.COR_E_TYPEINITIALIZATION;
+ }
+
+
+ public TypeInitializationException(String fullTypeName, Exception innerException)
+ : this(fullTypeName, SR.Format(SR.TypeInitialization_Type, fullTypeName), innerException)
+ {
}
// This is called from within the runtime. I believe this is necessary
// for Interop only, though it's not particularly useful.
- private TypeInitializationException(String message) : base(message) {
- SetErrorCode(__HResults.COR_E_TYPEINITIALIZATION);
+ internal TypeInitializationException(String message) : base(message)
+ {
+ HResult = __HResults.COR_E_TYPEINITIALIZATION;
}
-
- public TypeInitializationException(String fullTypeName, Exception innerException) : base(Environment.GetResourceString("TypeInitialization_Type", fullTypeName), innerException) {
+
+ internal TypeInitializationException(String fullTypeName, String message, Exception innerException)
+ : base(message, innerException)
+ {
_typeName = fullTypeName;
- SetErrorCode(__HResults.COR_E_TYPEINITIALIZATION);
+ HResult = __HResults.COR_E_TYPEINITIALIZATION;
}
- internal TypeInitializationException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ internal TypeInitializationException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
_typeName = info.GetString("TypeName");
}
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("TypeName", TypeName, typeof(String));
+ }
+
public String TypeName
{
- get {
- if (_typeName == null) {
+ get
+ {
+ if (_typeName == null)
+ {
return String.Empty;
}
return _typeName;
}
}
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context) {
- base.GetObjectData(info, context);
- info.AddValue("TypeName",TypeName,typeof(String));
- }
-
}
}
**
===========================================================*/
-using System;
using System.Runtime.Serialization;
-namespace System {
+namespace System
+{
// The UnauthorizedAccessException is thrown when access errors
// occur from IO or other OS methods.
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public class UnauthorizedAccessException : SystemException {
- public UnauthorizedAccessException()
- : base(Environment.GetResourceString("Arg_UnauthorizedAccessException")) {
- SetErrorCode(__HResults.COR_E_UNAUTHORIZEDACCESS);
+ public class UnauthorizedAccessException : SystemException
+ {
+ public UnauthorizedAccessException()
+ : base(SR.Arg_UnauthorizedAccessException)
+ {
+ HResult = __HResults.COR_E_UNAUTHORIZEDACCESS;
}
-
- public UnauthorizedAccessException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_UNAUTHORIZEDACCESS);
- }
-
- public UnauthorizedAccessException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_UNAUTHORIZEDACCESS);
+
+ public UnauthorizedAccessException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_UNAUTHORIZEDACCESS;
}
- protected UnauthorizedAccessException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ public UnauthorizedAccessException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_UNAUTHORIZEDACCESS;
}
+
+ protected UnauthorizedAccessException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
- using System.Runtime.ConstrainedExecution;
-
+namespace System
+{
[Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public class UnhandledExceptionEventArgs : EventArgs {
- private Object _Exception;
- private bool _IsTerminating;
+ public class UnhandledExceptionEventArgs : EventArgs
+ {
+ private Object _exception;
+ private bool _isTerminating;
- public UnhandledExceptionEventArgs(Object exception, bool isTerminating) {
- _Exception = exception;
- _IsTerminating = isTerminating;
+ public UnhandledExceptionEventArgs(Object exception, bool isTerminating)
+ {
+ _exception = exception;
+ _isTerminating = isTerminating;
}
- public Object ExceptionObject {
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- get { return _Exception; }
+
+ public Object ExceptionObject
+ {
+ get { return _exception; }
}
- public bool IsTerminating {
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- get { return _IsTerminating; }
+
+ public bool IsTerminating
+ {
+ get { return _isTerminating; }
}
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System {
-
- using System;
+namespace System
+{
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
public delegate void UnhandledExceptionEventHandler(Object sender, UnhandledExceptionEventArgs e);
}
// This class represents the void return type
////////////////////////////////////////////////////////////////////////////////
-namespace System {
-
- using System;
+namespace System
+{
+ // This class represents the void return type
[Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public struct Void
+ public struct Void
{
}
}