A workmate just gave me some C# classes that I must use in a .NET application.
There's a typo that I have never seen, and I can't found any explication on the internet...
Here's the code :
public void GoTo<TView>() where TView : Form, new()
{
var view = Activator.CreateInstance<TView>();
//si on vient de creer une startup view alors on affiche l'ancienne
//la reference a la nouvelle sera detruite en sortant de la fonction GoTo
if (view is StartupForm)
{
ShowView(_StartupForm);
}
else ShowView(view);
}
What is the new()
keyword for, right at the end of the method declaration ?