In C #, the general template that I use is to populate the details of the lower class of a computation with a form object.
Constructor for MyForm:
MyForm() { _MyFormCalcs = new MyFormCalcs(this); }
But today I came across an error that makes me think that, since my constructor did not finish the completion, it creates a new instance of MyForm to be transferred to MyData. Thus, it calls the constructor twice. I found that the static list in MyFormCalcs was populated twice and not executed a second time, since the keys were already in the list.
Can this be used in the constructor to refer to this instance? What will it contain in the lower class - does the constructor work or not.
What is the best way to pass my form to lower class?
Peter
source share