MemberAttributes 列挙体
アセンブリ: System (system.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Enumeration MemberAttributes

メンバ名 | 説明 | |
---|---|---|
Abstract | 抽象メンバ。 | |
AccessMask | アクセス マスク。 | |
Assembly | 同じアセンブリ内の任意のクラスにアクセスできるメンバ。 | |
Const | 定数メンバ。 | |
Family | クラスと派生クラスのファミリ内にアクセスできるメンバ。 | |
FamilyAndAssembly | クラス内および同じアセンブリの派生クラスにアクセスできるメンバ。 | |
FamilyOrAssembly | クラス内、任意のアセンブリの派生クラス、および同じアセンブリの任意のクラスにアクセスできるメンバ。 | |
Final | 派生クラスでオーバーライドできないメンバ。 | |
New | 新規メンバ。 | |
Overloaded | オーバーロードされたメンバ。Visual Basic などの一部の言語では、オーバーロードされたメンバを明示的に示す必要があります。 | |
Override | 基本クラス メンバをオーバーライドするメンバ。 | |
Private | プライベート メンバ。 | |
Public | パブリック メンバ。 | |
ScopeMask | スコープ マスク。 | |
Static | 静的メンバ。このメンバは、Visual Basic の Shared キーワードと等価です。 | |
VTableMask | VTable マスク。 |


CodeMemberProperty を使用して、get アクセサと set アクセサを持つ string プロパティ定義するコード例を次に示します。
' Declares a property of type String named StringProperty. Dim property1 As New CodeMemberProperty() property1.Name = "StringProperty" property1.Type = New CodeTypeReference("System.String") property1.Attributes = MemberAttributes.Public property1.GetStatements.Add(New CodeMethodReturnStatement(New CodeFieldReferenceExpression(New CodeThisReferenceExpression(), "testStringField"))) property1.SetStatements.Add(New CodeAssignStatement(New CodeFieldReferenceExpression(New CodeThisReferenceExpression(), "testStringField"), New CodePropertySetValueReferenceExpression())) ' A Visual Basic code generator produces the following source code for the preceeding example code: ' Public Overridable Property StringProperty() As String ' Get ' Return Me.testStringField ' End Get ' Set(ByVal Value As String) ' Me.testStringField = value ' End Set ' End Property
// Declares a property of type String named StringProperty. CodeMemberProperty property1 = new CodeMemberProperty(); property1.Name = "StringProperty"; property1.Type = new CodeTypeReference("System.String"); property1.Attributes = MemberAttributes.Public; property1.GetStatements.Add( new CodeMethodReturnStatement( new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "testStringField") ) ); property1.SetStatements.Add( new CodeAssignStatement( new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "testStringField"), new CodePropertySetValueReferenceExpression())); // A C# code generator produces the following source code for the preceeding example code: // public virtual string StringProperty // { // get // { // return this.testStringField; // } // set // { // this.testStringField = value; // } // }
// Declares a property of type String named StringProperty. CodeMemberProperty^ property1 = gcnew CodeMemberProperty; property1->Name = "StringProperty"; property1->Type = gcnew CodeTypeReference( "System.String" ); property1->Attributes = MemberAttributes::Public; property1->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"testStringField" ) ) ); property1->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"testStringField" ),gcnew CodePropertySetValueReferenceExpression ) ); // A C# code generator produces the following source code for the preceeding example code: // public virtual string StringProperty // { // get // { // return this.testStringField; // } // set // { // this.testStringField = value; // } // }
// Declares a property of type String named StringProperty. CodeMemberProperty property1 = new CodeMemberProperty(); property1.set_Name("StringProperty"); property1.set_Type(new CodeTypeReference("System.String")); property1.set_Attributes(MemberAttributes.Public); property1.get_GetStatements().Add(new CodeMethodReturnStatement(new CodeFieldReferenceExpression(new CodeThisReferenceExpression() , "testStringField"))); property1.get_SetStatements().Add(new CodeAssignStatement(new CodeFieldReferenceExpression(new CodeThisReferenceExpression() , "testStringField"), new CodePropertySetValueReferenceExpression())); // /** @property // */ // public String get_StringProperty() // { // return this.get_testStringField(); // } //get_StringProperty // // /** @property // */ // public void set_StringProperty (String value ) // { // this.set_testStringField(value); // } //set_StringProperty

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- MemberAttributes 列挙体のページへのリンク