internal IDsDocument?Find(IDsDocumentNameKey key, bool checkTempCache) { IDsDocument doc; rwLock.EnterReadLock(); try { doc = Find_NoLock(key).Document; } finally { rwLock.ExitReadLock(); } if (doc is not null) { return(doc); } if (checkTempCache) { lock (tempCacheLock) { foreach (var document in tempCache) { if (key.Equals(document.Key)) { return(document); } } } } return(null); }
public IDsDocument Find(IDsDocumentNameKey key) { rwLock.EnterReadLock(); try { return(Find_NoLock(key).Document); } finally { rwLock.ExitReadLock(); } }
IDsDocument Find_NoLock(IDsDocumentNameKey key) { Debug.Assert(key != null); if (key == null) { return(null); } foreach (var document in documents) { if (key.Equals(document.Key)) { return(document); } } return(null); }
IDsDocument Remove_NoLock(IDsDocumentNameKey key) { if (key == null) { return(null); } for (int i = 0; i < documents.Count; i++) { if (key.Equals(documents[i].Key)) { documents.RemoveAt(i); return(documents[i]); } } return(null); }
public void Remove(IDsDocumentNameKey key) { Debug.Assert(key != null); if (key == null) { return; } IDsDocument removedDocument; lock (lockObj) removedDocument = Remove_NoLock(key); Debug.Assert(removedDocument != null); if (removedDocument != null) { CallCollectionChanged(NotifyDocumentCollectionChangedEventArgs.CreateRemove(removedDocument, null)); } }
DocumentInfo Find_NoLock(IDsDocumentNameKey key) { Debug2.Assert(key is not null); if (key is null) { return(default);
public IDsDocument?Find(IDsDocumentNameKey key) => Find(key, checkTempCache: false);
public IDsDocument Find(IDsDocumentNameKey key) { lock (lockObj) return(Find_NoLock(key)); }
IDsDocument FindDocument(IDsDocumentNameKey key) => documentProvider.Find(key);
public abstract IDsDocument Find(IDsDocumentNameKey key);
IDsDocument FindAssemblyByKey(IDsDocumentNameKey key) => documentService.Find(key);
DocumentInfo Find_NoLock(IDsDocumentNameKey key) { Debug.Assert(key != null); if (key == null) { return(default);