Example #1
0
 /// <summary>
 /// Возвращает экземпляр класса EventManager
 /// </summary>
 /// <returns>Экземпляр класса EventManager</returns>
 static public EventManagerBD GetInstance()
 {
     if (instance == null)
     {
         instance = new EventManagerBD();
     }
     return(instance);
 }
Example #2
0
        private async void StartParse()
        {
            parser    = new ParserForNewFrontend("https://concertinfo.ru/");
            IsLoading = true;
            Events    = await parser.ParseAsync();

            if (Events == null)
            {
                Events = await EventManagerBD.GetInstance().LoadDataAsync();
            }
            IsLoading = false;
            FilterOptions.Locations = new List <string>(Events.Select((ev) => ev.Location).Distinct());
            Sort();
        }
Example #3
0
 public DataViewModel(FilterOptions fo)
 {
     FilterOptions = fo;
     FilterOptions.SubmitFilters = new RelayCommand(() => Sort());
     SortedEvents    = new ObservableCollection <Event>();
     Events          = new List <Event>();
     ClearSearchText = new RelayCommand(() => SearchText = "");
     Synchronize     = new RelayCommand(async() => {
         if (IsSynchronizing)
         {
             return;
         }
         IsSynchronizing = true;
         await EventManagerBD.GetInstance().SynchronizeAsync(Events);
         IsSynchronizing = false;
     });
     StartParse();
 }