FieldInfo.IsSpecialName プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)



クラスのフィールドが 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

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_FieldInfo.IsSpecialName プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

FieldAttributes に SpecialName 属性が設定されている場合は true。それ以外の場合は false。

このプロパティは、アンマネージ コードからマネージ クラスにアクセスするためのプロパティであるため、マネージ コードからは呼び出さないでください。
IsSpecialName プロパティは、対応する SpecialName 属性が FieldAttributes 列挙子に設定されているかどうかを示す値を取得します。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からFieldInfo.IsSpecialNameを検索する場合は、下記のリンクをクリックしてください。

- FieldInfo.IsSpecialNameのページへのリンク