public async Task InitializeAsync(IMobileServiceLocalStore store, IMobileServiceSyncHandler handler, StoreTrackingOptions trackingOptions) { if (store == null) { throw new ArgumentNullException("store"); } handler = handler ?? new MobileServiceSyncHandler(); this.initializeTask = new TaskCompletionSource<object>(); using (await this.storeQueueLock.WriterLockAsync()) { this.Handler = handler; this.Store = store; this.storeTrackingOptions = trackingOptions; this.syncQueue = new ActionBlock(); await this.Store.InitializeAsync(); this.opQueue = await OperationQueue.LoadAsync(store); this.settings = new MobileServiceSyncSettingsManager(store); this.localOperationsStore = StoreChangeTrackerFactory.CreateTrackedStore(store, StoreOperationSource.Local, trackingOptions, this.client.EventManager, this.settings); this.initializeTask.SetResult(null); } }
public async Task InitializeAsync(IMobileServiceLocalStore store, IMobileServiceSyncHandler handler) { if (store == null) { throw new ArgumentNullException("store"); } handler = handler ?? new MobileServiceSyncHandler(); this.initializeTask = new TaskCompletionSource<object>(); using (await this.storeQueueLock.WriterLockAsync()) { this.Handler = handler; this.Store = store; this.syncQueue = new ActionBlock(); await this.Store.InitializeAsync(); this.opQueue = await OperationQueue.LoadAsync(store); this.settings = new MobileServiceSyncSettingsManager(store); this.initializeTask.SetResult(null); } }