//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;

namespace CommunityServer.Components 
{
	/// <summary>
	/// A category into which links will be placed
	/// </summary>
	public class LinkCategory : IComparable
	{
		#region Constructor

		public LinkCategory() 
		{ }

		#endregion


		#region Properties

		public Int32 LinkCategoryID {
			get {
				return _blogLinkCategoryID;
			}
			set {
				_blogLinkCategoryID = value;
			}
		}
		private Int32 _blogLinkCategoryID;

		public Int32 SectionID {
			get {
				return _sectionID;
			}
			set {
				_sectionID = value;
			}
		}
		private Int32 _sectionID;

		public String Name {
			get {
				return _name;
			}
			set {
				_name = value;
			}
		}
		private String _name;

		public String Description {
			get {
				return _description;
			}
			set {
				_description = value;
			}
		}
		private String _description;

		public Boolean IsEnabled {
			get {
				return _isEnabled;
			}
			set {
				_isEnabled = value;
			}
		}
		private Boolean _isEnabled;

		public Int32 SortOrder {
			get {
				return _sortOrder;
			}
			set {
				_sortOrder = value;
			}
		}
		private Int32 _sortOrder = 0;

		private ArrayList _links;
		public ArrayList Links
		{
			get
			{
				if (_links == null)
					_links = new ArrayList();

				return _links;
			}
		}

		#endregion


		#region IComparable Members

		public int CompareTo(object obj)
		{
			if(obj is LinkCategory)
			{
				LinkCategory category = (LinkCategory)obj;
				return this.Name.CompareTo(category.Name);
			}
			throw new ArgumentException("Specified object is not of type LinkCategory");
		}

		#endregion
	}
}
