TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
maj3091
NA
17
0
Problem with Timers in C# - Please help
Apr 13 2005 10:56 AM
Hi all, I'm trying to create a set of timers (which will be dynamically sized) and store them in a SortedList identified with a number stored in a variable. All the timers will point to the same TimerElapsed handling code. Is there anyway to get the Elapsed code to recognise which timer elapsed or can someone suggest a better way to do it? Thanks in advance. // Called each time need to add a new timer. System.Timers.Timer ClientTimer = new System.Timers.Timer(); ClientTimer.Enabled = true; ClientTimer.Interval = 5000; ClientTimer.Elapsed += new System.Timers.ElapsedEventHandler(ClientTimerTimeout); mTimers.Add(mintClientID,ClientTimer); The Timer Elapsed hadling code is below. private void ClientTimerTimeout(object sender, System.Timers.ElapsedEventArgs e) { System.Windows.Forms.MessageBox.Show("Elapsed!", "Timer Event Raised!"); }
Reply
Answers (
2
)
Multifile Assembly help
DLL Strong Name GAC Util