private void FileBrowser_KeyDown(object sender, KeyEventArgs e) { if (CurrentTime == null) { CurrentSearchString = "^"+e.KeyCode.ToString(); CurrentTime = TimeSpanPlus.Now; } else { TimeSpanPlus Old = CurrentTime; CurrentTime= TimeSpanPlus.Now; if ((CurrentTime - Old).TotalSeconds < 2) { CurrentSearchString += e.KeyCode.ToString(); } else { CurrentSearchString = "^" + e.KeyCode.ToString(); } } ScrollTo(CurrentSearchString,RegexOptions.IgnoreCase); }
public CountDown(int Interval=1000) { tsp = new TimeSpanPlus(); this.Interval = Interval; InitTimer(); }
public CountDown(TimeSpanPlus TimeSpan, int Interval = 1000) { SetTime(TimeSpan); this.Interval = Interval; InitTimer(); }
public bool SubtractTime(TimeSpanPlus Time) { return SubtractDays(Time.Days) && SubtractHours(Time.Hours) && SubtractMinuts(Time.Minutes) && SubtractSeconds(Time.Seconds) && SubtractMilliseconds(Time.Milliseconds); }
public void SetTime(TimeSpan TimeSpan) { Stop(StopStatus.Stopped); tsp = new TimeSpanPlus(TimeSpan); }
public TimeSpanPlus(TimeSpanPlus Time) { SetTime(Time); }
public void SetTime(TimeSpanPlus Time) { _millisec = Time._millisec; _sec = Time._sec; _min = Time._min; _hour = Time._hour; _day = Time._day; }
public void AddTime(TimeSpanPlus Time) { AddMilliseconds(Time.Milliseconds); AddSeconds(Time.Seconds); AddMinuts(Time.Minutes); AddHours(Time.Hours); AddDays(Time.Days); }
public static TimeSpanPlus operator -(TimeSpanPlus c1, TimeSpanPlus c2) { TimeSpanPlus t = new TimeSpanPlus(c1); t.SubtractTime(c2); return t; }
public static TimeSpanPlus operator +(TimeSpanPlus c1, TimeSpanPlus c2) { TimeSpanPlus t=new TimeSpanPlus(c1); t.AddTime(c2); return t; }