예제 #1
0
 /// <summary>
 /// Returns dynamic property if one exists.
 /// </summary>
 /// <param name="property">Property to look up.</param>
 /// <param name="createCallback">callback function that will be called to create the dynamic property</param>
 /// <returns>An <see cref="IDynamicProperty"/> for the given property info.</returns>
 internal static IDynamicProperty GetDynamicProperty(PropertyInfo property, CreatePropertyCallback createCallback)
 {
     lock (propertyCacheLock)
     {
         IDynamicProperty dynamicProperty;
         if (!propertyCache.TryGetValue(property, out dynamicProperty))
         {
             dynamicProperty         = createCallback(property);
             propertyCache[property] = dynamicProperty;
         }
         return(dynamicProperty);
     }
 }
예제 #2
0
 /// <summary>
 /// Returns dynamic property if one exists.
 /// </summary>
 /// <param name="property">Property to look up.</param>
 /// <param name="createCallback">callback function that will be called to create the dynamic property</param>
 /// <returns>An <see cref="IDynamicProperty"/> for the given property info.</returns>
 internal static IDynamicProperty GetDynamicProperty(PropertyInfo property, CreatePropertyCallback createCallback)
 {
     lock (propertyCache.SyncRoot)
     {
         IDynamicProperty dynamicProperty = (IDynamicProperty)propertyCache[property];
         if (dynamicProperty == null)
         {
             dynamicProperty         = createCallback(property);
             propertyCache[property] = dynamicProperty;
         }
         return(dynamicProperty);
     }
 }
 /// <summary>
 /// Returns dynamic property if one exists.
 /// </summary>
 /// <param name="property">Property to look up.</param>
 /// <param name="createCallback">callback function that will be called to create the dynamic property</param>
 /// <returns>An <see cref="IDynamicProperty"/> for the given property info.</returns>
 internal static IDynamicProperty GetDynamicProperty(PropertyInfo property, CreatePropertyCallback createCallback)
 {
     lock (propertyCache.SyncRoot)
     {
         IDynamicProperty dynamicProperty = (IDynamicProperty)propertyCache[property];
         if (dynamicProperty == null)
         {
             dynamicProperty = createCallback(property);
             propertyCache[property] = dynamicProperty;
         }
         return dynamicProperty;
     }
 }
 /// <summary>
 ///     Returns dynamic property if one exists.
 /// </summary>
 /// <param name="property">Property to look up.</param>
 /// <param name="createCallback">callback function that will be called to create the dynamic property</param>
 /// <returns>An <see cref="IDynamicProperty" /> for the given property info.</returns>
 internal static IDynamicProperty GetDynamicProperty(PropertyInfo property, CreatePropertyCallback createCallback)
 {
     lock (_propertyCacheLock)
     {
         IDynamicProperty dynamicProperty;
         if (!_propertyCache.TryGetValue(property, out dynamicProperty))
         {
             dynamicProperty = createCallback(property);
             _propertyCache[property] = dynamicProperty;
         }
         return dynamicProperty;
     }
 }