Click here to Skip to main content
15,850,685 members
Home / Discussions / C#
   

C#

 
AnswerRe: design pattern needed (for C#) Pin
Ennis Ray Lynch, Jr.29-May-09 5:58
Ennis Ray Lynch, Jr.29-May-09 5:58 
GeneralRe: design pattern needed (for C#) Pin
NaNg1524129-May-09 6:14
NaNg1524129-May-09 6:14 
GeneralRe: design pattern needed (for C#) Pin
EliottA29-May-09 6:53
EliottA29-May-09 6:53 
GeneralRe: design pattern needed (for C#) Pin
NaNg1524129-May-09 12:05
NaNg1524129-May-09 12:05 
AnswerRe: design pattern needed (for C#) Pin
DaveyM6929-May-09 7:20
professionalDaveyM6929-May-09 7:20 
QuestionThrottle user input Pin
edlanka29-May-09 4:30
edlanka29-May-09 4:30 
AnswerRe: Throttle user input Pin
Ennis Ray Lynch, Jr.29-May-09 4:44
Ennis Ray Lynch, Jr.29-May-09 4:44 
AnswerRe: Throttle user input Pin
Luc Pattyn29-May-09 4:53
sitebuilderLuc Pattyn29-May-09 4:53 
Hi,

you need a single timer for that; it will be used as a one-shot with 2 second interval.

1.
When the user enters something, start the timer (if not already running) and set its interval to 2000 msec. Don't call the server yet.
When the interval elapses, call the server and stop the timer (prevent it from firing periodically).

With this set-up you are getting something resembling a user-idle detector, with the disadvantage that a user typing 1 character a second won't get anything until he stops typing for at least 2 seconds.

2.
If you want intermediate server calls as well, on top of tbe above, note the DateTime.Now value of every user action and compare them with the time of the last server call.

3.
If you want no delay on first input, on top of the above, check for timer running; if not, call server.


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

QuestionConnecting C# desktop application with web database Pin
sachees12329-May-09 3:31
sachees12329-May-09 3:31 
AnswerRe: Connecting C# desktop application with web database Pin
Paddy Boyd29-May-09 3:35
Paddy Boyd29-May-09 3:35 
AnswerRe: Connecting C# desktop application with web database Pin
Henry Minute29-May-09 3:46
Henry Minute29-May-09 3:46 
AnswerRe: Connecting C# desktop application with web database Pin
Rob Philpott29-May-09 3:59
Rob Philpott29-May-09 3:59 
AnswerRe: Connecting C# desktop application with web database Pin
benjamin yap29-May-09 7:49
benjamin yap29-May-09 7:49 
Questionfind files Pin
michaelgr129-May-09 3:26
michaelgr129-May-09 3:26 
AnswerRe: find files Pin
I Believe In GOD29-May-09 3:28
I Believe In GOD29-May-09 3:28 
GeneralRe: find files Pin
musefan29-May-09 3:33
musefan29-May-09 3:33 
GeneralRe: find files Pin
Rob Philpott29-May-09 4:17
Rob Philpott29-May-09 4:17 
GeneralRe: find files Pin
Baeltazor29-May-09 4:35
Baeltazor29-May-09 4:35 
GeneralRe: find files Pin
Luc Pattyn29-May-09 4:59
sitebuilderLuc Pattyn29-May-09 4:59 
GeneralRe: find files Pin
I Believe In GOD29-May-09 5:48
I Believe In GOD29-May-09 5:48 
GeneralRe: find files Pin
Mike Devenney29-May-09 6:41
Mike Devenney29-May-09 6:41 
AnswerRe: find files Pin
Rajesh R Subramanian29-May-09 3:31
professionalRajesh R Subramanian29-May-09 3:31 
AnswerRe: find files [modified] Pin
musefan29-May-09 3:31
musefan29-May-09 3:31 
GeneralRe: find files Pin
michaelgr129-May-09 4:00
michaelgr129-May-09 4:00 
GeneralRe: find files Pin
musefan29-May-09 4:05
musefan29-May-09 4:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.