Example #1
0
        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);
        }
Example #2
0
 public IDsDocument Find(IDsDocumentNameKey key)
 {
     rwLock.EnterReadLock();
     try {
         return(Find_NoLock(key).Document);
     }
     finally {
         rwLock.ExitReadLock();
     }
 }
Example #3
0
 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);
 }
Example #4
0
        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);
        }
Example #5
0
        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));
            }
        }
Example #6
0
 DocumentInfo Find_NoLock(IDsDocumentNameKey key)
 {
     Debug2.Assert(key is not null);
     if (key is null)
     {
         return(default);
Example #7
0
 public IDsDocument?Find(IDsDocumentNameKey key) => Find(key, checkTempCache: false);
Example #8
0
 public IDsDocument Find(IDsDocumentNameKey key)
 {
     lock (lockObj)
         return(Find_NoLock(key));
 }
 IDsDocument FindDocument(IDsDocumentNameKey key) => documentProvider.Find(key);
Example #10
0
 public abstract IDsDocument Find(IDsDocumentNameKey key);
Example #11
0
 IDsDocument FindAssemblyByKey(IDsDocumentNameKey key) => documentService.Find(key);
Example #12
0
 DocumentInfo Find_NoLock(IDsDocumentNameKey key)
 {
     Debug.Assert(key != null);
     if (key == null)
     {
         return(default);
		IDsDocument FindAssemblyByKey(IDsDocumentNameKey key) => documentService.Find(key);