protected virtual IStringSetter GetSetterFor(Type type) { #if !PCL return(DynamicPropertyCache.GetOrAdd( type, t => DynamicPropertyFactory.PropertyFor(GetPropertyFor(type))).Setter); #else if (DynamicPropertyCache.ContainsKey(type)) { return(DynamicPropertyCache[type].Setter); } lock (DynamicPropertyCache) { if (DynamicPropertyCache.ContainsKey(type)) { return(DynamicPropertyCache[type].Setter); } var r = DynamicPropertyFactory.PropertyFor(GetPropertyFor(type)); DynamicPropertyCache.Add(type, r); return(r.Setter); } #endif }
public virtual string GetPropertyNameFor(Type type) { #if !PCL return(DynamicPropertyCache.GetOrAdd( type, t => DynamicPropertyFactory.PropertyFor(GetPropertyFor(type))).Name); #else if (DynamicPropertyCache.ContainsKey(type)) { return(DynamicPropertyCache[type].Name); } lock (DynamicPropertyCache) { if (DynamicPropertyCache.ContainsKey(type)) { return(DynamicPropertyCache[type].Name); } var r = DynamicPropertyFactory.PropertyFor(GetPropertyFor(type)); DynamicPropertyCache.Add(type, r); return(r.Name); } #endif }
public virtual string GetPropertyNameFor(Type type) { return(DynamicPropertyCache.GetOrAdd( type, t => DynamicPropertyFactory.PropertyFor(GetPropertyFor(type))).Name); }
protected virtual IStringSetter GetSetterFor(Type type) { return(DynamicPropertyCache.GetOrAdd( type, t => DynamicPropertyFactory.PropertyFor(GetPropertyFor(type))).Setter); }