/Debugger/Debugger.Core/ProcessCollection.cs
http://github.com/icsharpcode/ILSpy · C# · 34 lines · 26 code · 5 blank · 3 comment · 4 complexity · f03707567feb12f86d250a890700f0f1 MD5 · raw file
- // 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 ProcessCollection: CollectionWithEvents<Process>
- {
- public ProcessCollection(NDebugger debugger): base(debugger) {}
-
- internal Process this[ICorDebugProcess corProcess] {
- get {
- foreach (Process process in this) {
- if (process.CorProcess == corProcess) {
- return process;
- }
- }
- return null;
- }
- }
- protected override void OnRemoved(Process item)
- {
- base.OnRemoved(item);
-
- if (this.Count == 0) {
- // Exit callback and then terminate the debugger
- this.Debugger.MTA2STA.AsyncCall( delegate { this.Debugger.TerminateDebugger(); } );
- }
- }
- }
- }