瀏覽代碼

2005-10-25 Chris Toshok <[email protected]>

	* PositiveTimeSpanValidatorAttribute.cs: new implementation.


svn path=/trunk/mcs/; revision=52169
Chris Toshok 20 年之前
父節點
當前提交
d065c77458

+ 1 - 0
mcs/class/System.Configuration/System.Configuration.dll.sources

@@ -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

+ 2 - 0
mcs/class/System.Configuration/System.Configuration/ChangeLog

@@ -1,5 +1,7 @@
 2005-10-25  Chris Toshok  <[email protected]>
 
+	* PositiveTimeSpanValidatorAttribute.cs: new implementation.
+
 	* PositiveTimeSpanValidator.cs: new implementation.
 
 2005-10-24  Chris Toshok  <[email protected]>

+ 54 - 0
mcs/class/System.Configuration/System.Configuration/PositiveTimeSpanValidatorAttribute.cs

@@ -0,0 +1,54 @@
+//
+// System.Configuration.PositiveTimeSpanValidatorAttribute.cs
+//
+// Authors:
+//	Chris Toshok ([email protected])
+//
+// 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