using System;
using System.Collections.Generic;
using System.Text;

namespace Winson.Framework.Controls
{
	public class CloudItem
	{
		public CloudItem()
		{
		}

		public CloudItem(string text, double weight)
		{
			this._text = text;
			this._weight = weight;
		}

		public CloudItem(string text, double weight, string href)
			: this(text, weight)
		{
			this._href = href;
		}

		public CloudItem(string text, double weight, string href, string title)
			: this(text, weight, href)
		{
			this._title = title;
		}

		private string _text;

		/// <summary>
		/// 设置/获取标签超连接的文本
		/// </summary>
		public string Text
		{
			get
			{
				return _text;
			}
			set
			{
				_text = value;
			}
		}

		private string _href;

		/// <summary>
        /// 设置/获取标签超连接URL
		/// </summary>
		public string Href
		{
			get
			{
				return _href;
			}
			set
			{
				_href = value;
			}
		}

		private string _title;

		/// <summary>
        /// 设置/获取标签超连接的提示标题
		/// </summary>
		public string Title
		{
			get
			{
				return _title;
			}
			set { _title = value; }
		}

		private double _weight;

		/// <summary>
        /// 设置/获取标签的文章数量
		/// </summary>
		public double Weight
		{
			get { return _weight; }
			set { _weight = value; }
		}

		#region 相关数据的序列化支持设置

		private bool ShouldSerializeWeight()
		{
			return _weight != 0;
		}

		private bool ShouldSerializeTitle()
		{
			return !String.IsNullOrEmpty(_title);
		}

		private bool ShouldSerializeText()
		{
			return !String.IsNullOrEmpty(_text);
		}

		private bool ShouldSerializeHref()
		{
			return !String.IsNullOrEmpty(_href);
		}

		#endregion

	}
}
