Beispiel #1
0
        public static List <IRenderTask> Get(SiteDb SiteDb, Guid UniqueObjectId)
        {
            lock (_locker)
            {
                Dictionary <Guid, List <IRenderTask> > SitePageRenderPlan = null;
                if (SiteRenderPlans.ContainsKey(SiteDb.Id))
                {
                    SitePageRenderPlan = SiteRenderPlans[SiteDb.Id];
                }
                else
                {
                    SitePageRenderPlan         = new Dictionary <Guid, List <IRenderTask> >();
                    SiteRenderPlans[SiteDb.Id] = SitePageRenderPlan;
                }

                if (!SitePageRenderPlan.ContainsKey(UniqueObjectId))
                {
                    return(null);
                }
                else
                {
                    return(SitePageRenderPlan[UniqueObjectId]);
                }
            }
        }
Beispiel #2
0
        public static List <IRenderTask> GetOrAddRenderPlan(SiteDb SiteDb, Guid UniqueObjectId, Func <List <IRenderTask> > EvaluatePlan)
        {
            lock (_locker)
            {
                Dictionary <Guid, List <IRenderTask> > SitePageRenderPlan = null;
                if (SiteRenderPlans.ContainsKey(SiteDb.Id))
                {
                    SitePageRenderPlan = SiteRenderPlans[SiteDb.Id];
                }
                else
                {
                    SitePageRenderPlan         = new Dictionary <Guid, List <IRenderTask> >();
                    SiteRenderPlans[SiteDb.Id] = SitePageRenderPlan;
                }

                if (!SitePageRenderPlan.ContainsKey(UniqueObjectId))
                {
                    var plan = EvaluatePlan();
                    SitePageRenderPlan[UniqueObjectId] = plan;
                }
                //var plan = EvaluatePlan();
                //SitePageRenderPlan[UniqueObjectId] = plan;
                return(SitePageRenderPlan[UniqueObjectId]);
            }
        }