By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,578 Members | 1,771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,578 IT Pros & Developers. It's quick & easy.

Different Approaches to Saving settings: Which is better?

P: n/a
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

Feb 17 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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


Have each window have it's own xml file. That the window is only
adjusting it's own file and will be efficient since it can write out the
minimal amount of information.
Feb 17 '06 #2

P: n/a
guy
if you are using vb2005 there is always My.Settings :)

"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

Feb 17 '06 #3

P: n/a
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

"Martin the Third" <ma************@gmail.com> schreef in bericht
news:11**********************@z14g2000cwz.googlegr oups.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

Feb 17 '06 #4

P: n/a
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.

Feb 18 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.