So I have a class Controller_data
with a few lists and dictionaries. I have a main program that calls two Forms
that fill in various parts of the data, then does some other processing. My question is: what’s the best way to pass and gather this data? Since the Forms
themselves are classes, I’m not quite sure how to do this. I’m new to C# and a bit confused.
I’m thinking I can either make Controller_data
static and access it from everywhere (which feels a bit like a global variable to me), make a variable Controller_data cd
in the main program and pass a pointer to it to the forms (this seems more like a C thing, though), or make local copies of cd
inside the forms, fill them up, then return them through a public method.
I’m really not sure what the expected way to do this is. I’m leaning more towards the first solution. Is that right, or is there some other way I’m blatantly missing? Are there any drawbacks to that solution? Thank you)