Example #1
0
        public IDnSpyFile ForceAdd(IDnSpyFile file, bool delayLoad, object data)
        {
            if (file == null)
            {
                throw new ArgumentNullException();
            }

            lock (lockObj)
                files.Add(file);

            CallCollectionChanged(NotifyFileCollectionChangedEventArgs.CreateAdd(file, data), delayLoad);
            return(file);
        }
Example #2
0
        public IDnSpyFile GetOrAdd(IDnSpyFile file)
        {
            if (file == null)
            {
                throw new ArgumentNullException();
            }

            IDnSpyFile result;

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