Gets a value indicating whether the corresponding SpecialName attribute is set in the FieldAttributes enumerator.
Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Booleantrue if the SpecialName attribute is set in FieldAttributes; otherwise, false.
Implements
_FieldInfo.IsSpecialNameThe following example returns a value indicating whether or not the fields in the class contain a SpecialName attribute.
using System; using System.Reflection; using System.ComponentModel.Design; class FieldInfo_IsSpecialName { public static void Main() { try { // Get the type handle of a specified class. Type myType = typeof(ViewTechnology); // Get the fields of the specified class. FieldInfo[] myField = myType.GetFields(); Console.WriteLine(" Displaying fields that have SpecialName attributes: "); for(int i = 0; i < myField.Length; i++) { // Determine whether or not each field is a special name. if(myField[i].IsSpecialName) { Console.WriteLine("The field {0} has a SpecialName attribute.", myField[i].Name); } } } catch(Exception e) { Console.WriteLine("Exception : {0} " , e.Message); } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.