473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to pause ElapsedEventHandler

public void StartTimer()
{
System.Timers.Timer myTimer = new System.Timers.Timer();
myTimer.Interval =
Convert.ToDouble(ConfigurationSettings.AppSettings["Interval"]);
myTimer.Elapsed += new
System.Timers.ElapsedEventHandler(this.myTimer_Ela psed);
myTimer.Enabled = true;
}

protected void myTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs
e)
{
'**************************************** I need it to pause here
SeekFiles();
****************************************Then startup again here???
} // end function

--

David Fetrow
Helixpoint LLC.
da***@helixpoint.com
Nov 20 '05 #1
4 1695
"DaveF" <df*****@geodecisions.com> schrieb
public void StartTimer()
{


Doesn't look like VB.NET code. :)
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
"DaveF" <df*****@geodecisions.com> schrieb
public void StartTimer()
{


Doesn't look like VB.NET code. :)
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
If I understand your question, I don't see any reason why the following
wouldn't work:

((System.Timers.Timer)sender).Stop();
SeekFiles();
((System.Timers.Timer)sender).Start();

Tom Dacon
Dacon Software Consulting
"DaveF" <df*****@geodecisions.com> wrote in message
news:eK**************@tk2msftngp13.phx.gbl...
public void StartTimer()
{
System.Timers.Timer myTimer = new System.Timers.Timer();
myTimer.Interval =
Convert.ToDouble(ConfigurationSettings.AppSettings["Interval"]);
myTimer.Elapsed += new
System.Timers.ElapsedEventHandler(this.myTimer_Ela psed);
myTimer.Enabled = true;
}

protected void myTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
'**************************************** I need it to pause here
SeekFiles();
****************************************Then startup again here???
} // end function

--

David Fetrow
Helixpoint LLC.
da***@helixpoint.com

Nov 20 '05 #4
If I understand your question, I don't see any reason why the following
wouldn't work:

((System.Timers.Timer)sender).Stop();
SeekFiles();
((System.Timers.Timer)sender).Start();

Tom Dacon
Dacon Software Consulting
"DaveF" <df*****@geodecisions.com> wrote in message
news:eK**************@tk2msftngp13.phx.gbl...
public void StartTimer()
{
System.Timers.Timer myTimer = new System.Timers.Timer();
myTimer.Interval =
Convert.ToDouble(ConfigurationSettings.AppSettings["Interval"]);
myTimer.Elapsed += new
System.Timers.ElapsedEventHandler(this.myTimer_Ela psed);
myTimer.Enabled = true;
}

protected void myTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
'**************************************** I need it to pause here
SeekFiles();
****************************************Then startup again here???
} // end function

--

David Fetrow
Helixpoint LLC.
da***@helixpoint.com

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew | last post by:
When will .NET have a low-pause-time garbage collector A low-pause-time garbage collector would greatly improve .NET's ability to serve as a platform for soft real-time systems. It doesn't have...
11
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
8
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
2
by: DaveF | last post by:
public void StartTimer() { System.Timers.Timer myTimer = new System.Timers.Timer(); myTimer.Interval = Convert.ToDouble(ConfigurationSettings.AppSettings); myTimer.Elapsed += new...
1
by: Max Adams | last post by:
Using System.Timers.ElapsedEventHandler to specify a method and and ElapsedEventArgs object I've trawled the internet looking for some help on this topic. What I want to do is, every x seconds...
38
by: Jackie | last post by:
I just want the programme to stop for a while. Thanks.
3
by: ginguene | last post by:
Its supposed to be a very simple program, with a class to display the updated current time every second (CAnalogTime) inside a Label in my form, using ElapsedEventHandler from System.Timers; The...
2
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to start, pause and resume a recurrsive search exactly where you left off, say in the registry programmatically? -- Michael Bragg,...
8
by: Lloydm | last post by:
I've used the command "pause" in batch files which works ok but I guess it's applied dirrently in c++. Using Dev C++ 4.0 and the following is my code #include<iostream> #include<iomanip>...
2
by: bmerlover | last post by:
How do I use a PAUSE in .NET Framework using C++ (Visual Studio .NET 2003). I know it's system("pause") in the dos version. But I don't know what it is in the GUI version. I tried...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.