public void SafelyForEach(DelegateForEach <T> dfe) { Debug.Assert(dfe != null); lock (m_objLocker) { foreach (T objSource in this) { dfe(objSource); } } }
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)); }
public virtual T SafelyForEach(DelegateForEach <T> dfe) { lock (m_oLocker) { foreach (T item in m_list) { if (dfe(item)) { return(item); } } } return(default(T)); }
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); }