Parth48
asked on
What is the use of ApplicationContext Class in C#.net window application ??
What is the use of ApplicationContext Class in C#.net window application ??
can u please tell me step by step so that i can understand ?
can i use it in form (code behind) or i have to use it only in program.cs file ??
can u please tell me step by step so that i can understand ?
can i use it in form (code behind) or i have to use it only in program.cs file ??
ASKER
hi @asimnazir123: yes u r right , but what is the meaning of contextual information ??
can u please tell me some practical exam where we can use application context class ??
can u please tell me some practical exam where we can use application context class ??
Put simply, implementing your own ApplicationContext() allows YOU to decide how and when your application closes.
The default WinForms model is tied to the lifetime of the Form passed to Application.Run(). When that form is closed the entire application shuts down.
An ApplicationContext() gives you the ability to keep your application open under whatever circumstances you want. The entry point becomes the constructor of the class from which you could display a form if you wanted to. Even if that form is closed your app will continue running because the class still exists and has its own message pump. When the conditions are right for your particular program, you tell the app to shutdown by calling Application.Exit().
The default WinForms model is tied to the lifetime of the Form passed to Application.Run(). When that form is closed the entire application shuts down.
An ApplicationContext() gives you the ability to keep your application open under whatever circumstances you want. The entry point becomes the constructor of the class from which you could display a form if you wanted to. Even if that form is closed your app will continue running because the class still exists and has its own message pump. When the conditions are right for your particular program, you tell the app to shutdown by calling Application.Exit().
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Details at http://msdn.microsoft.com/en-us/library/system.windows.forms.applicationcontext.aspx