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)); }
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()); }
public bool Equals(InstanceCacheKey other) { return(elementType.Equals(other.elementType) && type.Equals(other.type) && v == other.v && isStatic == other.isStatic); }