public SyncProviderViewModel(ISynchronizationProvider activeProvider, ISynchronizationManager synchronizationManager, bool isRecommended, Action configure = null, Action remove = null) { if (activeProvider == null) { throw new ArgumentNullException("activeProvider"); } this.provider = activeProvider; this.isRecommended = isRecommended; this.synchronizationMetadata = synchronizationManager.Metadata; if (configure == null) { configure = () => { } } ; if (remove == null) { remove = () => { } } ; this.configureCommand = new RelayCommand(configure); this.removeCommand = new RelayCommand(remove); if (this.provider != null && !string.IsNullOrWhiteSpace(this.provider.LoginInfo)) { if (this.provider.LoginInfo.Contains("@")) { var split = this.provider.LoginInfo.Split('@'); this.loginInfoPrimary = split[0]; if (split.Length > 1) { this.loginInfoSecondary = "@" + split[1]; } } else { this.loginInfoPrimary = this.provider.LoginInfo; } } else { this.loginInfoPrimary = string.Empty; this.loginInfoSecondary = string.Empty; } } }
private bool HasSyncProducedChanges(ISynchronizationMetadata metadata) { return(metadata.AfterSyncEditedTasks.Count > 0 || metadata.AfterSyncEditedFolders.Count > 0 || metadata.AfterSyncEditedContexts.Count > 0 || metadata.AfterSyncEditedSmartViews.Count > 0); }