private void OnWaitingLine(object o) { try { WaitingLineViewModel m = new WaitingLineViewModel(); WaitingLineView v = new WaitingLineView(); m.MainList = ListToObservableCollectionFactory.Convert(Event.ListeAttente.ToList()); v.ShowDialog(); } catch (Exception E) { ExceptionViewModel v = new ExceptionViewModel(E); ExceptionView ExceptionWindow = new ExceptionView(); ExceptionWindow.DataContext = v; ExceptionWindow.ShowDialog(); } }
public EventViewModel() { Localisation = TimeZone.CurrentTimeZone.StandardName; HasSearch = false; SpeechRecognitionTool = new SpeechToTextTools(); AddCommand = new DelegateCommand(OnAddCommand, CanExecuteAdd); EditCommand = new DelegateCommand(OnEditCommand, CanExecuteEdit); DeleteCommand = new DelegateCommand(OnDeleteCommand, CanExecuteDelete); MainVocalSearch = new DelegateCommand(OnMainVocalSearch, CanExecuteMainVocalSearch); AddEventCommand = new DelegateCommand(OnAddEventCommand, CanExecuteAddEvent); EditEventCommand = new DelegateCommand(OnEditEventCommand, CanExecuteEditEvent); DeleteEventCommand = new DelegateCommand(OnDeleteEventCommand, CanExecuteDeleteEvent); WaitingLineCommand = new DelegateCommand(OnWaitingLine, CanExecuteWaitingLine); ListeEvent = EventDAO.GetAllEvent(); ListeEventToShow = ListToObservableCollectionFactory.Convert(ListeEvent); ListeSpeaker = ListToObservableCollectionFactory.Convert(new List <Intervenant>()); ListeSpectator = ListToObservableCollectionFactory.Convert(new List <Internaute>()); }
private void UpdateListeSpectator() { if (SearchWordSpectator == "" || SearchWordSpectator == null) { ListeSpectator = ListToObservableCollectionFactory.Convert(Event.Inscrits); return; } ObservableCollection <Internaute> tmp = new ObservableCollection <Internaute>(); Regex r = new Regex("^.*" + SearchWordSpectator.ToLower() + ".*$"); for (int i = 0; i < Event.Inscrits.Count(); i++) { if (r.IsMatch(Event.Inscrits[i].Nom.ToLower())) { tmp.Add(Event.Inscrits[i]); } } ListeSpectator = tmp; NotifyPropertyChanged("ListeSpectator"); }
private void UpdateListeEvent() { if (SearchWord == "" || SearchWord == null) { ListeEventToShow = ListToObservableCollectionFactory.Convert(ListeEvent); return; } ObservableCollection <Evenement> tmp = new ObservableCollection <Evenement>(); Regex r = new Regex("^.*" + SearchWord.ToLower() + ".*$"); for (int i = 0; i < ListeEvent.Count(); i++) { if (r.IsMatch(ListeEvent[i].Nom.ToLower())) { tmp.Add(ListeEvent[i]); } } ListeEventToShow = tmp; NotifyPropertyChanged("ListeEventToShow"); }
private void OnDeleteEventCommand(object o) { try { if (Event == null) { throw (new Exception("Il n y a pas d'évènements à supprimer. Erreur:\n")); } ListeEvent.Remove(Event); ListeEventToShow = ListToObservableCollectionFactory.Convert(ListeEvent); Event = ListeEventToShow[0]; NotifyPropertyChanged("ListeEventToShow"); NotifyPropertyChanged("Event"); } catch (Exception E) { ExceptionViewModel v = new ExceptionViewModel(E); ExceptionView ExceptionWindow = new ExceptionView(); ExceptionWindow.DataContext = v; ExceptionWindow.ShowDialog(); } }