Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
Questionfunction rectification Pin
Sonia Gupta7-Oct-07 21:46
Sonia Gupta7-Oct-07 21:46 
AnswerRe: function rectification Pin
pmarfleet7-Oct-07 21:57
pmarfleet7-Oct-07 21:57 
GeneralRe: function rectification Pin
Sonia Gupta7-Oct-07 22:15
Sonia Gupta7-Oct-07 22:15 
AnswerRe: function rectification Pin
Nissim Salomon7-Oct-07 22:03
Nissim Salomon7-Oct-07 22:03 
QuestionDisable the Automatic ToolTip Of Treeview Pin
Venki567-Oct-07 20:35
Venki567-Oct-07 20:35 
AnswerRe: Disable the Automatic ToolTip Of Treeview Pin
stancrm7-Oct-07 20:44
stancrm7-Oct-07 20:44 
GeneralRe: Disable the Automatic ToolTip Of Treeview Pin
Venki568-Oct-07 18:09
Venki568-Oct-07 18:09 
QuestionSet XmlSerialize to ignore fields in their default value Pin
eggie57-Oct-07 20:16
eggie57-Oct-07 20:16 
I have the below campaign class. It is serialized to xml in my code. However, I do not want it to serialize the field if it's set to it's default value. In my case, 0 and 2001-01-01T00:00:00-08:00 for int's and datetime's respectively.

How can I have the XmlSerializer ignore them? Is there a global setting for the XmlSerializer class or attributes I can set for each field?

public class campaign : RESTResource
{
    public override String get_endpoint_url()
    {
        return campaign.endpoint_url;
    }

    public static string endpoint_url = "/campaigns/";

    public int id; //if 0; don't serialize
    public string name;
    public int category_id; if 0; don't serialize
    public string subject;
    public string body;
    public string thumbnail;
    public string notes;
    public int ad_id_source; //If 0; don't serialize
    public int campaign_status_id; //If 0; don't serialize
    public DateTime valid_after; //if 2001-01-01T00:00:00-08:00, don't serialize
    public int billing_code; //If 0; don't serialize
    public DateTime created_at; //if 2001-01-01T00:00:00-08:00, don't serialize
    public DateTime updated_at; //if 2001-01-01T00:00:00-08:00, don't serialize
}


/\ |_ E X E GG

AnswerRe: Set XmlSerialize to ignore fields in their default value Pin
stancrm7-Oct-07 20:40
stancrm7-Oct-07 20:40 
GeneralRe: Set XmlSerialize to ignore fields in their default value Pin
eggie57-Oct-07 20:43
eggie57-Oct-07 20:43 
QuestionProblem in uplod File through FTP Pin
pritesh_patel7-Oct-07 19:33
pritesh_patel7-Oct-07 19:33 
AnswerRe: Problem in uplod File through FTP Pin
Nokoff8-Oct-07 2:31
Nokoff8-Oct-07 2:31 
QuestionRe: Problem in uplod File through FTP Pin
pritesh_patel10-Oct-07 20:35
pritesh_patel10-Oct-07 20:35 
Questioncopy column values from one table to another Pin
Glen Harvy7-Oct-07 19:05
Glen Harvy7-Oct-07 19:05 
AnswerRe: copy column values from one table to another Pin
il_masacratore7-Oct-07 21:17
il_masacratore7-Oct-07 21:17 
GeneralRe: copy column values from one table to another Pin
Glen Harvy7-Oct-07 22:32
Glen Harvy7-Oct-07 22:32 
GeneralRe: copy column values from one table to another Pin
il_masacratore8-Oct-07 0:02
il_masacratore8-Oct-07 0:02 
GeneralRe: copy column values from one table to another Pin
Glen Harvy8-Oct-07 1:30
Glen Harvy8-Oct-07 1:30 
GeneralRe: copy column values from one table to another Pin
Andrei Ungureanu8-Oct-07 1:39
Andrei Ungureanu8-Oct-07 1:39 
QuestionExchange Server Pin
M. J. Jaya Chitra7-Oct-07 18:50
M. J. Jaya Chitra7-Oct-07 18:50 
QuestionProblem While Writing To A Text File Pin
rowdykuttan7-Oct-07 15:37
rowdykuttan7-Oct-07 15:37 
AnswerRe: Problem While Writing To A Text File Pin
Christian Graus7-Oct-07 15:56
protectorChristian Graus7-Oct-07 15:56 
GeneralRe: Problem While Writing To A Text File Pin
rowdykuttan7-Oct-07 16:06
rowdykuttan7-Oct-07 16:06 
GeneralRe: Problem While Writing To A Text File Pin
Christian Graus7-Oct-07 16:16
protectorChristian Graus7-Oct-07 16:16 
QuestionGet File Executable Header Pin
Patricio Tapia7-Oct-07 11:49
Patricio Tapia7-Oct-07 11:49 

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.