Click here to Skip to main content
15,920,896 members
Home / Discussions / C#
   

C#

 
AnswerRe: Two questions on COM Add-in for Outlook 2003 Pin
OctopusThu6-Nov-06 15:42
OctopusThu6-Nov-06 15:42 
AnswerRe: Two questions on COM Add-in for Outlook 2003 Pin
OctopusThu6-Nov-06 19:53
OctopusThu6-Nov-06 19:53 
Question.NET remoting with DCOM Pin
Andy UK6-Nov-06 6:31
Andy UK6-Nov-06 6:31 
QuestionXML: Deserialize but don't Serialize Pin
Clive Pottinger6-Nov-06 5:58
Clive Pottinger6-Nov-06 5:58 
AnswerRe: XML: Deserialize but don't Serialize Pin
led mike6-Nov-06 9:21
led mike6-Nov-06 9:21 
AnswerRe: XML: Deserialize but don't Serialize Pin
beatles16927-Nov-06 0:28
beatles16927-Nov-06 0:28 
GeneralRe: XML: Deserialize but don't Serialize Pin
Clive Pottinger8-Nov-06 14:52
Clive Pottinger8-Nov-06 14:52 
GeneralRe: XML: Deserialize but don't Serialize Pin
Clive Pottinger8-Nov-06 16:54
Clive Pottinger8-Nov-06 16:54 
Bonus - I solved two in one day.

You can have an attribute that is deserialised but not serialised.

Give the item a property with a DefaultValue attribute and then have the get method always return the default value:

        <br />
[XmlAttribute("firstname")]<br />
[System.ComponentModel.DefaultValue("----")]<br />
public string Firstname<br />
{<br />
  get<br />
  {<br />
    return ( "----" );<br />
  }<br />
  set<br />
  { <br />
     this.Firstname = value;<br />
  }<br />
}<br />


Voila! Now, when deserialising, firstname is parsed, but when serialising, the firstname attribute is never written. Works like a charm.



Clive Pottinger,
Hamilton ON

QuestionXML Deserialization question Pin
Clive Pottinger6-Nov-06 5:49
Clive Pottinger6-Nov-06 5:49 
AnswerRe: XML Deserialization question Pin
S. Senthil Kumar6-Nov-06 6:41
S. Senthil Kumar6-Nov-06 6:41 
GeneralRe: XML Deserialization question [modified] Pin
Clive Pottinger6-Nov-06 7:25
Clive Pottinger6-Nov-06 7:25 
AnswerRe: XML Deserialization question Pin
Clive Pottinger6-Nov-06 7:52
Clive Pottinger6-Nov-06 7:52 
GeneralRe: XML Deserialization question Pin
S. Senthil Kumar7-Nov-06 5:30
S. Senthil Kumar7-Nov-06 5:30 
AnswerRe: XML Deserialization question Pin
Clive Pottinger8-Nov-06 15:10
Clive Pottinger8-Nov-06 15:10 
QuestionNearest neighbour algorithm Pin
Islam Khalil Saber6-Nov-06 4:35
Islam Khalil Saber6-Nov-06 4:35 
AnswerRe: Nearest neighbour algorithm Pin
J4amieC6-Nov-06 4:42
J4amieC6-Nov-06 4:42 
AnswerCross posting Pin
leckey6-Nov-06 6:41
leckey6-Nov-06 6:41 
Questiondatagridview help needed Pin
giddy_guitarist6-Nov-06 4:34
giddy_guitarist6-Nov-06 4:34 
AnswerRe: datagridview help needed Pin
Rey99997-Nov-06 6:36
Rey99997-Nov-06 6:36 
GeneralRe: datagridview help needed Pin
giddy_guitarist7-Nov-06 21:59
giddy_guitarist7-Nov-06 21:59 
QuestionTesting the presence of a reference Pin
Maercu6-Nov-06 4:23
Maercu6-Nov-06 4:23 
AnswerRe: Testing the presence of a reference Pin
led mike6-Nov-06 5:08
led mike6-Nov-06 5:08 
AnswerRe: Testing the presence of a reference Pin
liRetro6-Nov-06 5:51
liRetro6-Nov-06 5:51 
AnswerRe: Testing the presence of a reference Pin
Maercu6-Nov-06 21:46
Maercu6-Nov-06 21:46 
QuestionWhich class I should use in communication? Pin
mertkan656-Nov-06 4:11
mertkan656-Nov-06 4:11 

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.