⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 validationruleargs.cs

📁 改程序能够查询课程表
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Common.Utility.Validation
{
   /// <summary>
   /// Object that provides additional information about an validation rule.
   /// </summary>
   public class ValidationRuleArgs
   {
    	private string _propertyName;
      	private string _description;
		private object _tag;
		private string _friendlyName;

		/// <summary>
		/// Gets or sets the tag.
		/// </summary>
		/// <value>The tag.</value>
		[XmlIgnore]
		public object Tag
		{
			get { return _tag; }
			set { _tag = value; }
		}
		
		/// <summary>
		/// The name of the property to be validated.
		/// </summary>
		public string PropertyName
		{
			get { return _propertyName; }
		}
	
		/// <summary>
		/// Detailed description of why the rule was invalidated.  This should be set from the method handling the rule.
		/// </summary>
		public string Description
		{
			get { return _description; }
			set { _description = value; }
		}

		/// <summary>
		/// Friendly name to use in the validation error text.
		/// </summary>
		public string FriendlyName
		{
			get { return _friendlyName; }
			set { _friendlyName = value; }
		}
		
		/// <summary>
		/// Creates an instance of the object
		/// </summary>
		/// <param name="propertyName">The name of the property to be validated.</param>
		public ValidationRuleArgs(string propertyName)
		{
			_propertyName = propertyName;
			_friendlyName = propertyName;
		}

		/// <summary>
		/// Creates an instance of the object
		/// </summary>
		/// <param name="propertyName">The name of the property to be validated.</param>
		/// <param name="friendlyName">Friendly name to use in the validation error text.</param>
		public ValidationRuleArgs(string propertyName, string friendlyName)
		{
			_propertyName = propertyName;
			_friendlyName = friendlyName;
		}
		
		/// <summary>
		/// Return a string representation of the object.
		/// </summary>
		public override string ToString()
		{
			return _propertyName;
		}
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -