public override void Set(THolder holder, TElement[] value) { if (value == null) { Clear(holder); } else if (value.Length > 0) { base.Set(holder, value); } else { base.Set(holder, MiscHelpers.GetEmptyArray <TElement>()); } }
public object GetProperty(int index) { return(dispatchEx.GetProperty(index.ToString(CultureInfo.InvariantCulture), false, MiscHelpers.GetEmptyArray <object>())); }
public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return(MiscHelpers.GetEmptyArray <object>()); }
public override ParameterInfo[] GetIndexParameters() { return(MiscHelpers.GetEmptyArray <ParameterInfo>()); }
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. var reflect = obj as IReflect; if (reflect != null) { return(reflect.InvokeMember(name, BindingFlags.GetField, null, obj, MiscHelpers.GetEmptyArray <object>(), null, CultureInfo.InvariantCulture, null)); } throw new InvalidOperationException("Invalid field retrieval"); }
public static void ReceiveMessageAsync(this WebSocket webSocket, WebSocketMessageType type, Action <byte[], WebSocketCloseStatus, string> callback) { ReceiveMessageAsyncWorker(webSocket, type, MiscHelpers.GetEmptyArray <byte>(), callback); }