Beispiel #1
0
        protected async override void OnStart()
        {
            // Handle when your app starts
            await CheckLockAsync(false);

            if (string.IsNullOrWhiteSpace(_uri))
            {
                Helpers.PerformUpdateTasks(_settings, _appInfoService, _databaseService);
                await Task.Run(() => FullSyncAsync()).ConfigureAwait(false);
            }

            if ((DateTime.UtcNow - _appSettingsService.LastCacheClear).TotalDays >= 1)
            {
                await Task.Run(() => _deviceActionService.ClearCache()).ConfigureAwait(false);
            }

            Debug.WriteLine("OnStart");
        }
Beispiel #2
0
        protected async override void OnStart()
        {
            // Handle when your app starts
            await CheckLockAsync(false);

            if (string.IsNullOrWhiteSpace(_uri))
            {
                var lastBuild = _settings.GetValueOrDefault <string>(LastBuildKey);
                if (InDebugMode() || lastBuild == null || lastBuild != _appInfoService.Build)
                {
                    _settings.AddOrUpdateValue(LastBuildKey, _appInfoService.Build);
                    _databaseService.CreateTables();
                }

                await Task.Run(() => FullSyncAsync()).ConfigureAwait(false);
            }

            if ((DateTime.UtcNow - _appSettingsService.LastCacheClear).TotalDays >= 1)
            {
                await Task.Run(() => _deviceActionService.ClearCache()).ConfigureAwait(false);
            }

            Debug.WriteLine("OnStart");
        }