2005-10-25 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Tue, 25 Oct 2005 04:17:27 +0000 (04:17 -0000)
committerChris Toshok <toshok@novell.com>
Tue, 25 Oct 2005 04:17:27 +0000 (04:17 -0000)
* PositiveTimeSpanValidatorAttribute.cs: new implementation.

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

mcs/class/System.Configuration/System.Configuration.dll.sources
mcs/class/System.Configuration/System.Configuration/ChangeLog
mcs/class/System.Configuration/System.Configuration/PositiveTimeSpanValidatorAttribute.cs [new file with mode: 0644]

index 5272b7c8b58faff68b219a7969d63f06f9de6164..26d4ede892507532f039728d48d0315c46ac5fe6 100644 (file)
@@ -77,6 +77,7 @@ System.Configuration/LongValidatorAttribute.cs
 System.Configuration/NameValueConfigurationCollection.cs
 System.Configuration/NameValueConfigurationElement.cs
 System.Configuration/PositiveTimeSpanValidator.cs
+System.Configuration/PositiveTimeSpanValidatorAttribute.cs
 System.Configuration/PropertyInformation.cs
 System.Configuration/PropertyInformationCollection.cs
 System.Configuration/PropertyValueOrigin.cs
index 91e26feefefabdfa2cab15d097293ad4d63f966a..54da26817199a8761187d246b472646daf7c61cd 100644 (file)
@@ -1,5 +1,7 @@
 2005-10-25  Chris Toshok  <toshok@ximian.com>
 
+       * PositiveTimeSpanValidatorAttribute.cs: new implementation.
+
        * PositiveTimeSpanValidator.cs: new implementation.
 
 2005-10-24  Chris Toshok  <toshok@ximian.com>
diff --git a/mcs/class/System.Configuration/System.Configuration/PositiveTimeSpanValidatorAttribute.cs b/mcs/class/System.Configuration/System.Configuration/PositiveTimeSpanValidatorAttribute.cs
new file mode 100644 (file)
index 0000000..13a1870
--- /dev/null
@@ -0,0 +1,54 @@
+//
+// System.Configuration.PositiveTimeSpanValidatorAttribute.cs
+//
+// Authors:
+//     Chris Toshok (toshok@ximian.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;
+
+namespace System.Configuration {
+
+       [AttributeUsage (AttributeTargets.Property)]
+       public sealed class PositiveTimeSpanValidatorAttribute : ConfigurationValidatorAttribute
+       {
+               ConfigurationValidatorBase instance;
+
+               public PositiveTimeSpanValidatorAttribute ()
+               {
+               }
+
+               public override ConfigurationValidatorBase ValidatorInstance {
+                       get {
+                               if (instance == null)
+                                       instance = new PositiveTimeSpanValidator ();
+
+                               return instance;
+                       }
+               }
+       }
+}
+
+#endif