Exemplo n.º 1
0
        public void Initialize(Xml.XAccessor x)
        {
            string strHostType = x.GetStringValue(CLASS);
            if (string.IsNullOrEmpty(strHostType))
                ExceptionHelper.ThrowPolicyInitNullError(this.GetType(), CLASS);
            Type hostType = Reflector.LoadType(strHostType);
            string memberName = x.GetStringValue(MEMBER);
            if (string.IsNullOrEmpty(memberName))
                ExceptionHelper.ThrowPolicyInitNullError(this.GetType(), MEMBER);

            IReflector r = Reflector.Bind(hostType, ReflectorPolicy.TypePublic);
            _instance = r.GetPropertyOrFieldValue(memberName, false);
        }