Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
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 
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 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 18:51
bfis1081378-Apr-13 18:51 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 19:08
SledgeHammer018-Apr-13 19:08 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 21:16
bfis1081378-Apr-13 21:16 
AnswerRe: advanced settings Pin
Alan N9-Apr-13 1:54
Alan N9-Apr-13 1:54 
A class will not xml serialize unless it has a public parameterless constructor. For successful deserialization it must be possible to completely set the object's state by assigning values to it's public properties.

In effect the deserializer is doing something like this:
C#
Account acc = new Account();
acc.Broker = savedBroker;
acc.Name = savedName;
.... etc.


Without the necessary public parameterless constructor the serialization will silently fail (really helpful Microsoft!). You can add the constructor but then it looks like an Account cannot be restored fully as the object is strongly coupled to a specific file via the Update method and the Path has not been serialized. Think about the design carefully before adding a public Path property as the information stored in the file and in the serialized settings may be different.

Alan.
GeneralRe: advanced settings Pin
bfis1081379-Apr-13 2:03
bfis1081379-Apr-13 2:03 
GeneralRe: advanced settings Pin
Alan N9-Apr-13 2:31
Alan N9-Apr-13 2:31 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 21:47
bfis1081378-Apr-13 21:47 

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.