2 using System.Collections.Generic;
5 using System.Threading;
7 namespace DirectOutput.General
14 #region IDisposable Member
22 GC.SuppressFinalize(
this);
30 protected virtual void Dispose(
bool disposing)
46 private Queue<Exception> _Exceptions =
new Queue<Exception>();
53 public IList<Exception> Exceptions
55 get {
return _Exceptions.ToList(); }
62 public void RecordException(Exception Exception)
64 _Exceptions.Enqueue(Exception);
65 if (_Exceptions.Count > 30)
67 _Exceptions.Dequeue();
78 public string HostName {
get;
set; }
86 public Thread Thread {
get;
set; }
94 public DateTime LastHeartBeat {
get;
private set; }
99 public void HeartBeat()
101 LastHeartBeat = DateTime.Now;
102 SetProcessorNumber();
105 private int _HeartBeatTimeOutMs=1000;
113 public int HeartBeatTimeOutMs
115 get {
return _HeartBeatTimeOutMs; }
116 set { _HeartBeatTimeOutMs = value; }
127 public int ProcessorNumber
133 private bool GetCurrentProcessorNumberIsAvailable =
false;
134 private void SetProcessorNumber()
136 if (GetCurrentProcessorNumberIsAvailable)
150 public string ThreadName
152 get {
return Thread.Name; }
166 return Thread.IsAlive;
176 this.Thread = Thread;
187 : this(Thread.CurrentThread)