2005-09-22 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Thu, 22 Sep 2005 17:08:12 +0000 (17:08 -0000)
committerChris Toshok <toshok@novell.com>
Thu, 22 Sep 2005 17:08:12 +0000 (17:08 -0000)
* PositiveTimeSpanValidator.cs: move this from
System.Configuration to here.

svn path=/trunk/mcs/; revision=50514

1  2 
mcs/class/System.Web/System.Web.Configuration/ChangeLog
mcs/class/System.Web/System.Web.Configuration/PositiveTimeSpanValidator.cs

index 7ed13d49daac445a869141c09f5da9125968b7d4,7ed13d49daac445a869141c09f5da9125968b7d4..aa5600f4183ed352e745aff07f63b44c2845d6f0
@@@ -1,3 -1,3 +1,8 @@@
++2005-09-22  Chris Toshok  <toshok@ximian.com>
++
++      * PositiveTimeSpanValidator.cs: move this from
++      System.Configuration to here.
++
  2005-09-15  Sebastien Pouliot  <sebastien@ximian.com>
  
        * CompilationConfiguration.cs: Return an empty configuration object if
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1bb695badff86e07c482adf360bce5eb2c5d20e2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,49 @@@
++//
++// System.Configuration.PositiveTimeSpanValidator.cs
++//
++// Authors:
++//  Lluis Sanchez Gual (lluis@novell.com)
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++// 
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++// 
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
++//
++
++#if NET_2_0
++
++using System.Configuration;
++
++namespace System.Web.Configuration
++{
++      public class PositiveTimeSpanValidator: ConfigurationValidatorBase
++      {
++              public override bool CanValidate (Type t)
++              {
++                      return t == typeof(TimeSpan);
++              }
++              
++              public override void Validate (object value)
++              {
++                      if (((TimeSpan)value).Ticks <= 0)
++                              throw new ConfigurationErrorsException ("TimeSpan value must be positive.");
++              }
++      }
++}
++#endif