Added project files, source files, and assets.
As long as you have IronPython 2.7.3 you should be able to compile now with this commit.
This commit is contained in:
parent
a62ee2f168
commit
51e217e38c
79 changed files with 6968 additions and 0 deletions
53
code/src/TimerPlus.cs
Normal file
53
code/src/TimerPlus.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FileWatcher
|
||||
{
|
||||
/// <summary>
|
||||
/// DO NOT CAST TO A TIMER, always interact with this class directly. Start and Stop are not overridden.
|
||||
/// </summary>
|
||||
public class TimerPlus : System.Timers.Timer
|
||||
{
|
||||
private bool m_Running;
|
||||
private DateTime m_Start;
|
||||
private DateTime m_End;
|
||||
|
||||
public TimerPlus()
|
||||
{
|
||||
}
|
||||
|
||||
public TimerPlus(double interval)
|
||||
: base(interval)
|
||||
{
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
m_Running = true;
|
||||
m_Start = DateTime.Now;
|
||||
base.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
m_End = DateTime.Now;
|
||||
m_Running = false;
|
||||
base.Stop();
|
||||
}
|
||||
|
||||
public TimeSpan TimeElapsed
|
||||
{
|
||||
get { return m_Running ? DateTime.Now - m_Start : m_End - m_Start; }
|
||||
}
|
||||
|
||||
public TimeSpan TimeRemaining
|
||||
{
|
||||
get { return TimeSpan.FromMilliseconds(Interval) - TimeElapsed; }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue