Exemple #1
0
        public BaseDxDataAccess(string confName, string connectionString)
        {
            IDbConnection conn = DxConnectionFactory.Instance.GetConnection(confName);

            //conn.ConnectionString = connectionString;
            mConn = new BaseDxConnection(conn);
            mConn.ConnectionString = connectionString;
        }
Exemple #2
0
 private static void ConnectionStatusChangeHandler(IDxConnection connection, ConnectionStatus oldStatus, ConnectionStatus newStatus)
 {
     if (newStatus == ConnectionStatus.Connected)
     {
         Console.WriteLine("Connected to {0}", connection.ConnectedAddress);
     }
     else if (newStatus == ConnectionStatus.Authorized)
     {
         Console.WriteLine("Authorized");
     }
 }
Exemple #3
0
        private static void ConnectionStatusChangeHandler(IDxConnection connection, ConnectionStatus oldStatus, ConnectionStatus newStatus)
        {
            switch (newStatus)
            {
            case ConnectionStatus.Connected:
                Console.WriteLine("Connected!");
                break;

            case ConnectionStatus.Authorized:
                Console.WriteLine("Authorized!");
                break;

            case ConnectionStatus.NotConnected:
                break;

            case ConnectionStatus.LoginRequired:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(newStatus), newStatus, null);
            }
        }
Exemple #4
0
 private static void DisconnectHandler(IDxConnection con)
 {
     Console.WriteLine("Disconnected");
 }
Exemple #5
0
 private static void OnDisconnect(IDxConnection con)
 {
     Interlocked.Exchange(ref isConnected, 0);
 }