+2004-03-08 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
+
+ * SystemException.cs: Exceptions set the HResult
+ * TypeLoadException.cs: Exceptions set the HResult, fixed wrong exception usage
+ * SByte.cs: Implemented two missing methods, fix wrong parameters for ArgumentNullException
+
2004-03-08 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* TypedReference.cs
bool digits_seen = false;
if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
+ throw new ArgumentNullException ("s");
len = s.Length;
c = s [i];
if (c == '+')
i++;
- else if (c == '-'){
+ else if (c == '-') {
neg = true;
i++;
}
- for (; i < len; i++){
+ for (; i < len; i++) {
c = s [i];
if (c >= '0' && c <= '9') {
DateTime IConvertible.ToDateTime (IFormatProvider provider)
{
- throw new NotImplementedException ();
+ return System.Convert.ToDateTime (value);
}
decimal IConvertible.ToDecimal (IFormatProvider provider)
object IConvertible.ToType (Type conversionType, IFormatProvider provider)
{
- throw new NotImplementedException ();
+ return System.Convert.ToType (value, conversionType, provider);
}
[CLSCompliant (false)]
[Serializable]
public class SystemException : Exception
{
+ const int Result = unchecked ((int)0x80131501);
+
// Constructors
public SystemException ()
: base (Locale.GetText ("A system exception has occurred."))
{
+ HResult = Result;
}
public SystemException (string message)
: base (message)
{
+ HResult = Result;
}
- protected SystemException(SerializationInfo info, StreamingContext context)
+ protected SystemException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
public SystemException (string message, Exception inner)
: base (message, inner)
{
+ HResult = Result;
}
}
}
//
// System.TypeLoadException.cs
//
-// Author:
+// Authors:
// Sean MacIsaac (macisaac@ximian.com)
// Duncan Mak (duncan@ximian.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
-using System.Globalization;
using System.Runtime.Serialization;
-namespace System {
-
+namespace System
+{
[Serializable]
- public class TypeLoadException : SystemException {
-
+ public class TypeLoadException : SystemException
+ {
+ const int Result = unchecked ((int)0x80131522);
+
// Fields
private string msg;
private string type;
- // Constructors
+ // Constructors
public TypeLoadException ()
: base (Locale.GetText ("A type load exception has occurred."))
{
+ HResult = Result;
}
public TypeLoadException (string message)
: base (message)
{
+ HResult = Result;
}
public TypeLoadException (string message, Exception inner)
: base (message, inner)
{
+ HResult = Result;
}
protected TypeLoadException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
if (info == null)
- throw new ArgumentNullException ("info is null.");
+ throw new ArgumentNullException ("info");
type = info.GetString ("TypeLoadClassName");
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
- throw new ArgumentNullException ("info is null.");
+ throw new ArgumentNullException ("info");
base.GetObjectData (info, context);
info.AddValue ("TypeLoadClassName", type, typeof (string));