public WisdomViewModel(GuruViewModel guru, Wisdom wisdom, DateTime startedAt) { if (guru == null) { throw new ArgumentNullException("guru"); } if (wisdom == null) { throw new ArgumentNullException("wisdom"); } m_sharedAt = DateTime.Now; m_sharedElapsed = m_sharedAt - startedAt; lock (s_lastNrLock) { Nr = ++s_lastNr; } GuruViewModel = guru; Wisdom = wisdom; }
private void AskAGuruAQuestion(GuruViewModel guruViewModel, Question question) { try { var wisdomViewModel = guruViewModel.EnlightMe(question); if (CollectWisdom) { Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => WisdomViewModels.Insert(0, wisdomViewModel))); } } catch (Exception e) { m_log.Error(string.Format("AskAGuruAQuestion got an exception when asking # {0}: {1} the question {2}", guruViewModel.Nr, guruViewModel.Nick, question), e); } }
private void AddGuruToGuruViewModels(IGuru guru) { var guruViewModel = new GuruViewModel(guru); Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { GuruViewModels.Add(guruViewModel); OnPropertyChanged("AskInParallelIsPossible"); })); }