using System;

namespace CommunityServer.Spam
{
	/// <summary>
	/// A configurable setting that Spam Rules can use
	/// </summary>
	[Serializable]
	public class RuleSetting
	{
		#region Members...
		private Guid _ruleID;
		private string _key;
		private string _description;
		private string _defaultValue;
		private string _value;
		private int _maxValueLength = 10;
		#endregion

		#region Constructors...
		/// <summary>
		/// Default constructor
		/// </summary>
		public RuleSetting()
		{
		}


		/// <summary>
		/// 
		/// </summary>
		/// <param name="ruleID"></param>
		/// <param name="key"></param>
		/// <param name="description"></param>
		/// <param name="defaultValue"></param>
		public RuleSetting(Guid ruleID, string key, string description, string defaultValue) :
			this(ruleID, key, description, defaultValue, defaultValue)
		{
		}


		/// <summary>
		/// 
		/// </summary>
		/// <param name="ruleID"></param>
		/// <param name="key"></param>
		/// <param name="description"></param>
		/// <param name="defaultValue"></param>
		/// <param name="value"></param>
		public RuleSetting(Guid ruleID, string key, string description, string defaultValue, string value)
		{
			this._ruleID = ruleID;
			this._key = key;
			this._description = description;
			this._defaultValue = defaultValue;
			this._value = value;
		}


		/// <summary>
		/// 
		/// </summary>
		/// <param name="ruleID"></param>
		/// <param name="key"></param>
		/// <param name="description"></param>
		/// <param name="defaultValue"></param>
		/// <param name="maxValueLength"></param>
		public RuleSetting(Guid ruleID, string key, string description, string defaultValue, int maxValueLength) :
			this(ruleID, key, description, defaultValue, defaultValue, maxValueLength)
		{
		}


		/// <summary>
		/// 
		/// </summary>
		/// <param name="ruleID"></param>
		/// <param name="key"></param>
		/// <param name="description"></param>
		/// <param name="defaultValue"></param>
		/// <param name="value"></param>
		/// <param name="maxValueLength"></param>
		public RuleSetting(Guid ruleID, string key, string description, string defaultValue, string value, int maxValueLength)
		{
			this._ruleID = ruleID;
			this._key = key;
			this._description = description;
			this._defaultValue = defaultValue;
			this._value = value;
			this._maxValueLength = maxValueLength;
		}
		#endregion

		#region Properties...
		public Guid RuleID
		{
			get{return _ruleID;}
			set{_ruleID = value;}
		}

		public string Key
		{
			get{return _key;}
			set{_key = value;}
		}

		public string Description
		{
			get{return _description;}
			set{_description = value;}
		}

		public string DefaultValue
		{
			get { return _defaultValue; }
			set { _defaultValue = value; }
		}

		public string Value
		{
			get{return _value;}
			set{_value = value;}
		}

		public int MaxValueLength
		{
			get{return _maxValueLength;}
			set{_maxValueLength = value;}
		}
		#endregion
	}
}
