Наследование: System.Dynamic.DynamicObject
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     try
     {
         if (_data[binder.Name].IsSimple)
             result = _data[binder.Name];
         else
             result = new WoopsaJsonDataDynamic(_data[binder.Name]);
         return true;
     }
     catch (Exception)
     {
         result = null;
         return false;
     }
 }
 public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
 {
     try
     {
         if (_data[(int)indexes[0]].IsSimple)
             result = _data[(int)indexes[0]];
         else
             result = new WoopsaJsonDataDynamic(_data[(int)indexes[0]]);
         return true;
     }
     catch (Exception)
     {
         result = null;
         return false;
     }
 }
Пример #3
0
 public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
 {
     try
     {
         if (_data[(int)indexes[0]].IsSimple)
         {
             result = _data[(int)indexes[0]];
         }
         else
         {
             result = new WoopsaJsonDataDynamic(_data[(int)indexes[0]]);
         }
         return(true);
     }
     catch (Exception)
     {
         result = null;
         return(false);
     }
 }
Пример #4
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     try
     {
         if (_data[binder.Name].IsSimple)
         {
             result = _data[binder.Name];
         }
         else
         {
             result = new WoopsaJsonDataDynamic(_data[binder.Name]);
         }
         return(true);
     }
     catch (Exception)
     {
         result = null;
         return(false);
     }
 }