473,379 Members | 1,317 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,379 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 1693
"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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.