Exemplo n.º 1
0
        public IDsDocument ForceAdd(IDsDocument document, bool delayLoad, object data)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            lock (lockObj)
                documents.Add(document);

            CallCollectionChanged(NotifyDocumentCollectionChangedEventArgs.CreateAdd(document, data), delayLoad);
            return(document);
        }
Exemplo n.º 2
0
        public IDsDocument GetOrAdd(IDsDocument document)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            IDsDocument result;

            lock (lockObj)
                result = GetOrAdd_NoLock(document);
            if (result == document)
            {
                CallCollectionChanged(NotifyDocumentCollectionChangedEventArgs.CreateAdd(result, null));
            }
            return(result);
        }