コード例 #1
0
ファイル: TWSServer.cs プロジェクト: dismalion/ib-net
 protected internal void OnError(TWSError error)
 {
     if (Error != null)
     {
         Error(this, new TWSServerErrorEventArgs(this, error));
     }
 }
コード例 #2
0
ファイル: EventHandlers.cs プロジェクト: dismalion/ib-net
 public TWSClientErrorEventArgs(TWSClient client, int tickerId, IBContract contract, TWSError error)
     : base(client)
 {
     RequestId = tickerId;
     Error = error;
     Contract = contract;
 }
コード例 #3
0
        private void OnError(int reqId, TWSError error)
        {
            if (Server != null)
            {
                Server.OnError(error);
            }

            if (Error != null)
            {
                Error(this, new TWSServerErrorEventArgs(this, error));
            }
        }
コード例 #4
0
ファイル: EventHandlers.cs プロジェクト: dismalion/ib-net
 public TWSServerErrorEventArgs(TWSServerClientState clientState, TWSError error)
     : base(clientState)
 {
     Error = error;
 }
コード例 #5
0
ファイル: EventHandlers.cs プロジェクト: dismalion/ib-net
 public TWSServerErrorEventArgs(TWSServer server, TWSError error)
     : base(server)
 {
     Error = error;
 }
コード例 #6
0
ファイル: TWSServer.cs プロジェクト: distagon/daemaged.ibnet
 protected internal void OnError(TWSError error)
 {
   if (Error != null)
     Error(this, new TWSServerErrorEventArgs(this, error));
 }
コード例 #7
0
ファイル: TWSClient.cs プロジェクト: distagon/daemaged.ibnet
    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,
          });
        }
      }
    }
コード例 #8
0
ファイル: TWSClient.cs プロジェクト: distagon/daemaged.ibnet
 protected virtual void OnError(TWSError error)
 {
   OnError(TWSErrors.NO_VALID_ID, error);
 }
コード例 #9
0
ファイル: TWSServer.cs プロジェクト: giladlevi/daemaged.ibnet
 protected internal void OnError(TWSError error)
 {
     Error?.Invoke(this, new TWSServerErrorEventArgs(this, error));
 }
コード例 #10
0
 private void OnError(TWSError error)
 {
   OnError(TWSErrors.NO_VALID_ID, error);
 }
コード例 #11
0
        void OnError(int reqId, TWSError error)
        {
            Server?.OnError(error);

            Error?.Invoke(this, new TWSServerErrorEventArgs(this, error));
        }
コード例 #12
0
 public TWSServerErrorEventArgs(TWSServerClientHandler clientState, TWSError error)
     : base(clientState)
 {
     Error = error;
 }
コード例 #13
0
 public TWSServerErrorEventArgs(TWSServer server, TWSError error)
     : base(server)
 {
     Error = error;
 }
コード例 #14
0
ファイル: EventHandlers.cs プロジェクト: dismalion/ib-net
 public TWSClientErrorEventArgs(TWSClient client, int tickerId, IBContract contract, TWSError error) : base(client)
 {
     RequestId = tickerId;
     Error     = error;
     Contract  = contract;
 }
コード例 #15
0
 private void OnError(TWSError error)
 {
     OnError(TWSErrors.NO_VALID_ID, error);
 }
コード例 #16
0
ファイル: TWSClient.cs プロジェクト: distagon/daemaged.ibnet
    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
      }
    }
コード例 #17
0
ファイル: TWSClient.cs プロジェクト: distagon/daemaged.ibnet
 public TWSServerException(TWSError twsError)
 {
   TWSError = twsError;
 }
コード例 #18
0
    private void OnError(int reqId, TWSError error)
    {
      if (Server != null)
        Server.OnError(error);

      if (Error != null)
        Error(this, new TWSServerErrorEventArgs(this, error));
    }
コード例 #19
0
ファイル: TWSClient.cs プロジェクト: dismalion/ib-net
        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));
            }
        }