using System;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
namespace Code.With.Ideone
{
[Serializable]
public abstract class C1
{
[XmlIgnore]
public abstract bool IsValid_C1 { get; set;}
}
[Serializable]
public class C2 : C1
{
public bool IsValid_C2 { get; set; }
private bool IsPrivate_C2 { get; set; }
public override bool IsValid_C1 { get; set;}
public C2()
{
IsValid_C1 = true;
IsValid_C2 = false;
IsPrivate_C2 = true;
}
}
public static class AbstractPropertiesAttributeTest
{
public static void Main(string[] args)
{
Type c2Type = typeof(C2);
PropertyInfo[] allpi = c2Type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
foreach(PropertyInfo pi in allpi)
{
Console.WriteLine(pi.Name);
Console.WriteLine("=================================================");
Attribute[] allatt = Attribute.GetCustomAttributes(pi);
foreach(Attribute attr in allatt)
{
Console.WriteLine(attr.GetType().FullName);
}
Console.WriteLine("**********************************");
}
}
}
}