Results 1 to 3 of 3

Thread: [RESOLVED] Several timers... how to control one of them?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    33

    Resolved [RESOLVED] Several timers... how to control one of them?

    Hello to all,

    in my project i have multi timers ( System.Threading.timer ),
    eath timer is associated to a jobId.

    I need to stop one of the timers, i know the jobID.

    The problem. How do i know the timer associated to the job X.

    I keep the jobId and the timerId ( i think that timer.GetHashCode gives the id of the timer ) in a hashtable.

    Thanks for your time and help ( i hope so ), sorry about my english...
    Before this post you . After this post you . Then please Rate it .

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Several timers... how to control one of them?

    Why store the ID of the Timers in the Hashtable when you can just as easily store the Timers themselves? Then indexing the Hashtable by job ID will return a direct reference to the desired Timer.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    33

    Re: Several timers... how to control one of them?

    Last night when i was in sleeping i through the same .
    Thanks for the reply .
    Before this post you . After this post you . Then please Rate it .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width