FieldInfo.IsSpecialNameとは? わかりやすく解説

FieldInfo.IsSpecialName プロパティ

対応する SpecialName 属性が FieldAttributes 列挙子に設定されているかどうかを示す値を取得します

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

Dim instance As FieldInfo
Dim value As Boolean

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

プロパティ
FieldAttributesSpecialName 属性設定されている場合trueそれ以外場合false

解説解説

アンダースコア (_)、プロパティ アクセサメソッドオーバーロードする演算子などで始まるか、それらを含む名前は、一部コンパイラでは特別な処理が必要になります

使用例使用例

クラスフィールドが SpecialName 属性持っているかどうかを示す値を返す例を次に示します

Imports System
Imports System.Reflection
Imports System.ComponentModel.Design
Imports Microsoft.VisualBasic

Class FieldInfo_IsSpecialName

    Public Shared Sub Main()
        Try
            ' Get the type handle of a specified class.
            Dim myType As Type = GetType(ViewTechnology)

            ' Get the fields of a specified class.
            Dim myField As FieldInfo() = myType.GetFields()

            Console.WriteLine(ControlChars.Cr + "Displaying fields
 that have SpecialName attributes:" + ControlChars.Cr)
            Dim i As Integer
            For i = 0 To myField.Length - 1
                ' Determine whether or not each field is a special name.
                If myField(i).IsSpecialName Then
                    Console.WriteLine("The field {0} has a SpecialName
 attribute.", myField(i).Name)
                End If
            Next i
        Catch e As Exception
            Console.WriteLine("Exception : {0} ",
 e.Message.ToString())
        End Try
    End Sub 'Main
End Class 'FieldInfo_IsSpecialName
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("\nDisplaying fields that have SpecialName attributes:\n");
            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);
        }
    }
}
#using <system.dll>

using namespace System;
using namespace System::Reflection;
using namespace System::ComponentModel::Design;

int main()
{
   try
   {
      // Get the type handle of a specified class.
      Type^ myType = ViewTechnology::typeid;

      // Get the fields of the specified class.
      array<FieldInfo^>^myField = myType->GetFields();
      Console::WriteLine( "\nDisplaying fields that have SpecialName attributes:\n"
 );
      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 );
   }
}
import System.*;
import System.Reflection.*;
import System.ComponentModel.Design.*;

class FieldInfoIsSpecialName
{
    public static void main(String[]
 args)
    {
        try {
            // Get the type handle of a specified class.
            Type myType = ViewTechnology.class.ToType();

            // Get the fields of the specified class.
            FieldInfo myField[] = myType.GetFields();
            Console.WriteLine("\nDisplaying fields that have SpecialName"
 
                + " attributes:\n");
            for (int i = 0; i < myField.length;
 i++) {
                // Determine whether or not each field is a special
 name.
                if (myField[i].get_IsSpecialName()) {
                    Console.WriteLine("The field {0} has a SpecialName"
 
                        + " attribute.", myField[i].get_Name());
                }
            }
        }
        catch (System.Exception e) {
            Console.WriteLine("Exception : {0} ", e.get_Message());
        }
    } //main
} //FieldInfoIsSpecialName
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

_FieldInfo.IsSpecialName プロパティ

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

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

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

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

Dim instance As _FieldInfo
Dim value As Boolean

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

プロパティ
FieldAttributes に SpecialName 属性設定されている場合trueそれ以外場合false

解説解説

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

IsSpecialName プロパティは、対応する SpecialName 属性FieldAttributes 列挙子に設定されているかどうかを示す値を取得します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
_FieldInfo インターフェイス
_FieldInfo メンバ
System.Runtime.InteropServices 名前空間


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

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

辞書ショートカット

すべての辞書の索引

「FieldInfo.IsSpecialName」の関連用語

FieldInfo.IsSpecialNameのお隣キーワード
検索ランキング

   

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



FieldInfo.IsSpecialNameのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS