protected internal void OnError(TWSError error) { if (Error != null) { Error(this, new TWSServerErrorEventArgs(this, error)); } }
public TWSClientErrorEventArgs(TWSClient client, int tickerId, IBContract contract, TWSError error) : base(client) { RequestId = tickerId; Error = error; Contract = contract; }
private void OnError(int reqId, TWSError error) { if (Server != null) { Server.OnError(error); } if (Error != null) { Error(this, new TWSServerErrorEventArgs(this, error)); } }
public TWSServerErrorEventArgs(TWSServerClientState clientState, TWSError error) : base(clientState) { Error = error; }
public TWSServerErrorEventArgs(TWSServer server, TWSError error) : base(server) { Error = error; }
protected internal void OnError(TWSError error) { if (Error != null) Error(this, new TWSServerErrorEventArgs(this, error)); }
protected virtual void OnError(int reqId, TWSError error, string extraMessage = null) { if (Error != null) { TWSMarketDataSnapshot snapshot; IBContract contract = null; if (_marketDataRecords.TryGetValue(reqId, out snapshot)) contract = snapshot.Contract; Error(this, new TWSClientErrorEventArgs(this) { RequestId = reqId, Contract = contract, Error = error, Message = extraMessage, }); } if (OrderChanged != null) { OrderRecord or; if (_orderRecords.TryGetValue(reqId, out or)) { OrderChanged(this, new TWSOrderChangedEventArgs(this, or) { ChangeType = IBOrderChangeType.Error, Error = error, }); } } }
protected virtual void OnError(TWSError error) { OnError(TWSErrors.NO_VALID_ID, error); }
protected internal void OnError(TWSError error) { Error?.Invoke(this, new TWSServerErrorEventArgs(this, error)); }
private void OnError(TWSError error) { OnError(TWSErrors.NO_VALID_ID, error); }
void OnError(int reqId, TWSError error) { Server?.OnError(error); Error?.Invoke(this, new TWSServerErrorEventArgs(this, error)); }
public TWSServerErrorEventArgs(TWSServerClientHandler clientState, TWSError error) : base(clientState) { Error = error; }
private void ProcessErrorMessage() { var version = _enc.DecodeInt(); if (version < 2) { var message = _enc.DecodeString(); OnError(message); } else { #if NET_4_5 IFaultable completion = null; try { #endif var id = _enc.DecodeInt(); #if NET_4_5 _asyncCalls.TryGetValue(id, out completion); #endif var errorCode = _enc.DecodeInt(); var message = _enc.DecodeString(); var twsError = new TWSError(errorCode, message); #if NET_4_5 if (completion != null) completion.TrySetException(new TWSServerException(twsError)); else #endif OnError(id, twsError, String.Empty); #if NET_4_5 } catch (Exception e) { if (completion != null) completion.TrySetException(e); throw; } #endif } }
public TWSServerException(TWSError twsError) { TWSError = twsError; }
private void OnError(int reqId, TWSError error) { if (Server != null) Server.OnError(error); if (Error != null) Error(this, new TWSServerErrorEventArgs(this, error)); }
protected virtual void OnError(int reqId, TWSError error) { if (Error != null) { TWSMarketDataSnapshot snapshot; IBContract contract = null; if (_marketDataRecords.TryGetValue(reqId, out snapshot)) contract = snapshot.Contract; Error(this, new TWSClientErrorEventArgs(this, reqId, contract, error)); } }