Пример #1
0
 /// <summary>
 /// Gets a value
 /// </summary>
 /// <param name="Name">Name of the item</param>
 /// <param name="ReturnType">Return value type</param>
 /// <returns>The returned value</returns>
 protected override object GetValue(string Name, Type ReturnType)
 {
     if (ContainsKey(Name))
     {
         return(InternalValues[Name].To(ReturnType, null));
     }
     if (!ChildValues.ContainsKey(Name))
     {
         var ObjectType = GetType();
         var Property   = ObjectType.GetProperty(Name);
         if (Property != null)
         {
             var Temp = Property.PropertyGetter <T>().Compile();
             ChildValues.AddOrUpdate(Name, x => () => Temp((T)this), (x, y) => () => Temp((T)this));
         }
         else
         {
             ChildValues.AddOrUpdate(Name, x => () => null, (x, y) => null);
         }
     }
     return(ChildValues[Name]().To(ReturnType, null));
 }
    public int GetValue()
    {
        ChildValues cv = new ChildValues();

        return(cv.Key2);
    }