473,783 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different Approaches to Saving settings: Which is better?

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
4 1137
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
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
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.goo glegroups.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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2452
by: Drolem | last post by:
Hello All, I use the following method to serialize a settings class to a string: '======================================================================= Public Shared Function DeflateClass(ByVal serializing As Object, ByVal typeSerializing As System.Type) As String Dim writer As StringWriter = New StringWriter Dim serializer As XmlSerializer = _
4
2377
by: Kourosh | last post by:
I have a log file that is viewed on the local machine. There are some settings on the html page that allow the user to specify how the file is viewed. I'm just wnodering what are my options in saving these settings (so they could be reloaded next time the user loads the page). Writing to registry, a file, or a cookie? what's the right approach?
7
2683
by: Dick | last post by:
I have a long list of events. I know where each event took place (globally) and when (using the event’s local time). I want to do some comparisons between these date/times. I thought I would convert them all to UTC and thus get them all on a common time-line. But I can’t see how to do this. I can use TimeZone.CurrentTimeZone to get the current TimeZone object and use its ToUniversalTime method to convert dates that occurred in the...
2
2936
by: Tal Shachar | last post by:
Hi, I have a windows application that needs to save some user preferences to an xml and to load it on the next application run. Saving the preferences is done per user. I know that there is a way of saving it to some path under "Documents and Settings/UserName/...." , but I don't know the correct approach (e.g. path naming convention, how to preserve this per user, etc.) I can use all the assistance I can get (code snippets and some...
43
3436
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
10
4738
by: David | last post by:
I am trying to get this straight in my head so I can implement. I wrote a small utility some time ago in c# that utilized a handful of threads. That scenario was one main thread manually spawning a handfull of worker threads, then waiting for all of them to complete before moving on. I believe I used array of ManualResetEvents and the WaitAll() method to do this. All the worker threads used a shared object (a common place to collect...
3
2209
by: RobEveryThingIsPossible | last post by:
IN VISTA MS Access 2000 Printer Settings Not Saving With Vista Bus. The printer settings (Label or Env.) keep on change back to another setting after saving them on a report or form, when viewing them on other Vista computers. I have tried many things see Example: Open my report in Design mode. Select Page Setup. On the Page tab, alongside Use Specific Printer, press the Printer button. Having selected your printer, press Properties....
3
2769
by: =?Utf-8?B?ZmJvbGVmZXlzb3Q=?= | last post by:
I have a 'Filter' class that contains some strings, 1 bool and 2 Color attributes. I made an array of Filter : Filter, and I'd like to save this array with the application settings system. here is my ApplicationSettingsBase-derived class : public Filter filtersList { get{return ((Filter)(this)); } set{ this = value; }
2
1153
by: AGP | last post by:
VB.NET 2005 i was reading some of the documentation on saving settings and i think i have a good grasp on things with the My.Settings classes. I understand how to bind a control to a setting and also how to save settings manually. The only thing I havent beeen able to find is how to do a massive amount of controls in one swoop. Say on my app i have 45 checkboxes and i want to save their settings (checked, enabled, etc) how would i do that...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.