private void QuickCalc() { DateTime now = DateTime.Now; REnv.LastInputTime = now.ToString(AppEnv.DTCulture); if (REnv.EndTime < now) { REnv.EndTime = now; } if (_isQuickOTCalc) { REnv.EndTime = REnv.EndTime.AddSeconds( REnv.OneRestoreInterval * (REnv.Resin / _quickOTCalcValue) * _quickOTCalcValue); _isQuickOTCalc = false; } else { REnv.EndTime = ((REnv.Resin - _quickCalcValue) < 0) ? now.AddSeconds(REnv.OneRestoreInterval * REnv.MaxResin) : REnv.EndTime.AddSeconds(REnv.OneRestoreInterval * _quickCalcValue); } REnv.UpdateSaveData(); }
private async Task SyncData() { SyncStatusTipLabel.IsVisible = false; ManualSyncButton.IsEnabled = false; ManualSyncButton.BorderColor = Color.Default; await Task.Delay(100); if (await SyncHelper.Update(SyncHelper.SyncTarget.Resin)) { REnv.UpdateSaveData(); ManualSyncButton.BorderColor = Color.Green; } else { ManualSyncButton.BorderColor = Color.OrangeRed; SyncStatusTipLabel.IsVisible = true; } ManualSyncButton.IsEnabled = true; }