public override Dynamic GetItem(Dynamic index) { const BindingFlags flags = BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding; object obj = NativeType.IsCOMObject ? NativeType.InvokeMember("Item", flags, null, handle, new[] { index.AsNativeObject }) : NativeType.InvokeMember("get_Item", flags, new DynamicBinder(), handle, new[] { index }); return(DynamicFactory.CreateDynamic(obj)); }
public override void SetItem(Dynamic index, Dynamic value) { const BindingFlags flags = BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding; if (NativeType.IsCOMObject) { NativeType.InvokeMember("Item", flags, null, handle, new[] { index.AsNativeObject, value.AsNativeObject }); } else { NativeType.InvokeMember("set_Item", flags, new DynamicBinder(), handle, new[] { index, value }); } }