Example #1
0
 private void Init()
 {
     var settingsManager = ServiceRegistration.Get<ISettingsManager>();
       _lSettings = settingsManager.Load<Locations>();
       if (_lSettings.LocationSetupList != null)
       {
     _selectedCinemas = _lSettings.LocationSetupList;
       }
       Cinemas.Clear();
       AddSelectedCinemasToAllCinemas();
       AddAllCinemas();
       Cinemas.FireChange();
 }
Example #2
0
        private static void Update()
        {
            _updateIsRunning = true;

              _settings = SETTINGS_MANAGER.Load<CinemaSettings>();
              _locations = SETTINGS_MANAGER.Load<Locations>();

              GoogleMovies.GoogleMovies.Data = new CinemaDataList { List = new List<CinemaData>() };

              if (_locations.LocationSetupList != null)
              {
            var cl = _locations.LocationSetupList;
            int percent = 100 / (cl.Count);

            foreach (var c in cl)
            {
              Info = c.Name;
              GoogleMovies.GoogleMovies.Data.List.Add(GoogleMovies.GoogleMovies.GetCinemaData(c));
              UpdateProgress += percent;
            }

            UpdateProgress = 0;

            GrappOtherInfos();
              }

              _settings.LastUpdate = DateTime.Today;
              ServiceRegistration.Get<ISettingsManager>().Save(_settings);

              _locations.Changed = false;
              ServiceRegistration.Get<ISettingsManager>().Save(_locations);

              var datalist = new Datalist { CinemaDataList = GoogleMovies.GoogleMovies.Data };
              ServiceRegistration.Get<ISettingsManager>().Save(datalist);

              _updateIsRunning = false;
        }