2 using System.Collections.Generic;
16 private object ListUpdateLocker=
new object();
29 this[Thread.CurrentThread].HeartBeat();
31 catch (ArgumentException AE)
33 if (AE.ParamName ==
"Thread")
36 if (HostObject != null)
40 TI.
HostName = ((INamedItem)HostObject).Name;
44 TI.
HostName = HostObject.GetType().Name;
47 lock (ListUpdateLocker)
66 this[Thread.CurrentThread].HeartBeat();
68 catch (ArgumentException AE)
70 if (AE.ParamName ==
"Thread")
73 if(!HostObjectName.IsNullOrWhiteSpace()) {
77 lock (ListUpdateLocker)
91 HeartBeat(HostObject);
92 this[Thread.CurrentThread].RecordException(Exception);
103 if (this.Contains(Thread.CurrentThread))
105 lock (ListUpdateLocker)
107 this.Remove(
this[Thread.CurrentThread]);
124 if (Contains(Thread))
126 return this.First(TI => TI.Thread == Thread);
128 throw new ArgumentException(
"The ThreadInfoList does not contain a ThreadInfo object for thread {0}.".Build(Thread.Name),
"Thread");
142 return this.Any(TI=>TI.Thread==Thread);
This object provides information on a thread.
Interface for items which can be added the the NamedItemList.
List of ThreadInfo objects. This class is used by DOF for thread monitoring
void RecordException(Exception Exception, object HostObject=null)
This method records a exception which has been captured.
void ThreadTerminates()
Has to be called by the thread before it terminates. This command removes the thread from the List...
string HostName
Gets or sets the name of the object hosting the thread.
void HeartBeat(object HostObject=null)
Calls the HeartBeat method of the ThreadInfo object for the specified thread. If the specified threa...
The namespace DirectOutput.General contains classes for general use.
bool Contains(Thread Thread)
Determines whether the list contains a ThreadInfo object for the given thread.
void HeartBeat(string HostObjectName)
Calls the HeartBeat method of the ThreadInfo object for the specified thread. If the specified threa...