using System;

namespace B4Restore.Common.Control
{
    public class BaseTabHelper
    {
        public virtual SerializableDictionary<string, SerializableDictionary<string, string>> GetDictionaryOfSiteMapFrom(string PageSource, string tabUrl, params string[] tabNames)
        {
            var l = new SerializableDictionary<string, SerializableDictionary<string, string>>();
            foreach (var s in tabNames)
            {
                l.Add(s, GetManualSiteMapNode(tabUrl));
            }

            return l;
        }

        protected virtual SerializableDictionary<string, string> GetManualSiteMapNode(string tabUrl)
        {
            return new SerializableDictionary<string, string>
	                   {
	                       {"NavigateUrl", tabUrl}
	                   };
        }

        public virtual string TabID
        {
			get { return System.Web.HttpContext.Current.Request.QueryString[UrlConst.TAB_ID] ?? String.Empty; }
        }
    }
}
