Timers(70-536)

Discussion in 'MCTS' started by blade, Feb 23, 2008.

  1. blade

    blade Guest

    Hey,
    This question is not clear for me.Does they mean that callback is never
    invoked or only once?
    What is correct ansewer?

    You are developing a Windows Service application by using the .NET Framework
    2.0. You write the following code in your class:
    Dim myTimer As Timer = New Timer(statusDelegate, Nothing, 1000, 250)
    The delegate statusDelegate is already correctly defined in your class. You
    must modify the code so that the callback method is not invoked periodically.
    Which code segment should you use?
    A. Dim myTimer As Timer = _
    New Timer(statusDelegate, Nothing, Timeout.Infinite, 0)
    B. Dim myTimer As Timer = _
    New Timer(statusDelegate, Nothing, 1000, Timeout.Infinite)
    C. Dim myTimer As Timer = _
    New Timer(statusDelegate, Nothing, 0, 32767)
    D. Dim myTimer As Timer = _
    New Timer(statusDelegate, Nothing, Timeout.Infinite, 250)
     
    blade, Feb 23, 2008
    #1
    1. Advertisements

  2. Where are you getting this question?
     
    Michael D. Alligood [CertGuard, Inc.], Feb 23, 2008
    #2
    1. Advertisements

  3. Blade - I would interpret "periodically" to mean "over and over again", i.e.
    repetitively. Not invoking it at all defeats the purpose of a Timer, so I
    would go with "B". But I see your point, because "A" is technically correct
    because in the strictest sense the timer will not periodically invoke - in
    fact it does not invoke it at all.
     
    Vijay Jagdale, Mar 12, 2008
    #3
  4. blade

    xr280xr Guest

    I agree, my impression was that they want it to invoke once and only once.
     
    xr280xr, Apr 3, 2008
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.