CodeParameterDeclarationExpression
メンバ
コンストラクタ
- public CodeParameterDeclarationExpression();
-
- 概要
- System.CodeDom.CodeParameterDeclarationExpression クラスの新しいインスタンスを初期化します。
- public CodeParameterDeclarationExpression( CodeTypeReference type, string name );
-
- 概要
- パラメーター型とパラメーター名を指定して、CodeParameterDeclarationExpression クラスの新しいインスタンスを初期化します。
- パラメーター
-
- type
- 宣言するパラメーターの型を示すオブジェクト。
- name
- 宣言するパラメーターの名前。
- public CodeParameterDeclarationExpression( string type, string name );
-
- 概要
- 新しいインスタンスを初期化、 System.CodeDom.CodeParameterDeclarationExpression クラスの指定されたパラメーター型と名を使用します。
- パラメーター
-
- type
- 宣言するパラメーターの型。
- name
- 宣言するパラメーターの名前。
- public CodeParameterDeclarationExpression( Type type, string name );
-
- 概要
- 新しいインスタンスを初期化、 System.CodeDom.CodeParameterDeclarationExpression クラスの指定されたパラメーター型と名を使用します。
- パラメーター
-
- type
- 宣言するパラメーターの型。
- name
- 宣言するパラメーターの名前。
プロパティ
-
public
CodeAttributeDeclarationCollection
CustomAttributes{ get; set; }
【 CodeAttributeDeclaration 】 -
- 概要
- パラメーター宣言のカスタム属性を取得または設定します。
- 戻り値
- カスタム属性を示すオブジェクト。
- public FieldDirection Direction{ get; set; }
-
- 概要
- 取得またはフィールドの方向を設定します。
- 戻り値
- フィールドの方向を示すオブジェクト。
- public CodeTypeReference Type{ get; set; }
-
- 概要
- パラメーターの型を取得または設定します。
- 戻り値
- パラメーターの型。
- public string Name{ get; set; }
-
- 概要
- パラメーターの名前を取得または設定します。
- 戻り値
- パラメーターの名前。
- UserData
- 現在のオブジェクトのユーザー定義可能なデータを取得します。 (Inherited from CodeObject )
メソッド
- Equals(Object)
- 指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。 (Inherited from Object)
- GetHashCode()
- 既定のハッシュ関数として機能します。 (Inherited from Object)
- GetType()
- 現在のインスタンスの Type を取得します。 (Inherited from Object)
- MemberwiseClone()
- 現在の Object の簡易コピーを作成します。 (Inherited from Object)
- ToString()
- 現在のオブジェクトを表す文字列を返します。 (Inherited from Object)
例
次の例での使用CodeParameterDeclarationExpression別のメソッドを使用して、パラメーターを宣言するFieldDirectionフィールド参照の型指定子。
// Declares a method.
// 方法を宣言する。
CodeMemberMethod method1 = new CodeMemberMethod();
method1.Name = "TestMethod";
// Declares a string parameter passed by reference.
// ストリングパラメータを、参照が通過すると宣言する。
CodeParameterDeclarationExpression param1 = new CodeParameterDeclarationExpression("System.String", "stringParam");
param1.Direction = FieldDirection.Ref;
method1.Parameters.Add(param1);
// Declares a Int32 parameter passed by incoming field.
// Int32パラメータを、受信フィールドが通過すると宣言する。
CodeParameterDeclarationExpression param2 = new CodeParameterDeclarationExpression("System.Int32", "intParam");
param2.Direction = FieldDirection.Out;
method1.Parameters.Add(param2);
// A C# code generator produces the following source code for the preceeding example code:
// A C#コードジェネレータはpreceeding例コードのための以下のソースコードを作り出す:
// private void TestMethod(ref string stringParam, out int intParam) {
// }
定義
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Serializable]
public class CodeParameterDeclarationExpression : System.CodeDom.CodeExpression
クラス
#region アセンブリ System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// C:¥Program Files (x86)¥Reference Assemblies¥Microsoft¥Framework¥.NETFramework¥v4.6.1¥System.dll
#endregion
using System.Runtime.InteropServices;
namespace System.CodeDom
{
//
// 概要:
// メソッド、プロパティ、またはコンス トラクターのパラメーター宣言を表します。
[ClassInterface( ClassInterfaceType.AutoDispatch )]
[ComVisible( true )]
public class CodeParameterDeclarationExpression : CodeExpression
{
//
// 概要:
// System.CodeDom.CodeParameterDeclarationExpression クラスの新しいインスタンスを初期化します。
public CodeParameterDeclarationExpression();
//
// 概要:
// 新しいインスタンスを初期化、 System.CodeDom.CodeParameterDeclarationExpression クラスの指定されたパラメーター型と名を使用します。
//
// パラメーター:
// type:
// 宣言するパラメーターの型を示すオブジェクト。
//
// name:
// 宣言するパラメーターの名前。
public CodeParameterDeclarationExpression( CodeTypeReference type, string name );
//
// 概要:
// 新しいインスタンスを初期化、 System.CodeDom.CodeParameterDeclarationExpression クラスの指定されたパラメーター型と名を使用します。
//
// パラメーター:
// type:
// 宣言するパラメーターの型。
//
// name:
// 宣言するパラメーターの名前。
public CodeParameterDeclarationExpression( string type, string name );
//
// 概要:
// 新しいインスタンスを初期化、 System.CodeDom.CodeParameterDeclarationExpression クラスの指定されたパラメーター型と名を使用します。
//
// パラメーター:
// type:
// 宣言するパラメーターの型。
//
// name:
// 宣言するパラメーターの名前。
public CodeParameterDeclarationExpression( Type type, string name );
//
// 概要:
// 取得またはパラメーターの宣言のカスタム属性を設定します。
//
// 戻り値:
// カスタム属性を示すオブジェクト。
public CodeAttributeDeclarationCollection CustomAttributes
{
get;
set;
}
//
// 概要:
// 取得またはフィールドの方向を設定します。
//
// 戻り値:
// フィールドの方向を示すオブジェクト。
public FieldDirection Direction
{
get;
set;
}
//
// 概要:
// 取得またはパラメーターの型を設定します。
//
// 戻り値:
// パラメーターの型。
public CodeTypeReference Type
{
get;
set;
}
//
// 概要:
// パラメーターの名前を取得または設定します。
//
// 戻り値:
// パラメーターの名前。
public string Name
{
get;
set;
}
}
}