Example #1
0
        protected object CachedCreateInstance(Type result, List <object> ctorArgs)
        {
            InstanceCacheKey icc = new InstanceCacheKey(ElementType, tWrapper, GetSettingCode(), isStatic);

            CachedConstructors[icc] = CreateConstructor(result, ctorArgs);
            return(CreateInstance(result, ctorArgs));
        }
Example #2
0
        protected object CachedCreateImpl()
        {
            InstanceCacheKey      icc = new InstanceCacheKey(ElementType, tWrapper, GetSettingCode(), isStatic);
            Func <object, object> result;

            if (CachedConstructors.TryGetValue(icc, out result))
            {
                return(result(Element));
            }
            return(CreateImpl());
        }
Example #3
0
 public bool Equals(InstanceCacheKey other)
 {
     return(elementType.Equals(other.elementType) && type.Equals(other.type) && v == other.v && isStatic == other.isStatic);
 }