public SyncViewModel(ConnectionInfo server = new ConnectionInfo()) { Title = "Синхронизация"; LocalConnectionString = Nhib.ConnectionString; LocalProviderName = LocalConnectionString.Contains(".sdf") ? Constants.SqlCeProvider : Constants.SqlServerProvider; Remote = new DataConnectionViewModel(server); Poster.MessagePosted += syncer_MessagePosted; Syncer.SyncEnded += syncer_SyncEnded; }
public bool CanSync(bool local, bool remote) { bool result = !Syncer.InSync; if (local) { result &= !LocalConnectionString.IsNullOrEmpty() && (LocalProviderName == Constants.SqlCeProvider || LocalProviderName == Constants.SqlServerProvider); } if (remote) { result &= !RemoteConnectionString.IsNullOrEmpty() && (RemoteProviderName == Constants.SqlCeProvider || RemoteProviderName == Constants.SqlServerProvider); } return(result); }