Click here to Skip to main content
15,892,643 members
Home / Discussions / C#
   

C#

 
GeneralRe: IntelliSense bug in VS2005 Pin
dybs12-Jun-10 10:19
dybs12-Jun-10 10:19 
Question.net framework 4 Pin
michaelgr19-Jun-10 20:46
michaelgr19-Jun-10 20:46 
AnswerRe: .net framework 4 Pin
Abhinav S9-Jun-10 21:01
Abhinav S9-Jun-10 21:01 
AnswerRe: .net framework 4 Pin
Pete O'Hanlon9-Jun-10 21:38
mvePete O'Hanlon9-Jun-10 21:38 
QuestionMicrosoft sync framework Pin
hadad9-Jun-10 20:37
hadad9-Jun-10 20:37 
Questionhow to recognize the identityfing code in the image Pin
yu-jian9-Jun-10 20:16
yu-jian9-Jun-10 20:16 
QuestionTextureBrush problem Pin
Xmen Real 9-Jun-10 17:41
professional Xmen Real 9-Jun-10 17:41 
AnswerRe: TextureBrush problem Pin
Luc Pattyn9-Jun-10 17:58
sitebuilderLuc Pattyn9-Jun-10 17:58 
GeneralRe: TextureBrush problem Pin
Xmen Real 10-Jun-10 4:31
professional Xmen Real 10-Jun-10 4:31 
QuestionError in printing Pin
future38399-Jun-10 13:45
future38399-Jun-10 13:45 
AnswerRe: Error in printing Pin
Luc Pattyn9-Jun-10 14:04
sitebuilderLuc Pattyn9-Jun-10 14:04 
GeneralRe: Error in printing Pin
future38399-Jun-10 14:20
future38399-Jun-10 14:20 
GeneralRe: Error in printing Pin
Luc Pattyn9-Jun-10 14:36
sitebuilderLuc Pattyn9-Jun-10 14:36 
QuestionExceptions From Threads Pin
JohnLBevan9-Jun-10 12:03
professionalJohnLBevan9-Jun-10 12:03 
AnswerRe: Exceptions From Threads Pin
Luc Pattyn9-Jun-10 12:52
sitebuilderLuc Pattyn9-Jun-10 12:52 
GeneralRe: Exceptions From Threads Pin
JohnLBevan10-Jun-10 1:52
professionalJohnLBevan10-Jun-10 1:52 
QuestionThreads, Static Fields & Abstract Classes Problem Pin
JohnLBevan9-Jun-10 11:53
professionalJohnLBevan9-Jun-10 11:53 
AnswerRe: Threads, Static Fields & Abstract Classes Problem Pin
Luc Pattyn9-Jun-10 12:43
sitebuilderLuc Pattyn9-Jun-10 12:43 
you are correct, timer handlers can overlap (unless you use a System.Windows.Forms.Timer which has special characteristics). There are several ways to deal with that, which one you choose may depend on circumstances.

Here is a scheme a like a lot because it is simple:
- ask the timer to tick only once, then call your handler;
- in the handler, when all is done, again arm the timer for a single shot.

The advantage is there is no risk of overlap, and what you are doing in fact is time the idle part of the period, so if the handler takes 3 seconds, and you set the timer to 7 seconds, then your action will run every 10 seconds; if for some reason it takes longer, then all later timer activities will also come later.

The scheme can easily be implemented using the System.Threading.Timer and its Change() method.

If you really want to time the period, i.e. the start point (and not the idle gap), then it is always trickier to get it right under all circumstances. However IMO the fixed gap is what most applications want.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: Threads, Static Fields & Abstract Classes Problem Pin
JohnLBevan10-Jun-10 0:55
professionalJohnLBevan10-Jun-10 0:55 
GeneralRe: Threads, Static Fields & Abstract Classes Problem Pin
Luc Pattyn10-Jun-10 1:05
sitebuilderLuc Pattyn10-Jun-10 1:05 
Questionmaking auto serial number for each build of project Pin
kasraa000980009-Jun-10 9:47
kasraa000980009-Jun-10 9:47 
AnswerRe: making auto serial number for each build of project Pin
#realJSOP9-Jun-10 10:02
mve#realJSOP9-Jun-10 10:02 
GeneralRe: making auto serial number for each build of project Pin
Jason Vetter9-Jun-10 10:11
Jason Vetter9-Jun-10 10:11 
GeneralRe: making auto serial number for each build of project Pin
#realJSOP9-Jun-10 23:45
mve#realJSOP9-Jun-10 23:45 
AnswerRe: making auto serial number for each build of project Pin
Tony Richards9-Jun-10 10:44
Tony Richards9-Jun-10 10:44 

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.