I have a static class with a single method, which I use for delaying an action until the user has stopped clicking/typing/whatever:
public void SomeControl_Click(object sender, EventArgs e)
{
// DoSomething once user has stopped clicking for 300ms
MyClass.MyMethod(() => DoSomething(), 300);
}
Currently I've gone for DelayAction.Start开发者_Go百科New
, but that doesn't really convey what it does. I wondered about Stabilize
, but I'm not sure that's any clearer.
DelayAction.OnIdleUser
Since "being idle" means no activity, I'd go for this naming.
DelayAction.OnTimerExpired()
精彩评论