_Type.IsAnsiClass プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > _Type.IsAnsiClass プロパティの意味・解説 

_Type.IsAnsiClass プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

COM オブジェクトに、Type.IsAnsiClass プロパティへのバージョン依存しないアクセス用意されています。

このプロパティは、CLS準拠していません。  

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim instance As _Type
Dim value As Boolean

value = instance.IsAnsiClass
bool IsAnsiClass { get; }
property bool IsAnsiClass {
    bool get ();
}
/** @property */
boolean get_IsAnsiClass ()
function get IsAnsiClass () : boolean

プロパティ
Type に、文字列書式属性として AnsiClass選択されている場合trueそれ以外場合false

解説解説

このプロパティは、アンマネージ コードからマネージ クラスアクセスするためのプロパティであるため、マネージ コードからは呼び出さないください

Type.IsAnsiClass プロパティは、Type に、文字列書式属性として AnsiClass選択されているかどうかを示す値を取得します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Type.IsAnsiClass プロパティ

Type に、文字列書式属性として AnsiClass選択されているかどうかを示す値を取得します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim instance As Type
Dim value As Boolean

value = instance.IsAnsiClass
public bool IsAnsiClass { get;
 }
/** @property */
public final boolean get_IsAnsiClass ()

プロパティ
Type に、文字列書式属性として AnsiClass選択されている場合trueそれ以外場合false

解説解説

StringFormatMask は、文字列書式属性選択します文字書式属性は、文字列解釈方法定義することによって、相互運用性拡張します。

現在の Typeジェネリック型表している場合、このプロパティは型が構築される元になったジェネリック型定義関連します。たとえば、現在の TypeMyGenericType<int> (Visual Basic では MyGenericType(Of Integer)) を表す場合、このプロパティの値は MyGenericType<T> によって決まります

現在の Typeジェネリック型型パラメータ表している場合、このプロパティは常に false返します

使用例使用例

フィールド情報取得しAnsiClass 属性チェックを行う例を次に示します

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic
Public Class MyClass1
    Protected myField As String
 = "A sample protected field."
End Class 'MyClass1
Public Class MyType_IsAnsiClass
    Public Shared Sub Main()
        Try
            Dim myObject As New
 MyClass1()
            ' Get the type of MyClass1.
            Dim myType As Type = GetType(MyClass1)
            ' Get the field information and the attributes associated
 with MyClass1.
            Dim myFieldInfo As FieldInfo =
 myType.GetField("myField", BindingFlags.NonPublic
 Or BindingFlags.Instance)

            Console.WriteLine(ControlChars.NewLine + "Checking
 for AnsiClass attribute for a field." + ControlChars.NewLine)
            ' Get and display the name, field, and the AnsiClass attribute.
            Console.WriteLine("Name of Class: {0} "
 + ControlChars.NewLine + "Value of Field: {1} "
 + ControlChars.NewLine + "IsAnsiClass = {2}", myType.FullName, myFieldInfo.GetValue(myObject), myType.IsAnsiClass)
        Catch e As Exception
            Console.WriteLine("Exception: {0}", e.Message.ToString())
        End Try
    End Sub 'Main
End Class 'MyType_IsAnsiClass
using System;
using System.Reflection;
public class MyClass
{
    protected string myField = "A sample
 protected field." ;
}
public class MyType_IsAnsiClass
{
    public static void Main()
    {
        try
        {
            MyClass myObject = new MyClass();
            // Get the type of the 'MyClass'.
            Type myType = typeof(MyClass);
            // Get the field information and the attributes associated
 with MyClass.
            FieldInfo myFieldInfo = myType.GetField("myField", BindingFlags.NonPublic|BindingFlags.Instance);
            Console.WriteLine( "\nChecking for the AnsiClass
 attribute for a field.\n"); 
            // Get and display the name, field, and the AnsiClass attribute.
            Console.WriteLine("Name of Class: {0} \nValue of Field: {1} \nIsAnsiClass
 = {2}", myType.FullName, myFieldInfo.GetValue(myObject), myType.IsAnsiClass);
        }
        catch(Exception e)
        {
            Console.WriteLine("Exception: {0}",e.Message);
        }
    }
}
using namespace System;
using namespace System::Reflection;
public ref class MyClass
{
protected:
   String^ myField;

public:
   MyClass()
   {
      myField =  "A sample protected field";
   }
};

int main()
{
   try
   {
      MyClass^ myObject = gcnew MyClass;
      
      // Get the type of the 'MyClass'.
      Type^ myType = MyClass::typeid;
      
      // Get the field information and the attributes associated with
 MyClass.
      FieldInfo^ myFieldInfo = myType->GetField( "myField", static_cast<BindingFlags>(BindingFlags::NonPublic
 | BindingFlags::Instance) );
      Console::WriteLine( "\nChecking for the AnsiClass attribute
 for a field.\n" );
      
      // Get and display the name, field, and the AnsiClass attribute.
      Console::WriteLine( "Name of Class: {0} \nValue of Field: {1} \nIsAnsiClass
 = {2}", myType->FullName, myFieldInfo->GetValue( myObject ), myType->IsAnsiClass
 );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception: {0}", e->Message );
   }
}
import System.*;
import System.Reflection.*;
public class MyClass
{
    protected String myField = "A sample protected
 field.";
} //MyClass

public class MyType_IsAnsiClass
{
    public static void main(String[]
 args)
    {
        try {
            MyClass myObject = new MyClass();
            // Get the type of the 'MyClass'.
            Type myType = MyClass.class.ToType();
            // Get the field information and the attributes associated
 with
            // MyClass.
            FieldInfo myFieldInfo = myType.GetField("myField", BindingFlags.
                NonPublic | BindingFlags.Instance);
            Console.WriteLine("\nChecking for the AnsiClass
 attribute for" 
                + " a field.\n");
            // Get and display the name, field, and the AnsiClass attribute.
            Console.WriteLine("Name of Class: {0} \nValue of Field: {1} \n"
 
                + "IsAnsiClass = {2}", myType.get_FullName(), myFieldInfo.
                GetValue(myObject), System.Convert.ToString(myType.
                get_IsAnsiClass()));
        }
        catch (System.Exception e) {
            Console.WriteLine("Exception: {0}", e.get_Message());
        }
    } //main
} //MyType_IsAnsiClass
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Type クラス
Type メンバ
System 名前空間
TypeAttributes
IsUnicodeClass
IsAutoClass


このページでは「.NET Framework クラス ライブラリ リファレンス」から_Type.IsAnsiClass プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書から_Type.IsAnsiClass プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書から_Type.IsAnsiClass プロパティを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「_Type.IsAnsiClass プロパティ」の関連用語

_Type.IsAnsiClass プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



_Type.IsAnsiClass プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS