namespace Testing{
public partial class Test : Window{
private static Test _instance;
public static Test GetInstance(){
return _instance;
}
public DateTime LastHitTime { get; set; }
System.Windows.Threading.DispatcherTimer timer1 = new System.Windows.Threading.DispatcherTimer();
public Test(){
_instance = this;
InitializeComponent();
timer1.Tick += new EventHandler(timer1_Tick);
timer1.Interval = new TimeSpan(0, 0, 1);
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e){
LblOne.Content = LastHitTime.ToString("HH:mm:ss");
}
}
}
namespace Testing{
public class Hits : Log{
public void onHit(String text){
Test ui = Test.GetInstance();
ui.LastHitTime = System.DateTime.Now;
Log.DebugFormat("onIncoming: {0}", text);
}
}
}