Exemplo n.º 1
0
        private void OnConnected()
        {
            if (_criteria == null)
            {
                if (_exportStarted)
                {
                    return;
                }

                _exportStarted = true;
                Connected.SafeInvoke();

                var connectorSettings = _task.Settings as ConnectorHydraTaskSettings;

                if (connectorSettings != null && connectorSettings.IsDownloadNews)
                {
                    Connector.RegisterNews();
                }
            }
            else
            {
                ProcessLookupSecurities(_criteria, _newSecurity, _wasConnected);
                _criteria    = null;
                _isRefreshed = false;
            }
        }
Exemplo n.º 2
0
        public void Connect(string login, string password)
        {
            if (_ad.Connected)
            {
                _connState = ConnectionStates.Connected;
                Connected.SafeInvoke();
                return;
            }

            if (!login.IsEmpty() && !password.IsEmpty())
            {
                _ad.UserName = login;
                _ad.Password = password;
            }

            _connState    = ConnectionStates.Connecting;
            _ad.Connected = true;
        }
Exemplo n.º 3
0
        private void OnConnectionChanged(eConnectionState state)
        {
            try
            {
                _adapter.AddInfoLog("OnConnectionChanged {0}", state);

                switch (state)
                {
                case eConnectionState.Connected:
                    _connState = ConnectionStates.Connected;
                    Connected.SafeInvoke();
                    break;

                case eConnectionState.Disconnected:
                    if (_connState == ConnectionStates.Disconnecting)
                    {
                        Disconnected.SafeInvoke();
                    }
                    else
                    {
                        ConnectionError.SafeInvoke(new AlfaException(tagStateCodes.stcNotConnected, LocalizedStrings.Str1611));
                    }

                    _connState = ConnectionStates.Disconnected;

                    break;

                default:
                    ConnectionError.SafeInvoke(new InvalidOperationException("Error eConnectionState: " + state));
                    break;
                }
            }
            catch (Exception e)
            {
                _adapter.AddErrorLog(LocalizedStrings.Str2273Params, e);
                Error.SafeInvoke(e);
            }
        }
Exemplo n.º 4
0
 internal void OnConnected()
 {
     Connected.SafeInvoke();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Called when this connector has connected with Prepar3D.
 /// </summary>
 protected virtual void OnConnected()
 {
     // Send the event that says we have connected to the simulation.
     Connected.SafeInvoke(this, EventArgs.Empty);
 }
Exemplo n.º 6
0
 private void ConnectedHandler()
 {
     AddGuiAction(() => Connected.SafeInvoke());
 }
Exemplo n.º 7
0
 /// <summary>
 /// To call the event <see cref="Connector.Connected"/>.
 /// </summary>
 private void RaiseConnected()
 {
     ConnectionState = ConnectionStates.Connected;
     Connected.SafeInvoke();
 }
Exemplo n.º 8
0
        private void OnConnectionConnected(object sender, EventArgs e)
        {
            Log.LogInfo("[Peer] Connected to {0}", endPoint);

            Connected.SafeInvoke(this, e);
        }
Exemplo n.º 9
0
 /// <summary>
 /// The peer connection has been successfully established.
 /// </summary>
 protected virtual void OnConnected()
 {
     Connected.SafeInvoke(this, EventArgs.Empty);
 }