I’m sure this is a very noob-ish question, but I’ve been looking for this information for past two hours and haven’t found anything, really. (I’m sure I just didn’t ask the right question, though.)
The thing is, I’m designing an application which needs a user to provide a lot of information, I guess it’s like 14 TextBoxes. Now, my problem is I’m not sure what is the best way to handle (and process) this information.
After getting it all from a user, I want to pass it to a class called SaveIt which uses then passes it to SerializeToXML, which uses XMLSerialize to save the info to an XML file. But that’s a hell lot of writing and a hell lot of variables to create and I’m sure it can be done in a more elegant and smart way.
To recap: I have to pass this information 2 times (once to SaveIt, then to SerializeToXML), plus I have to define a class that XMLSerialize will use to, well… serialize it.
What is the smartest way to do that?
One way would be to just pass the original
Formas a parameter. Then get the information when you really need it. But then those methods will be hard coded for this job, and you won’t be able to reuse them.So how about creating a class with those variables, and passing an instance of that class?