dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Exception.cs,1.16,1.17


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Exception.cs,1.16,1.17
Date: Sun, 06 Apr 2003 21:30:55 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv16833/runtime/System

Modified Files:
        Exception.cs 
Log Message:


Implementation serialization support code for "System.Exception".


Index: Exception.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Exception.cs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** Exception.cs        5 Apr 2003 06:58:12 -0000       1.16
--- Exception.cs        7 Apr 2003 01:30:52 -0000       1.17
***************
*** 53,56 ****
--- 53,59 ----
  
  public class Exception
+ #if !ECMA_COMPAT
+       : ISerializable
+ #endif
  {
  
***************
*** 64,67 ****
--- 67,74 ----
        private int hresult;
        private bool hresultSet;
+       private String stackTraceString;
+       private String remoteStackTraceString;
+       private int remoteStackIndex;
+       private String exceptionMethodString;
  #endif
  
***************
*** 86,90 ****
        protected Exception(SerializationInfo info, StreamingContext context)
                {
!                       // TODO
                }
  #endif
--- 93,114 ----
        protected Exception(SerializationInfo info, StreamingContext context)
                {
!                       if(info == null)
!                       {
!                               throw new ArgumentNullException("info");
!                       }
!                       message = info.GetString("Message");
!                       innerException = 
(Exception)(info.GetValue("InnerException",
!                                                                               
                           typeof(Exception)));
!                       helpLink = info.GetString("HelpURL");
!                       source = info.GetString("Source");
!                       stackTraceString = info.GetString("StackTraceString");
!                       remoteStackTraceString = 
info.GetString("RemoteStackTraceString");
!                       remoteStackIndex = info.GetInt32("RemoteStackIndex");
!                       exceptionMethodString = 
info.GetString("ExceptionMethod");
!                       hresult = info.GetInt32("HResult");
!                       if(hresult != 0)
!                       {
!                               hresultSet = true;
!                       }
                }
  #endif
***************
*** 247,250 ****
--- 271,281 ----
                        get
                        {
+                               if(source == null && stackTrace != null &&
+                                  stackTrace.Length > 0)
+                               {
+                                       MethodBase method = 
MethodBase.GetMethodFromHandle
+                                                               
(stackTrace[0].method);
+                                       source = 
method.DeclaringType.Module.Assembly.FullName;
+                               }
                                return source;
                        }
***************
*** 262,265 ****
--- 293,302 ----
                                        return (new StackTrace(this, 
true)).ToString();
                                }
+                       #if !ECMA_COMPAT
+                               else if(stackTraceString != null)
+                               {
+                                       return stackTraceString;
+                               }
+                       #endif
                                else
                                {
***************
*** 318,327 ****
  
  #if !ECMA_COMPAT
!       [TODO]
!       public virtual void GetObjectData (SerializationInfo info, 
!                                                                               
StreamingContext context)
!       {
!       }
! #endif
  
  }; // class Exception
--- 355,381 ----
  
  #if !ECMA_COMPAT
! 
!       // Get the serialization data for this exception object.
!       public virtual void GetObjectData(SerializationInfo info, 
!                                                                         
StreamingContext context)
!               {
!                       if(info == null)
!                       {
!                               throw new ArgumentNullException("info");
!                       }
!                       info.AddValue("ClassName", GetType().FullName, 
typeof(String));
!                       info.AddValue("Message", message, typeof(String));
!                       info.AddValue("InnerException", innerException, 
typeof(Exception));
!                       info.AddValue("HelpURL", helpLink, typeof(String));
!                       info.AddValue("Source", Source, typeof(String));
!                       info.AddValue("StackTraceString", StackTrace, 
typeof(String));
!                       info.AddValue("RemoteStackTraceString", 
remoteStackTraceString,
!                                                 typeof(String));
!                       info.AddValue("RemoteStackIndex", remoteStackIndex);
!                       info.AddValue("ExceptionMethod", exceptionMethodString);
!                       info.AddValue("HResult", HResult);
!               }
! 
! #endif // !ECMA_COMPAT
  
  }; // class Exception





reply via email to

[Prev in Thread] Current Thread [Next in Thread]