C
Craig Lister
I'd like to have an XML document that my app reads and writes to on a
regular basis. It will read the XML document on opening, write to it when
closing, and while running, it will do updates and add and delete nodes.
So...
I think I should create a 'Settings' class, with methods for reading,
writing, getting a value.. etc..
So, my question is: Where would I declare the object. Or should I say,
create it, so that I have access to it from anywhere in my main class? So
that at any point, I can say:
SettingsObject.Flush(); // Update the settings file with the latest changes
SettingsObject.ShutDown() // Do all the end-of-running things, and close the
XML file.
regular basis. It will read the XML document on opening, write to it when
closing, and while running, it will do updates and add and delete nodes.
So...
I think I should create a 'Settings' class, with methods for reading,
writing, getting a value.. etc..
So, my question is: Where would I declare the object. Or should I say,
create it, so that I have access to it from anywhere in my main class? So
that at any point, I can say:
SettingsObject.Flush(); // Update the settings file with the latest changes
SettingsObject.ShutDown() // Do all the end-of-running things, and close the
XML file.