C# Type IsAnsiClass
Description
Type IsAnsiClass
gets a value indicating whether the
string format attribute AnsiClass is selected for the Type.
Syntax
Type.IsAnsiClass
has the following syntax.
public bool IsAnsiClass { get; }
Example
The following example gets the field information and checks for the AnsiClass attribute.
//from ww w . jav a 2s . c o m
using System;
using System.Reflection;
public class MyClass
{
protected string myField = "A sample protected field." ;
}
public class MyType_IsAnsiClass
{
public static void Main()
{
MyClass myObject = new MyClass();
Type myType = typeof(MyClass);
FieldInfo myFieldInfo = myType.GetField("myField", BindingFlags.NonPublic|BindingFlags.Instance);
Console.WriteLine(myType.IsAnsiClass);
}
}
The code above generates the following result.