public QuestionarySession(IQuestionsStore questions, IOptionsStore options) { _questions = questions; _options = options; _answeredQuestions = new List <Question>(); CurrentQuestionNumber = 1; Lifes = 5; Scores = 0; NextQuestion(); }
public QuestionsStoreSqlLite(IAppRuntimeSettings settings, IOptionsStore optionsStore) : base(settings) { _optionsStore = optionsStore; DB.DropTable <Question>(); DB.CreateTable <Question>(); if (!DB.Table <Question>().Any()) { var seeder = new QuestionsSeeder(this); seeder.Seed(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.RequestFeature(WindowFeatures.NoTitle); SetContentView(Resource.Layout.Questionary); _settings = new RuntimeSettingsAndroid(); _optionsStore = new OptionsStoreSqlLite(_settings); _questionsStore = new QuestionsStoreSqlLite(_settings, _optionsStore); _session = new QuestionarySession(_questionsStore, _optionsStore); _questionNumberTextView = FindViewById <TextView>(Resource.Id.QuestionNumberTextView); _questionTextView = FindViewById <TextView>(Resource.Id.QuestionTextView); _optionsListView = FindViewById <ListView>(Resource.Id.OptionsListView); _lifesTextView = FindViewById <TextView>(Resource.Id.LifesTextView); _scoresTextView = FindViewById <TextView>(Resource.Id.ScoresTextView); _optionsListView.ChoiceMode = ChoiceMode.Single; _optionsListView.ItemClick += OptionsListViewOnItemClick; UpdatePontuations(); PopulateQuestion(); }
public OptionsControlViewModel(IOptionsStore optionsStore) { _optionsStore = optionsStore; IskuFxVM = new IskuFxOptionsViewModel(optionsStore.IskuFxSettings); }