pascalabcnet/Libraries/Debugger.Core/ThreadCollection.cs
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

43 lines
902 B
C#

// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using Debugger.Interop.CorDebug;
namespace Debugger
{
public class ThreadCollection: CollectionWithEvents<Thread>
{
public ThreadCollection(NDebugger debugger): base(debugger) {}
Thread selected;
public Thread Selected {
get { return selected; }
set { selected = value; }
}
public Thread Find(Predicate<Thread> predicate)
{
if (predicate == null)
return null;
foreach (var thread in this)
{
if (predicate(thread))
return thread;
}
return null;
}
internal bool Contains(ICorDebugThread corThread)
{
foreach(Thread thread in this) {
if (thread.CorThread == corThread) return true;
}
return false;
}
}
}