nicko       2005/02/07 15:27:19

  Modified:    src/Util SystemInfo.cs
  Log:
  Fixed TryParse on NETCF
  
  Revision  Changes    Path
  1.11      +28 -0     logging-log4net/src/Util/SystemInfo.cs
  
  Index: SystemInfo.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Util/SystemInfo.cs,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SystemInfo.cs     7 Feb 2005 22:33:35 -0000       1.10
  +++ SystemInfo.cs     7 Feb 2005 23:27:19 -0000       1.11
  @@ -667,6 +667,19 @@
                /// </remarks>
                public static bool TryParse(string s, out int val)
                {
  +#if NETCF
  +                     val = 0;
  +                     try
  +                     {
  +                             val = int.Parse(s, 
System.Globalization.NumberStyles.Integer, 
System.Globalization.CultureInfo.InvariantCulture);
  +                             return true;
  +                     }
  +                     catch
  +                     {
  +                     }
  +
  +                     return false;
  +#else
                        // Initialise out param
                        val = 0;
   
  @@ -685,6 +698,7 @@
                        }
   
                        return false;
  +#endif
                }
   
                /// <summary>
  @@ -701,6 +715,19 @@
                /// </remarks>
                public static bool TryParse(string s, out long val)
                {
  +#if NETCF
  +                     val = 0;
  +                     try
  +                     {
  +                             val = long.Parse(s, 
System.Globalization.NumberStyles.Integer, 
System.Globalization.CultureInfo.InvariantCulture);
  +                             return true;
  +                     }
  +                     catch
  +                     {
  +                     }
  +
  +                     return false;
  +#else
                        // Initialise out param
                        val = 0;
   
  @@ -719,6 +746,7 @@
                        }
   
                        return false;
  +#endif
                }
   
                #endregion Public Static Methods
  
  
  

Reply via email to