المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : NonSerialized property.



C# Programming
07-02-2009, 02:22 PM
Hi all,
I'm coding a serializator using Reflection. Suppose I have the following simple class:


public class TestDataType
{
[NonSerialized]
private string _name;

public string Name { get { return _name; } set { _name = value; }
}

How do I programmatically check that the value of the property Name has not to be serialized? It seems that PropertyInfo doesn't contain that information. Notice that the field _name is private so I can't even obtain the FieldInfo.

Hope for help.

Greetings.