Exemplo n.º 1
0
		/////////////////////////////////////////////////////////////////////////////

		public static object EvalMemberHelper( object parent, string memberName, TypeHelperDictionary typeHelpers )
		{
			// ******
			object value;

			// ******
			var oo = new ObjectInfo( parent, memberName );
			if( null != (value = oo.GetValue()) ) {
				return value;
			}

			// ******
			INmpDynamic dyn = parent as INmpDynamic;
			if( null != dyn ) {
				NmpDynamicType dynType = dyn.HasMember( memberName );

				switch( dynType ) {
					case NmpDynamicType.None:
						break;

					case NmpDynamicType.Property:
						return DynamicPropertyInvoker.Invoke( parent, memberName );

					case NmpDynamicType.Indexer:
						return new DynamicIndexerInvoker( parent, memberName );

					case NmpDynamicType.Method:
						return new DynamicMethodInvoker( parent, memberName );
				}
			}

			// ******
			object standin = typeHelpers.GetHelper( parent );
			if( null != standin ) {
				oo = new ObjectInfo( standin, memberName );
				if( null != (value = oo.GetValue()) ) {
					return value;
				}
			}

			// ******
			return null;
		}