summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/InvalidCastException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/InvalidCastException.cs')
-rw-r--r--src/mscorlib/src/System/InvalidCastException.cs49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/mscorlib/src/System/InvalidCastException.cs b/src/mscorlib/src/System/InvalidCastException.cs
index ba7b722434..01d92b2837 100644
--- a/src/mscorlib/src/System/InvalidCastException.cs
+++ b/src/mscorlib/src/System/InvalidCastException.cs
@@ -4,42 +4,41 @@
/*=============================================================================
**
-**
-**
-** 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) { }
}
-
}