@* Generator: WebPagesHelper *@ @using System.Globalization @using System.Web @using System.Web.WebPages.Scope @using Microsoft.Internal.Web.Utils @using Resources @functions { private const string DefaultBoxWidth = "322px"; internal static readonly object _siteTitleKey = new object(); internal static readonly object _siteUrlKey = new object(); public static string SiteTitle { get { return ScopeStorage.CurrentScope[_siteTitleKey] as string; } set { if (value == null) { throw new ArgumentNullException("SiteTitle"); } ScopeStorage.CurrentScope[_siteTitleKey] = value; } } public static string SiteUrl { get { return ScopeStorage.CurrentScope[_siteUrlKey] as string; } set { if (value == null) { throw new ArgumentNullException("SiteUrl"); } ScopeStorage.CurrentScope[_siteUrlKey] = value; } } private static int GetCodePageFromRequest(HttpContextBase httpContext) { return httpContext.Response.ContentEncoding.CodePage; } private static string GetSiteUrl(IDictionary scopeStorage, string siteUrl) { object result; if (siteUrl.IsEmpty() && scopeStorage.TryGetValue(_siteUrlKey, out result)){ siteUrl = result as string; } return siteUrl; } private static string GetSiteTitle(IDictionary scopeStorage, string siteTitle) { object result; if (siteTitle.IsEmpty() && scopeStorage.TryGetValue(_siteTitleKey, out result)) { siteTitle = result as string; } return siteTitle; } } @helper SearchBox(string boxWidth = DefaultBoxWidth, string siteUrl = null, string siteTitle = null) { @_SearchBox(boxWidth, siteUrl, siteTitle, new HttpContextWrapper(HttpContext.Current), ScopeStorage.CurrentScope) } @helper _SearchBox(string boxWidth, string siteUrl, string siteTitle, HttpContextBase context, IDictionary scopeStorage) { siteTitle = GetSiteTitle(scopeStorage, siteTitle); siteUrl = GetSiteUrl(scopeStorage, siteUrl); string searchSite = String.IsNullOrEmpty(siteTitle) ? HelpersToolkitResources.BingSearch_DefaultSiteSearchText : siteTitle;
@if (!String.IsNullOrEmpty(siteUrl)) { }
 
}