public ShowWord(Dispatcher context) { _locker = new object(); var intervalInMinutes = WordsSettings.WordsAsapSettings.WordDialogShowInterval; var interval = GetMiliseconds(intervalInMinutes); if (interval < MinimumShowInterval) { interval = GetMiliseconds(MinimumShowInterval); } _context = context; _showDialog = ShowDialog; _timer = new Timer { Enabled = false, Interval = interval }; _timer.Elapsed += OnElapsed; _random = new Random(); //TODO: refactor, handle correctly try { _wordsCollectionService = WordsCollectionService.CreateWordsCollectionService(WordsSettings.WordsAsapSettings); } catch (Exception e) { DefaultMessageService.MessageService.ShowErrorMessage("WordsAsap Error", e.ToString()); //TODO: add log } WordsSettings.SettingsChanged += WordsSettings_SettingsChanged; }
protected void ViewModelInit() { try { if (IsInDesignMode) { return; } _wordsCollectionService = WordsCollectionService.CreateWordsCollectionService(WordsSettings.WordsAsapSettings); InitializeModel(); } catch (Exception e) { if (MessagesService != null) { MessagesService.ShowErrorMessage("WordsAsap Error", e.ToString()); } DefaultMessageService.MessageService.ShowErrorMessage("WordsAsap Error", e.ToString()); //TODO: log } }
public WordViewModel() { _wordsCollectionService = WordsCollectionService.CreateWordsCollectionService(WordsSettings.WordsAsapSettings); Translations = new ObservableCollection <Translation>(); }
public LinqToEntitiesResultsProvider(WordsCollectionService wordService) { m_wordService = wordService; }