Пример #1
0
        public void SafelyForEach(DelegateForEach <T> dfe)
        {
            Debug.Assert(dfe != null);

            lock (m_objLocker)
            {
                foreach (T objSource in this)
                {
                    dfe(objSource);
                }
            }
        }
Пример #2
0
        public virtual TValue SafelyForEach(DelegateForEach <TValue> dfe)
        {
            lock (m_oLocker)
            {
                foreach (TValue item in m_di.Values)
                {
                    if (dfe(item))
                    {
                        return(item);
                    }
                }
            }

            return(default(TValue));
        }
Пример #3
0
        public virtual T SafelyForEach(DelegateForEach <T> dfe)
        {
            lock (m_oLocker)
            {
                foreach (T item in m_list)
                {
                    if (dfe(item))
                    {
                        return(item);
                    }
                }
            }

            return(default(T));
        }
Пример #4
0
        public bool RemoveMatches(DelegateForEach <MatchLn> dfe)
        {
            Debug.Assert(dfe != null);

            SyncList <MatchLn> lAllMatches = m_diAll.Matches.ToSyncList();

            bool bSomeMatcheRemoved = false;

            foreach (var match in lAllMatches)
            {
                if (dfe(match))
                {
                    this.RemoveMatchWithoutCleaning(match);
                    bSomeMatcheRemoved = true;
                }
            }

            return(bSomeMatcheRemoved);
        }