|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Different Approaches to Saving settings: Which is better?anything, it just has alot of windows that you can choose to have that would add extra features to the program. Now, I need to have the properties of these windows to stay when the user exits (which windows are opened/closed, etc). Ive already set it up so that it reads and writes from an xml file to handle all this. The problem is that the variables I have set up dont get told when to change (Id go into greater detail, but it's irrelevant). Anyway, the two options I have to fix this problem are as follows: 1) Send strings in the form close events to the main window, and change the variables that affect the settings. Then write to the xml file when the entire program is exited with a subroutine. 2) Make the read/write xml subs part of a seperate class, and write to the xml file any time a window is opened or closed. Which would be more efficient? Thanks in advance, -m3 Martin the Third wrote:
Show quoteHide quote > Okay, I have a program that has many optional windows. Its not mdi or Have each window have it's own xml file. That the window is only > anything, it just has alot of windows that you can choose to have that > would add extra features to the program. > > Now, I need to have the properties of these windows to stay when the > user exits (which windows are opened/closed, etc). Ive already set it > up so that it reads and writes from an xml file to handle all this. > > The problem is that the variables I have set up dont get told when to > change (Id go into greater detail, but it's irrelevant). Anyway, the > two options I have to fix this problem are as follows: > > 1) Send strings in the form close events to the main window, and change > the variables that affect the settings. Then write to the xml file when > the entire program is exited with a subroutine. > > 2) Make the read/write xml subs part of a seperate class, and write to > the xml file any time a window is opened or closed. > > Which would be more efficient? > > Thanks in advance, > -m3 > adjusting it's own file and will be efficient since it can write out the minimal amount of information. How is that different from having them all write to the same one? It
seems like creating a bunch of xml files would be less efficient. if you are using vb2005 there is always My.Settings :)
Show quoteHide quote "Martin the Third" wrote: > Okay, I have a program that has many optional windows. Its not mdi or > anything, it just has alot of windows that you can choose to have that > would add extra features to the program. > > Now, I need to have the properties of these windows to stay when the > user exits (which windows are opened/closed, etc). Ive already set it > up so that it reads and writes from an xml file to handle all this. > > The problem is that the variables I have set up dont get told when to > change (Id go into greater detail, but it's irrelevant). Anyway, the > two options I have to fix this problem are as follows: > > 1) Send strings in the form close events to the main window, and change > the variables that affect the settings. Then write to the xml file when > the entire program is exited with a subroutine. > > 2) Make the read/write xml subs part of a seperate class, and write to > the xml file any time a window is opened or closed. > > Which would be more efficient? > > Thanks in advance, > -m3 > > Martin,
Both not, I keep this forever as lead for this kind of question. Everything that affects the computer and belongs to that Registry, in my view belong the form sizes than to the registry which can be used to set the properties before the show and back to the registry before the close. Everything that belongs to the application would in my opinion be set in the config (xml file). To be transportable. Just my thought, Cor Show quoteHide quote "Martin the Third" <martin3warr***@gmail.com> schreef in bericht news:1140143414.713370.320120@z14g2000cwz.googlegroups.com... > Okay, I have a program that has many optional windows. Its not mdi or > anything, it just has alot of windows that you can choose to have that > would add extra features to the program. > > Now, I need to have the properties of these windows to stay when the > user exits (which windows are opened/closed, etc). Ive already set it > up so that it reads and writes from an xml file to handle all this. > > The problem is that the variables I have set up dont get told when to > change (Id go into greater detail, but it's irrelevant). Anyway, the > two options I have to fix this problem are as follows: > > 1) Send strings in the form close events to the main window, and change > the variables that affect the settings. Then write to the xml file when > the entire program is exited with a subroutine. > > 2) Make the read/write xml subs part of a seperate class, and write to > the xml file any time a window is opened or closed. > > Which would be more efficient? > > Thanks in advance, > -m3 >
by default, public or private?
Getting current user name Reference to a variable need help on DateDiff function! Replace Selected Text printing problem with dotmatrix printer using vb.net Which collection object to use similar to SortedList\Hashtable Properties of a Property BindingSource.AddNew Activating Windows Forms |
|||||||||||||||||||||||