mirror of
https://github.com/4sval/FModel.git
synced 2026-03-26 19:55:18 -05:00
26 lines
626 B
C#
26 lines
626 B
C#
using System;
|
|
using System.Threading;
|
|
|
|
namespace FModel
|
|
{
|
|
public class TypeAssistant
|
|
{
|
|
public event EventHandler Idled = delegate { };
|
|
public int WaitingMilliSeconds { get; set; }
|
|
Timer _waitingTimer;
|
|
|
|
public TypeAssistant(int waitingMilliSeconds = 600)
|
|
{
|
|
WaitingMilliSeconds = waitingMilliSeconds;
|
|
_waitingTimer = new Timer(p =>
|
|
{
|
|
Idled(this, EventArgs.Empty);
|
|
});
|
|
}
|
|
public void TextChanged()
|
|
{
|
|
_waitingTimer.Change(WaitingMilliSeconds, Timeout.Infinite);
|
|
}
|
|
}
|
|
}
|