O
oliver.wulff
Does there exist a common design solution to handle different forms. I
need access from one form to another one. There are about three forms
which will be open all the time. There can exists several instances from
the same form type.
I have the following idea and I'm interested what other people think about
it.
I'd write a global FormManager (singleton) which provides the following
methods:
public static FormManager getInstance();
public Form getForm (string formName);
public Form getForm (string formName, string tagId); //same instance of
one form type
public void registerForm(string formName, Form f);
public void registerForm(string formName, string tagId, Form f);
public void unregisterForm(string formName);
public void unregisterForm(string formName, string tagId);
So, I can register/unregister a new form instance in one of the form
events during load implicitly or explicitly and I have access to each form
from anywhere.
What are your thoughts about it???
need access from one form to another one. There are about three forms
which will be open all the time. There can exists several instances from
the same form type.
I have the following idea and I'm interested what other people think about
it.
I'd write a global FormManager (singleton) which provides the following
methods:
public static FormManager getInstance();
public Form getForm (string formName);
public Form getForm (string formName, string tagId); //same instance of
one form type
public void registerForm(string formName, Form f);
public void registerForm(string formName, string tagId, Form f);
public void unregisterForm(string formName);
public void unregisterForm(string formName, string tagId);
So, I can register/unregister a new form instance in one of the form
events during load implicitly or explicitly and I have access to each form
from anywhere.
What are your thoughts about it???