Results 1 to 2 of 2

Thread: Get/Set props of server based timer?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164

    Question Get/Set props of server based timer?

    I have an app that runs as a Windows Service and in my OnStart event, I create a server base timer. I have it working right and the ElapsedEventHandler works fine, too.

    Code:
    'Create new Server based Timer
    Dim oSettings As New Settings()
    oSettings = New Settings()
    Dim myTimer As New System.Timers.Timer()
    AddHandler myTimer.Elapsed, _
            New System.Timers.ElapsedEventHandler(AddressOf Me.myTimer_Elapsed)
    myTimer.Enabled = True
    myTimer.Interval = oSettings.Interval
    My question is.... Once I create the timer in my onStart event, how do I change the Interval or test to see if the timer is enabled in other code? Just the basic get/set properties & methods. I just don't know how to reference the timer object that I created on the fly. (oSettings is my class for my global app vars)

    thanks,
    -Shurijo

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164

    Talking

    I think I figured it out. I just move the line that I am creating the instance to the top section where I declare my class stuff.

    Code:
    Public Class myClass
    ...
    Private myTimer As New System.Timers.Timer(2000)
    ...

    -Shurijo

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