internal CdmAttributeContext GetUnderContextFromCacheContext(ResolveOptions resOpt, AttributeContextParameters acpUsed) { // tree is found in cache, need a replacement tree node to put the sub-tree into. this replacement // needs to be build from the acp of the destination tree if (acpUsed != null) { return(CreateChildUnder(resOpt, acpUsed)); } return(null); }
internal static CdmAttributeContext GetUnderContextForCacheContext(ResolveOptions resOpt, CdmCorpusContext ctx, AttributeContextParameters acpUsed) { // a new context node is needed for these attributes, // this tree will go into the cache, so we hang it off a placeholder parent // when it is used from the cache (or now), then this placeholder parent is ignored and the things under it are // put into the 'receiving' tree if (acpUsed != null) { var acpCache = acpUsed.Copy(); CdmAttributeContext parentCtxForCache = new CdmAttributeContext(ctx, "cacheHolder") { Type = CdmAttributeContextType.PassThrough }; acpCache.under = parentCtxForCache; return(CreateChildUnder(resOpt, acpCache)); } return(null); }