473,379 Members | 1,243 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.

Function hook

Hi there:
I wanna know does it exist in C# that when I call a method, say
myObj.Dummy(), I could caculate the call time of the Dummy() method, if the
time exceed the given value , I could cancel the Dummy() . does C# have the
mechanism?
Jul 22 '07 #1
2 2318
You can make any method call "timeout-able" with the use of delegates. Here
is an article that illustrates one method to do this:

http://www.eggheadcafe.com/tutorials...-method-c.aspx

-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"hangaround" wrote:
Hi there:
I wanna know does it exist in C# that when I call a method, say
myObj.Dummy(), I could caculate the call time of the Dummy() method, if the
time exceed the given value , I could cancel the Dummy() . does C# have the
mechanism?
Jul 22 '07 #2


"Peter Bromberg [C# MVP]" wrote:
You can make any method call "timeout-able" with the use of delegates. Here
is an article that illustrates one method to do this:

http://www.eggheadcafe.com/tutorials...-method-c.aspx

-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"hangaround" wrote:
Hi there:
I wanna know does it exist in C# that when I call a method, say
myObj.Dummy(), I could caculate the call time of the Dummy() method, if the
time exceed the given value , I could cancel the Dummy() . does C# have the
mechanism?
Thanks , I will check it out.
Jul 22 '07 #3

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

Similar topics

6
by: Steven Bethard | last post by:
I wrote: > If you really want locals that don't contribute to arguments, I'd be > much happier with something like a decorator, e.g.: > > @with_consts(i=1, deftime=time.ctime()) > def foo(x,...
17
by: George Sakkis | last post by:
Is there a general way of injecting code into a function, typically before and/or after the existing code ? I know that for most purposes, an OO solution, such as the template pattern, is a cleaner...
5
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
19
by: Deniz Bahar | last post by:
Hi, I would like to call one of my functions the exact name as an existing C library function (for example K&R2 exercises asks me to make an atof function). If I don't include the header with...
1
by: murlbrown | last post by:
Basicly im trying to determine when a new line has been appended to the textbox of another application. Using spy++ I see that the msg (wm_user + 97) is being sent, which is the EM_SETTEXTEX...
0
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
7
by: jpierson | last post by:
Hi, I am tryin to create a keyboard hook that sends the keystroke ctrl + pause/break. I haven't used keyboard hooks before so I'm not too sure how to use them public int MyKeyboardProc(int...
2
by: Lunchtimemama | last post by:
I am trying to modify another application's window (Google Talk) to insert some UI of my own. I think the best method would be to install a remote local hook in gtalk's thread that intercepts the...
36
by: danielx | last post by:
At first I was going to post the following: <!-- beginning of my original post --> I just discovered the inspect module, which contains the isfunction and ismethod functions. For some reason,...
3
by: Sami | last post by:
Hello, I am new to Python. I tried to hook my own ExceptionPrintingFunction sys.excepthook but it does not work. This is what I wrote:...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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.