I would expect there to be three lines of output from this code, but there are none:
[AttributeUsage( AttributeTargets.Property )]
public class FieldAttribute : System.Attribute
{
public String FieldName
{
get;
set;
}
}
public class Host
{
[Field]
public String FieldOne
{
get;
set;
}
[Field(FieldName="Foo")]
public String FieldTwo
{
get;
set;
}
[FieldAttribute]
public String FieldThree
{
get;
set;
}
public String FieldFour
{
get;
set;
}
}
class Program
{
static void Main( string[] args )
{
Type t = typeof(Host);
foreach ( Object att in t.GetCustomAttributes( typeof(FieldAttribute), true ) )
{
Console.WriteLine( att.ToString() );
}
}
}
Am I missing soemthing obvious?
Andrew