473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Easy way to handle a 'variable' number of user settings?

I have an application where the user can configure the an area of the UI to
contain a variable number of 'plans', lets say 0 to 6 of them. Each 'plan'
has a description and a type amongst other things. I wish to maintain the
information (description and type) in the user settings object. Do I need to
'pre-define' all six or is there a way to get at settings through a variable
name?

TIA,
--
Terry
Nov 11 '08 #1
1 1110
On Nov 11, 11:45*am, Terry <Ter...@nospam.nospamwrote:
I have an application where the user can configure the an area of the UI to
contain a variable number of 'plans', lets say 0 to 6 of them. * Each 'plan'
has a description and a type amongst other things. * I wish to maintainthe
information (description and type) in the user settings object. *Do I need to
'pre-define' all six or is there a way to get at settings through a variable
name?

TIA,
--
Terry
I can't remember off hand if the user settings object stores the
values as a property or method, but either one can be retrieved by a
string name. All objects expose the method GetType(), which in turn
will supply you the type object and allow you to retrieve the
propertyInfo by name using GetProperty(...) and passing in the name
and scope to search.

If it were me however I would just write my own user settings class
that pulls the values out of my own Xml file. It just personal
preference, but "rolling your own" will probably be easier to test
than using reflection on the built in user settings.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Nov 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
3
by: Oliver Bryant | last post by:
I just finished developing a javascipt component allowing floating captions to appear over HTML elements. If anyone wants to check it out you can see specs and download it from...
19
by: laurenq uantrell | last post by:
I'm using Access 2K. I'm hoping someone can tell me which method performs faster- (currently I'm using a mix of both methods) a.) creating custom properties and then calling functions to set and...
10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
5
by: Jonah Bishop | last post by:
I'm developing a photo album web application for use on a web site, and I'm running into a problem with lengthy operations. My application allows the user to import a number of images at once into...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
3
by: Chad Dokmanovich | last post by:
As someone who's had a "fair" amount of web development experience, I shocked that I can't answer this question myself: Q: How does one maintain state and pass data across web pages and do so in...
3
by: Peterwkc | last post by:
Hello all C++ expert programmer, I have a handle class which point to another class and use the pointer as object. I follow the code from C++ articles submited by someone in this forum....
3
by: TamaThps | last post by:
I have an array of string values, and I need to access each character of the string individually. For instance I want my char variable to equal the first character in the string, and then compare it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.