/// <summary> /// начать процесс подключения /// </summary> private void Connect() { if (string.IsNullOrEmpty(ClientIdInSystem)) { SendLogMessage("В значении номер Id не верное значение. Подключение прервано.", LogMessageType.Error); _serverStatusNead = ServerConnectStatus.Disconnect; return; } _Client.Connect(ClientIdInSystem, Token, IsTestConnection); _lastStartServerTime = DateTime.Now; Thread.Sleep(5000); }
public void Connect() { if (_client == null) { _client = new OandaClient(); _client.ConnectionFail += ClientOnConnectionFail; _client.ConnectionSucsess += ClientOnConnectionSucsess; _client.LogMessageEvent += ClientOnLogMessageEvent; _client.NewMyTradeEvent += ClientOnNewMyTradeEvent; _client.NewOrderEvent += ClientOnNewOrderEvent; _client.NewTradeEvent += ClientOnNewTradeEvent; _client.PortfolioChangeEvent += ClientOnPortfolioChangeEvent; _client.NewSecurityEvent += ClientOnNewSecurityEvent; _client.MarketDepthChangeEvent += ClientOnMarketDepthChangeEvent; } _client.Connect(((ServerParameterString)ServerParameters[0]).Value, ((ServerParameterPassword)ServerParameters[1]).Value, ((ServerParameterBool)ServerParameters[2]).Value); }