Click here to Skip to main content
15,909,530 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i define user control in my project and they have property.i save their property with xml when click save button.
please help me
my code like this:
C#
private string condition;
public string Condition
{
    get { return condition; }
    set { condition = value; }
}
private bool checkwhile;

public bool CheckWhile
{
    get { return checkwhile; }
    set { checkwhile = value; }
}
private bool checkfor;

public bool CheckFor
{
    get { return checkfor; }
    set { checkfor = value; }
}

public int Iteration
{
    get { return iteration; }
    set { iteration = value; }
}
Posted
Updated 14-Nov-11 13:11pm
v3
Comments
Orcun Iyigun 14-Nov-11 19:13pm    
so what is your question?

1 solution

Use Data Contract. Add appropriate attributes [DataConract] and [DataMembers] to your type and members you need to be part of the contract (some or all of the members can be private, it does not matter) and use DataContractSerializer or DataContractJsonSerializer.

For further detail, see:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[^].

See also my past solutions:
How can I utilize XML File streamwriter and reader in my form application?[^],
Creating a property files...[^],
deseralize a json string array[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900