Whats the difference between writing a program using ApplicationContext
like this:
using System;
using System.Windows.Forms;
namespace Test
{
class Test
{
static void Main(string[] args)
{
Application.Run(new Context(args));
}
}
class Context : ApplicationContext
{
public Context(string[] args)
{
//the program
Environment.Exit(1);
}
}
}
and standard Main
?
namespace Test
{
class Test
{
static void Main(string[] args)
{
//the program
}
}
}
Let's say that you have common features for one set of programs and then some different features for different set of programs, but both sets have some common functionality. By using class BaseContext : ApplicationContext
you can do common functionality for both and then implement specific set functionality by inheriting from BaseContext. Basically you get same benefit as from 'normal' polymorphism.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With