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

using System.Collections;

namespace CommunityServer.Components
{
	/// <summary>
	/// Summary description for EmailFormatList.
	/// </summary>
	public class FeedLinkSet
	{
		//Internal collection
        Hashtable list = new Hashtable();

		/// <summary>
        /// Adds a new FeedLinkListItem to the internal collection
		/// </summary>
		/// <param name="value"></param>
        public void Add(FeedLinkItem value)
		{
		    list.Add(value.FeedUrl,value);
		}

        /// <summary>
        /// Updates an existing FeedLinkListItem in the internal collection
        /// </summary>
        /// <param name="value"></param>
        public void Update(FeedLinkItem value)
        {
            list[value.FeedUrl] = value;
        }
        /// <summary>
        /// removes the specified FeedLinkListItem from the internal collection
        /// </summary>
        /// <param name="value"></param>
        public void Remove(FeedLinkItem value)
        {
            list.Remove(value.FeedUrl);
        }

	    public bool ContainsFeed(FeedLinkItem value)
        {
            return list.ContainsKey(value.FeedUrl);
        }

        public bool ContainsFeed(string feedUrl)
        {
            return list.ContainsKey(feedUrl);
        }

	    public Hashtable List
	    {
	        get{ return list;}
	        set{ list = value;}
	    }
	}
    public class FeedLinkItem
    {
        private string _title = string.Empty;
        private string _feedUrl = string.Empty;
        private string _siteUrl = string.Empty;
        
        public FeedLinkItem()
        {
            
        }
        
        public FeedLinkItem(string title, string feedUrl, string siteUrl)
        {
            _title = title;
            _feedUrl = feedUrl;
            _siteUrl = siteUrl;
        }
        
        public string Title
        {
            get{ return _title;}
            set{ _title = value;}
        }

        public string FeedUrl
        {
            get { return _feedUrl; }
            set { _feedUrl = value; }
        }

        public string SiteUrl
        {
            get { return _siteUrl; }
            set { _siteUrl = value; }
        }
        
        public bool HasFeed
        {
            get {return FeedUrl != string.Empty;} 
        }
    }
}
