Core/CafeLib.Core.Dynamic/Expando.cs
/// <summary>
/// Try to retrieve a member by name first from instance properties
/// followed by the collection entries.
/// </summary>
/// <param name="binder"></param>
/// <param name="result"></param>
/// <returns></returns>
Try to retrieve a member by name first from instance properties
followed by the collection entries.
Try to retrieve a member by name first from instance properties followed by the collection entries .
public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            result = null;
            if (Properties.Keys.Contains(binder.Name))
            {
                result = Properties[binder.Name];
                return true;
            }
            if (_instance != null)
            {
                try
                {
                    return GetProperty(_instance, binder.Name, out result);
                }
                catch
                {
                }
            }
            return false;
        }
public override bool TryGetMember ( GetMemberBinder binder , out object result ) { result = null ; if ( Properties . Keys . Contains ( binder . Name ) ) { result = Properties [ binder . Name ] ; return true ; } if ( _instance != null ) { try { return GetProperty ( _instance , binder . Name , out result ) ; } catch { } } return false ; }
Try to retrieve a member by name first from instance properties
followed by the collection entries.
Try to retrieve a member by name first from instance properties followed by the collection entries .
// first check the Properties collection for member // Next check for Public properties via Reflection // ignored // failed to retrieve a property
None
binder
GetMemberBinder
None
object
out
result
None