Exemplo n.º 1
0
        // Initialize and start event simulator
        private void StartEventSimulator()
        {
            m_autoEvent = new AutoResetEvent(true);
            m_eventSim = new EventSimulator(this);

            // Create the delegate that invokes methods for the timer.
            TimerCallback timerDelegate = new TimerCallback(m_eventSim.SendEvent);

            m_stateTimer = new Timer(timerDelegate, m_autoEvent, 10000, 20000);
            return;
        }
Exemplo n.º 2
0
        // Initialize and start event simulator
        private void StartEventSimulator()
        {
            m_autoEvent = new AutoResetEvent(true);
            m_eventSim  = new EventSimulator(this);

            // Create the delegate that invokes methods for the timer.
            TimerCallback timerDelegate = new TimerCallback(m_eventSim.SendEvent);

            m_stateTimer = new Timer(timerDelegate, m_autoEvent, 10000, 20000);
            return;
        }
Exemplo n.º 3
0
 // Release resources used by this object
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         StopEventSimulator();
         m_autoEvent = null;
         m_eventSim = null;
         m_stateTimer = null;
     }
     // no unmanaged resources to release
 }
Exemplo n.º 4
0
 // Release resources used by this object
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         StopEventSimulator();
         m_autoEvent  = null;
         m_eventSim   = null;
         m_stateTimer = null;
     }
     // no unmanaged resources to release
 }