internal RecordItemCommitScheduler(LocalRecordStoreTable recordStores) { if (recordStores == null) { throw new ArgumentNullException("recordStores"); } this.IsEnabled = false; // Let the app decide whether they want to use a timer, network monitoring, or both // Turned off by default m_monitorNetwork = false; m_timerPeriod = TimeSpan.Zero; m_recordStores = recordStores; m_lock = new object(); }
internal LocalRecordStore(IRecord record, IObjectStore parentStore, LocalRecordStoreTable recordStoreTable) { Initialize(record, parentStore, recordStoreTable); }
private void Initialize(IRecord record, IObjectStore parentStore, LocalRecordStoreTable recordStoreTable) { m_record = record; m_metadataLock = new CrossThreadLock(false); Task.Run(() => EnsureStores(parentStore, recordStoreTable)).Wait(); }
internal async Task EnsureStores(IObjectStore parentStore, LocalRecordStoreTable recordStoreTable) { m_root = await parentStore.CreateChildStoreAsync(m_record.ID); IObjectStore child; child = await m_root.CreateChildStoreAsync("Data"); LocalItemStore itemStore = new LocalItemStore(child, (recordStoreTable != null) ? recordStoreTable.ItemCache : null); child = await m_root.CreateChildStoreAsync("Changes"); RecordItemChangeTable changeTable = new RecordItemChangeTable(child, null); m_dataStore = new SynchronizedStore(m_record, itemStore, changeTable); child = await m_root.CreateChildStoreAsync("Metadata"); m_metadataStore = new LocalStore(child); child = await m_root.CreateChildStoreAsync("Blobs"); m_blobs = new LocalStore(child); m_synchronizedTypes = new SynchronizedTypeManager(this); }