public SyncingManager(ISyncConfigurationsProvider configurationsProvider) { _realm = Realm.GetInstance(configurationsProvider.ActiveConfiguration); var session = _realm.GetSession(); var downloadsObservable = session.GetProgressObservable(ProgressDirection.Download, ProgressMode.ReportIndefinitely); _token = downloadsObservable.Subscribe(this); _source = new CancellationTokenSource(); }
public AccountsRepository(ISyncConfigurationsProvider configurationsProvider) : base(configurationsProvider) { _notificationsToken = _items.SubscribeForNotifications((sender, changes, error) => { if (changes != null) { if (changes.InsertedIndices.Length != 0) { OnItemsInserted?.Invoke(this, changes.InsertedIndices); } if (changes.DeletedIndices.Length != 0) { OnItemsDeleted?.Invoke(this, changes.DeletedIndices); } if (changes.ModifiedIndices.Length != 0) { OnItemsModified?.Invoke(this, changes.ModifiedIndices); } } }); }
public BaseRepository(ISyncConfigurationsProvider configurationsProvider) { _realm = Realm.GetInstance(configurationsProvider.ActiveConfiguration); }
public TransactionsRepository(ISyncConfigurationsProvider configurationsProvider) : base(configurationsProvider) { _notificationsToken = SubscribeForNotifications(); }