private ObjectValueTypeAndConverterCollection GetConverters(string cacheKey, ObjectValueToPropertyValueConfigurationElementCollection configElements) { ObjectValueTypeAndConverterCollection result = (ObjectValueTypeAndConverterCollection)ObjectContextCache.Instance.GetOrAddNewValue( cacheKey, (cache, key) => { ObjectValueTypeAndConverterCollection instances = new ObjectValueTypeAndConverterCollection(); foreach (ObjectValueToPropertyValueConfigurationElement elem in configElements) { try { instances.Add(new ObjectValueTypeAndConverter(elem.GetObjectValueType(), (IObjectValueToPropertyValue)elem.CreateInstance())); } catch (System.Exception) { } } cache.Add(key, instances); return instances; }); return result; }
private ObjectValueTypeAndConverterCollection GetConverters(string cacheKey, ObjectValueToPropertyValueConfigurationElementCollection configElements) { ObjectValueTypeAndConverterCollection result = (ObjectValueTypeAndConverterCollection)ObjectContextCache.Instance.GetOrAddNewValue( cacheKey, (cache, key) => { ObjectValueTypeAndConverterCollection instances = new ObjectValueTypeAndConverterCollection(); foreach (ObjectValueToPropertyValueConfigurationElement elem in configElements) { try { instances.Add(new ObjectValueTypeAndConverter(elem.GetObjectValueType(), (IObjectValueToPropertyValue)elem.CreateInstance())); } catch (System.Exception) { } } cache.Add(key, instances); return(instances); }); return(result); }