C# FieldInfo IsSpecialName
Description
FieldInfo IsSpecialName
Gets a value indicating whether
the corresponding SpecialName attribute is set in the FieldAttributes
enumerator.
Syntax
FieldInfo.IsSpecialName
has the following syntax.
public bool IsSpecialName { get; }
Example
using System;//from ww w .j a v a 2 s . com
using System.Reflection;
using System.ComponentModel.Design;
class FieldInfo_IsSpecialName
{
public static void Main()
{
Type myType = typeof(ViewTechnology);
FieldInfo[] myField = myType.GetFields();
for(int i = 0; i < myField.Length; i++)
{
if(myField[i].IsSpecialName)
{
Console.WriteLine("The field {0} has a SpecialName attribute.",
myField[i].Name);
}
}
}
}
The code above generates the following result.