public BaseDxDataAccess(string confName, string connectionString) { IDbConnection conn = DxConnectionFactory.Instance.GetConnection(confName); //conn.ConnectionString = connectionString; mConn = new BaseDxConnection(conn); mConn.ConnectionString = connectionString; }
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"); } }
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); } }
private static void DisconnectHandler(IDxConnection con) { Console.WriteLine("Disconnected"); }
private static void OnDisconnect(IDxConnection con) { Interlocked.Exchange(ref isConnected, 0); }