A
Andrus
I have WinForms MDI application.
MDI child forms are created by menustrip click enent handler
AppDesktop.FormMgr.Show(new ChildForm1("param1", "param2") );
Every MDI child form "childform1" may have separate class with different
name and different number of parameters.
When application in opened, last MDI child form must be opened
automatically.
I think I must store last opened form name to isolated storage and call
AppDesktop.FormMgr.Show(new LastOpenedForm(lastParam1, lastParam2) );
Reflection should probably used to make this call.
I think I can add some code to form base class constructor for this which
stores child form name in isolated storage.
Switch statement is too big for this and so it is ugly.
I think about the following approach:
1. Retrieve actual calling class name from base class constructor and store
it in isolated storage (application can be run form web browser also).
2. At startup retrieve form name and create mdi child from it using
reflection.
Any idea or sample code how to implement this ?
MDI child forms are created by menustrip click enent handler
AppDesktop.FormMgr.Show(new ChildForm1("param1", "param2") );
Every MDI child form "childform1" may have separate class with different
name and different number of parameters.
When application in opened, last MDI child form must be opened
automatically.
I think I must store last opened form name to isolated storage and call
AppDesktop.FormMgr.Show(new LastOpenedForm(lastParam1, lastParam2) );
Reflection should probably used to make this call.
I think I can add some code to form base class constructor for this which
stores child form name in isolated storage.
Switch statement is too big for this and so it is ugly.
I think about the following approach:
1. Retrieve actual calling class name from base class constructor and store
it in isolated storage (application can be run form web browser also).
2. At startup retrieve form name and create mdi child from it using
reflection.
Any idea or sample code how to implement this ?