Example #1
0
    public string[] SelectAllSessions(string filterName)
    {
        if (type == DatabaseType.DEFAULT)
        {
            return(SqliteSession.SelectAllSessions(filterName));
        }
        else
        {
            SqliteGeneral sqliteGeneral = new SqliteGeneral(databasePath);
            if (!sqliteGeneral.IsOpened)
            {
                List <string> emptyResult = new List <string> ();
                return(emptyResult.ToArray());
            }
            SqliteConnection dbcon = sqliteGeneral.connection;

            string[] allSessions = SqliteSession.SelectAllSessions(filterName, dbcon);

            // Filtered sessions will contain all sessions but not the "SIMULATED"
            List <string> filteredSessions = new List <string> ();

            foreach (string session in allSessions)
            {
                if (session.Split(':') [1] != "SIMULATED")
                {
                    filteredSessions.Add(session);
                }
            }

            return(filteredSessions.ToArray());
        }
    }