コード例 #1
0
        public async void UploadData()
        {
            SyncManager SyncManager = new SyncManager();

            if (SyncManager.CheckSyncConditions(SyncPolicy.Default))
            {
                Log.Debug("SRS background data upload");
                if ((Reachability.InternetConnectionStatus() == NetworkStatus.ReachableViaWiFiNetwork) ||
                    (Reachability.InternetConnectionStatus() != NetworkStatus.ReachableViaWiFiNetwork && !Settings.PreferUnmeteredConnection))
                {
                    var src   = new CancellationTokenSource();
                    var token = src.Token;
                    await SyncManager.Synchronize(token);
                }
            }
            else
            {
                Log.Debug("SyncManager can't sync");
            }
        }