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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version