Beispiel #1
0
        public PortalViewContext(ISettingDataAdapter settings, ISiteMarkerDataAdapter siteMarkers, ISnippetDataAdapter snippets,
                                 IWebLinkSetDataAdapter webLinks, IAdDataAdapter ads, IPollDataAdapter polls, IEntityUrlProvider urlProvider,
                                 SiteMapProvider siteMapProvider = null, string portalName = null, RequestContext requestContext = null)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            if (siteMarkers == null)
            {
                throw new ArgumentNullException("siteMarkers");
            }

            if (snippets == null)
            {
                throw new ArgumentNullException("snippets");
            }

            if (urlProvider == null)
            {
                throw new ArgumentNullException("urlProvider");
            }

            if (webLinks == null)
            {
                throw new ArgumentNullException("webLinks");
            }

            if (ads == null)
            {
                throw new ArgumentNullException("ads");
            }

            if (polls == null)
            {
                throw new ArgumentNullException("polls");
            }

            SiteMapProvider = siteMapProvider ?? (SiteMap.Enabled ? SiteMap.Provider : null);
            PortalName      = portalName;
            RequestContext  = requestContext;

            Settings    = settings;
            SiteMarkers = siteMarkers;
            Snippets    = snippets;
            UrlProvider = urlProvider;
            WebLinks    = webLinks;

            Ads = ads;

            Polls = polls;

            _currentSiteMapNode          = new Lazy <SiteMapNode>(GetCurrentSiteMapNode, LazyThreadSafetyMode.None);
            _currentSiteMapNodeAncestors = new Lazy <SiteMapNode[]>(GetCurrentSiteMapNodeAncestors, LazyThreadSafetyMode.None);
            _entity  = new Lazy <IPortalViewEntity>(GetEntity, LazyThreadSafetyMode.None);
            _user    = new Lazy <IPortalViewEntity>(GetUser, LazyThreadSafetyMode.None);
            _website = new Lazy <IPortalViewEntity>(GetWebsite, LazyThreadSafetyMode.None);
            _websiteAccessPermissionProvider = new Lazy <IWebsiteAccessPermissionProvider>(GetWebsiteAccessPermissionProvider, LazyThreadSafetyMode.None);
        }
Beispiel #2
0
        public PollPlacementsDrop(IPortalLiquidContext portalLiquidContext, IPollDataAdapter dataAdapter)
            : base(portalLiquidContext)
        {
            if (dataAdapter == null)
            {
                throw new ArgumentNullException("dataAdapter");
            }

            _dataAdapter = dataAdapter;
        }