예제 #1
0
    void HandleDatabaseScenario(UserScenarioState loadedScenario, QuickUser user)
    {
        if (string.IsNullOrEmpty(loadedScenario.currentScenario))
        {
            return;
        }

        // If the scenario state from the database is too old, reset it and stop.
        DateTime parsedDate = JavascriptDateUtility.ToDateTime(loadedScenario.startDate);

        if ((DateTime.Now - parsedDate).TotalMinutes > 1)
        {
            ResetDatabaseScenario();
            return;
        }

        loadedScenario.user    = user;
        DatabaseScenario.Value = loadedScenario;
        return;
    }
예제 #2
0
 public UserScenarioState(string inCurrentScenario, QuickUser inUser)
 {
     currentScenario = inCurrentScenario;
     startDate       = JavascriptDateUtility.ToJavascript(DateTime.Now);
     user            = inUser;
 }