private void RunProviderAction(ICartridgeProvider provider) { if (provider.IsLinked) { if (provider.IsSyncing) { // The provider is syncing. Show it. System.Windows.MessageBox.Show(String.Format("Your {0} account is linked, and the app is currently looking for or downloading cartridges.", provider.ServiceName), provider.ServiceName, MessageBoxButton.OK); } else { // The provider is linked but no cartridge has been downloaded yet. // Show it. if (System.Windows.MessageBox.Show(String.Format("Your {0} account is linked, but no cartridge has been downloaded yet.\nDo you want to sync again?", provider.ServiceName), provider.ServiceName, MessageBoxButton.OKCancel) == System.Windows.MessageBoxResult.OK) { provider.BeginSync(); } } } else { // The provider is not linked: try to do it. App.Current.ViewModel.NavigationManager.NavigateToProviderLinkWizard(provider); } }
private void OnProviderPropertyChanged(object sender, PropertyChangedEventArgs e) { ICartridgeProvider provider = (ICartridgeProvider)sender; if (AutoSyncProvidersOnLink && e.PropertyName == "IsLinked" && provider.IsLinked) { // The provider is now linked. Start syncing. provider.BeginSync(); } else if (e.PropertyName == "IsSyncing") { _isBusyAggregator[provider] = provider.IsSyncing; } }
private void RunProviderAction(ICartridgeProvider provider) { if (provider.IsLinked) { if (provider.IsSyncing) { // The provider is syncing. Show it. System.Windows.MessageBox.Show(String.Format("Your {0} account is linked, and the app is currently looking for or downloading cartridges.", provider.ServiceName), provider.ServiceName, MessageBoxButton.OK); } else { // The provider is linked but no cartridge has been downloaded yet. // Show it. if (System.Windows.MessageBox.Show(String.Format("Your {0} account is linked, but no cartridge has been downloaded yet.\nDo you want to sync again?", provider.ServiceName), provider.ServiceName, MessageBoxButton.OKCancel) == System.Windows.MessageBoxResult.OK) { provider.BeginSync(); } } } else { // The provider is not linked: try to do it. provider.BeginLink(); } }