Why should I use InitializeLifetimeService in WinForm dialog?
I am refactoring code inherited from a long gone developer and found this:
ImportExportForm l_Form = new ImportExportForm();
l_Form.InitializeLifetimeService();
l_Form.ShowDialog();
I have never seen or used a LifetimeService before, but from the small number I read, I donβt understand why I would like to use it here, but before speaking WTF I wondered if I could skip some subtle details?
source to share
As far as I know, this is the method that is commonly used for remote .NET objects and for setting the lifetime of an instance. See here:
http://msdn.microsoft.com/es-es/magazine/cc300474(en-us).aspx
I don't think this is important for a regular Windows Form.
source to share
True, it is used for .Net remote access like WCF. Except when your ImportExportForm object is loading something remotely, I see no reason to use that. See There: http://msdn.microsoft.com/en-us/library/23bk23zc(v=vs.100).aspx
source to share