Click here to Skip to main content
15,893,266 members
Home / Discussions / C#
   

C#

 
AnswerRe: Console Check Pin
Pete O'Hanlon9-Apr-13 6:14
mvePete O'Hanlon9-Apr-13 6:14 
GeneralRe: Console Check Pin
Bassam Abdul-Baki9-Apr-13 6:39
professionalBassam Abdul-Baki9-Apr-13 6:39 
AnswerRe: Console Check Pin
MicroVirus10-Apr-13 0:33
MicroVirus10-Apr-13 0:33 
GeneralRe: Console Check Pin
Bassam Abdul-Baki10-Apr-13 1:04
professionalBassam Abdul-Baki10-Apr-13 1:04 
QuestionEntering values to an int List Pin
aaa@gmail.com9-Apr-13 5:35
aaa@gmail.com9-Apr-13 5:35 
AnswerRe: Entering values to an int List Pin
OriginalGriff9-Apr-13 5:54
mveOriginalGriff9-Apr-13 5:54 
Questionref var of object inside a method Pin
Member 99394238-Apr-13 20:58
Member 99394238-Apr-13 20:58 
GeneralRe: ref var of object inside a method Pin
harold aptroot9-Apr-13 2:55
harold aptroot9-Apr-13 2:55 
GeneralRe: ref var of object inside a method Pin
Member 99394239-Apr-13 3:34
Member 99394239-Apr-13 3:34 
GeneralRe: ref var of object inside a method Pin
harold aptroot9-Apr-13 4:00
harold aptroot9-Apr-13 4:00 
QuestionConstrained generic class concepts Pin
Member 99394238-Apr-13 20:55
Member 99394238-Apr-13 20:55 
QuestionConstrained object in C# Pin
Member 99394238-Apr-13 20:52
Member 99394238-Apr-13 20:52 
AnswerRe: Constrained object in C# Pin
Pete O'Hanlon8-Apr-13 22:51
mvePete O'Hanlon8-Apr-13 22:51 
QuestionCan I display links in a ListView's detail mode? Pin
NarVish8-Apr-13 20:33
NarVish8-Apr-13 20:33 
Questionc# application don't work on xp Pin
Member 99694278-Apr-13 10:39
Member 99694278-Apr-13 10:39 
AnswerRe: c# application don't work on xp Pin
fjdiewornncalwe8-Apr-13 10:54
professionalfjdiewornncalwe8-Apr-13 10:54 
AnswerRe: c# application don't work on xp Pin
Manfred Rudolf Bihy8-Apr-13 20:02
professionalManfred Rudolf Bihy8-Apr-13 20:02 
Questionadvanced settings Pin
bfis1081378-Apr-13 10:13
bfis1081378-Apr-13 10:13 
I want to save a collection of custom objects. It seems that I succeed but when I try to retrieve the setting after the program restarts, the data is gone. I have searched extensively for the solution but to no avail. Here is what I have. Any help would be deeply appreciated.

In my settings.cs file I have added the following code.
C#
[global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public List<Account> Accounts
        {
            get
            {
                return ((List<Account>)(this["Accounts"]));
            }
            set
            {
                this["Accounts"] = value;
            }
        }


Then I have the class marked as serializable. I have the following code at window close and as you can see it does compile so it picks up on the code and the data is there after I save it using the debugger to verify.

C#
Properties.Settings.Default.Accounts = accounts.List;
            Properties.Settings.Default.Save();


All should be ok when I run the following code except the data just isn't there as it has a value of null.

C#
if (Properties.Settings.Default.Accounts != null)
            {
                accounts.List = Properties.Settings.Default.Accounts;
            }

AnswerRe: advanced settings Pin
SledgeHammer018-Apr-13 10:15
SledgeHammer018-Apr-13 10:15 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 10:18
bfis1081378-Apr-13 10:18 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 11:16
SledgeHammer018-Apr-13 11:16 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 18:22
bfis1081378-Apr-13 18:22 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 18:33
SledgeHammer018-Apr-13 18:33 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 18:45
bfis1081378-Apr-13 18:45 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 18:48
SledgeHammer018-Apr-13 18:48 

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.