Пример #1
0
            public override object GetValue(object obj)
            {
                // This occurs during VB-based dynamic script item invocation. It was not observed
                // before script items gained an IReflect/IExpando implementation that exposes
                // script item properties as fields. Apparently VB's dynamic invocation support not
                // only recognizes IReflect/IExpando but actually favors it over DynamicObject.

                if (obj is IReflect reflect)
                {
                    return(reflect.InvokeMember(Name, BindingFlags.GetField, null, obj, ArrayHelpers.GetEmptyArray <object>(), null, CultureInfo.InvariantCulture, null));
                }

                throw new InvalidOperationException("Invalid field retrieval");
            }
Пример #2
0
 public override ParameterInfo[] GetIndexParameters()
 {
     return(ArrayHelpers.GetEmptyArray <ParameterInfo>());
 }
Пример #3
0
 public override object[] GetCustomAttributes(Type attributeType, bool inherit)
 {
     return(ArrayHelpers.GetEmptyArray <object>());
 }
Пример #4
0
 public object GetProperty(int index)
 {
     return(dispatchEx.GetProperty(index.ToString(CultureInfo.InvariantCulture), false, ArrayHelpers.GetEmptyArray <object>()));
 }