Click here to Skip to main content
15,909,539 members
Home / Discussions / C#
   

C#

 
GeneralRe: Data Source problem Pin
David baghaturia20-Dec-11 5:57
David baghaturia20-Dec-11 5:57 
AnswerRe: Data Source problem Pin
AmitGajjar25-Dec-11 22:00
professionalAmitGajjar25-Dec-11 22:00 
GeneralRe: Data Source problem Pin
David baghaturia25-Dec-11 22:46
David baghaturia25-Dec-11 22:46 
QuestionHow to create .chm file that is help file Pin
sarang_k19-Dec-11 17:08
sarang_k19-Dec-11 17:08 
AnswerRe: How to create .chm file that is help file Pin
JF201519-Dec-11 21:17
JF201519-Dec-11 21:17 
AnswerRe: How to create .chm file that is help file Pin
Prasanna Kumar Pete22-Dec-11 0:59
Prasanna Kumar Pete22-Dec-11 0:59 
QuestionAny way to add USER settings at runtime? Pin
SledgeHammer0119-Dec-11 9:59
SledgeHammer0119-Dec-11 9:59 
AnswerRe: Any way to add USER settings at runtime? Pin
fjdiewornncalwe19-Dec-11 10:23
professionalfjdiewornncalwe19-Dec-11 10:23 
I found this on stack overflow, and it is a vb.net answer, but it may help you out. I haven't tried it myself.

http://stackoverflow.com/questions/175726/c-create-new-settings-at-run-time[^] This answer is about 2/3 down the page.

txt
Just in case that still matters to anyone:

You can dynamically add settings through Settings.Default.Properties.Add(...) and have these also persisted in the local storage after saving (I had those entries reflected in the roaming file).

Nevertheless it seems that the dynamically added settings keep missing in the Settings.Default.Properties collecion after loading again.

I could work around this problem by adding the dynamic property before first accessing it. Example (notice that I "create" my dynamic setting from a base setting):

// create new setting from a base setting:
var property = new SettingsProperty(Settings.Default.Properties["<baseSetting>"]);
property.Name = "<dynamicSettingName>";
Settings.Default.Properties.Add(property);
// will have the stored value:
var dynamicSetting = Settings.Default["<dynamicSettingName>"];

I don't know if this is supported by Microsoft as the documentation is very rare on this topic.

Problem is also described here http://www.vbdotnetforums.com/vb-net-general-discussion/29805-my-settings-run-time-added-properties-dont-save.html#post88152 with some solution offered here http://msdn.microsoft.com/en-us/library/saa62613(v=VS.100).aspx (see Community Content - headline "How to Create / Save / Load Dynamic (at Runtime) Settings"). But this is VB.NET.

I wasn't, now I am, then I won't be anymore.

GeneralRe: Any way to add USER settings at runtime? Pin
SledgeHammer0119-Dec-11 10:44
SledgeHammer0119-Dec-11 10:44 
Questionhandling network hardwares Pin
Member 825768019-Dec-11 9:52
Member 825768019-Dec-11 9:52 
AnswerRe: handling network hardwares Pin
fjdiewornncalwe19-Dec-11 10:26
professionalfjdiewornncalwe19-Dec-11 10:26 
AnswerRe: handling network hardwares Pin
Subin Mavunkal20-Dec-11 4:32
Subin Mavunkal20-Dec-11 4:32 
QuestionHow to read the SSIS dtsconfig from a c# script Pin
gerom7719-Dec-11 2:30
gerom7719-Dec-11 2:30 
Questionhow to save a recorded macro? Pin
mschotamaster18-Dec-11 3:36
mschotamaster18-Dec-11 3:36 
AnswerRe: how to save a recorded macro? Pin
OriginalGriff18-Dec-11 3:43
mveOriginalGriff18-Dec-11 3:43 
AnswerRe: how to save a recorded macro? Pin
Eddy Vluggen18-Dec-11 3:45
professionalEddy Vluggen18-Dec-11 3:45 
Questionhow to save a recorded macro? Pin
mschotamaster18-Dec-11 3:34
mschotamaster18-Dec-11 3:34 
AnswerRe: how to save a recorded macro? Pin
OriginalGriff18-Dec-11 3:42
mveOriginalGriff18-Dec-11 3:42 
AnswerRe: how to save a recorded macro? Pin
Rajesh Anuhya18-Dec-11 21:36
professionalRajesh Anuhya18-Dec-11 21:36 
Questionhow to compare the textbox data with listbox items ? Pin
zahra199118-Dec-11 2:27
zahra199118-Dec-11 2:27 
AnswerRe: how to compare the textbox data with listbox items ? Pin
DaveyM6918-Dec-11 2:43
professionalDaveyM6918-Dec-11 2:43 
AnswerRe: how to compare the textbox data with listbox items ? Pin
#realJSOP18-Dec-11 2:45
professional#realJSOP18-Dec-11 2:45 
AnswerRe: how to compare the textbox data with listbox items ? Pin
OriginalGriff18-Dec-11 3:44
mveOriginalGriff18-Dec-11 3:44 
QuestionHow i can set icon for new file extenstion ? Pin
Honeyboy_2018-Dec-11 1:22
Honeyboy_2018-Dec-11 1:22 
AnswerRe: How i can set icon for new file extenstion ? Pin
Eddy Vluggen18-Dec-11 1:38
professionalEddy Vluggen18-Dec-11 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.