473,320 Members | 2,000 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,320 software developers and data experts.

Application wide event?

Hey guys

Is it possible to create an event that is global to an application?

Thanks
Oct 6 '06 #1
5 1820
If you use MS patterns and practices yes. It is build into it.

Daniel wrote:
Hey guys

Is it possible to create an event that is global to an application?

Thanks
Oct 6 '06 #2
Daniel,

Yes, there is no reason why you can not create an event that is a static
event, which would then be accessible to the whole app.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <Da*****@vestryonline.comwrote in message
news:Oa**************@TK2MSFTNGP03.phx.gbl...
Hey guys

Is it possible to create an event that is global to an application?

Thanks

Oct 6 '06 #3
Cool, well sicne everything in c# is in a class, where would i delcare the
static event?

Make a static class and put it in there?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:Og**************@TK2MSFTNGP04.phx.gbl...
Daniel,

Yes, there is no reason why you can not create an event that is a
static event, which would then be accessible to the whole app.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <Da*****@vestryonline.comwrote in message
news:Oa**************@TK2MSFTNGP03.phx.gbl...
>Hey guys

Is it possible to create an event that is global to an application?

Thanks


Oct 7 '06 #4
Daniel,

Just do this:

public class MyClass
{
public static event EventHandler MyEvent;
}

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <Da*****@vestryonline.comwrote in message
news:eJ**************@TK2MSFTNGP05.phx.gbl...
Cool, well sicne everything in c# is in a class, where would i delcare the
static event?

Make a static class and put it in there?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:Og**************@TK2MSFTNGP04.phx.gbl...
>Daniel,

Yes, there is no reason why you can not create an event that is a
static event, which would then be accessible to the whole app.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <Da*****@vestryonline.comwrote in message
news:Oa**************@TK2MSFTNGP03.phx.gbl...
>>Hey guys

Is it possible to create an event that is global to an application?

Thanks



Oct 7 '06 #5
Ah so as i thought....ok thanks

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:er**************@TK2MSFTNGP02.phx.gbl...
Daniel,

Just do this:

public class MyClass
{
public static event EventHandler MyEvent;
}

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <Da*****@vestryonline.comwrote in message
news:eJ**************@TK2MSFTNGP05.phx.gbl...
>Cool, well sicne everything in c# is in a class, where would i delcare
the static event?

Make a static class and put it in there?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:Og**************@TK2MSFTNGP04.phx.gbl...
>>Daniel,

Yes, there is no reason why you can not create an event that is a
static event, which would then be accessible to the whole app.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <Da*****@vestryonline.comwrote in message
news:Oa**************@TK2MSFTNGP03.phx.gbl...
Hey guys

Is it possible to create an event that is global to an application?

Thanks



Oct 7 '06 #6

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

Similar topics

12
by: Rakesh | last post by:
Hi, I am catching unhandled exception by attached an event handler on the Application.ThreadException event. This will ensure that I could handle all uncaught exceptions on the main thread. ...
1
by: ~dr-sci-fi | last post by:
hi all, problem: i have several controls on my form which can get focus, like buttons/combos. i have to catch keyboard events for special keys like Alt-F1 on my form, for that, i simply...
1
by: Matt | last post by:
I'm trying to get the DefaultAppPool to run under the domain account that we're using for the IIS6 anonymous account, but keep getting the following warning in the system event log: The identity...
1
by: Mike Logan | last post by:
In the Init Method, I would like to add a delegate to the Application_Start. However the Application_Start is not an event of the HTTPApplication class. Is there some other way to access this...
0
by: Stefano | last post by:
Hi all, I need to define an application wide custom event, and handle it into an HttpModule. I created a class, with a statis "Current" property. This property returns the instance of the...
16
by: Fernando Arámburu | last post by:
Hi , it´s me again. I will take another way because yesterday I make a question and, probably I didn´t make myself clear so you didn´t understand my question. I want to know if there is any...
2
by: Steve | last post by:
I am developing a web solution. I would like to create a dynamically sized array of strings at application start (presumably in the "Application_Start" event), which can then be referenced...
4
by: Omega | last post by:
I just recently recieved my full copy of Visual Studio 2005 (excited!!!), and have gone head first into writing my first application. Sadly, I've hit a design barrier. >From what I can see,...
5
by: Andy B | last post by:
I want to have page level access to a certain object but cant figure out how to do this. I create a class method that returns the object, but I cant get it to be global to the page. By global to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.