CodeMethodReturnStatement クラス
アセンブリ: System (system.dll 内)

<SerializableAttribute> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ <ComVisibleAttribute(True)> _ Public Class CodeMethodReturnStatement Inherits CodeStatement
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] [ComVisibleAttribute(true)] public class CodeMethodReturnStatement : CodeStatement
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] [ComVisibleAttribute(true)] public ref class CodeMethodReturnStatement : public CodeStatement


CodeMethodReturnStatement を使用して、メソッドから値を返す例を次に示します。
' Defines a method that returns a string passed to it. Dim method1 As New CodeMemberMethod() method1.Name = "ReturnString" method1.ReturnType = New CodeTypeReference("System.String") method1.Parameters.Add(New CodeParameterDeclarationExpression("System.String", "text")) method1.Statements.Add(New CodeMethodReturnStatement(New CodeArgumentReferenceExpression("text"))) ' A Visual Basic code generator produces the following source code for the preceeding example code: ' Private Function ReturnString(ByVal [text] As String) As String ' Return [Text] ' End Function
// Defines a method that returns a string passed to it. CodeMemberMethod method1 = new CodeMemberMethod(); method1.Name = "ReturnString"; method1.ReturnType = new CodeTypeReference("System.String"); method1.Parameters.Add( new CodeParameterDeclarationExpression("System.String", "text") ); method1.Statements.Add( new CodeMethodReturnStatement( new CodeArgumentReferenceExpression("text") ) ); // A C# code generator produces the following source code for the preceeding example code: // private string ReturnString(string text) // { // return text; // }
// Defines a method that returns a string passed to it. CodeMemberMethod^ method1 = gcnew CodeMemberMethod; method1->Name = "ReturnString"; method1->ReturnType = gcnew CodeTypeReference( "System.String" ); method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.String","text" ) ); method1->Statements->Add( gcnew CodeMethodReturnStatement( gcnew CodeArgumentReferenceExpression( "text" ) ) ); // A C# code generator produces the following source code for the preceeding example code: // private string ReturnString(string text) // { // return text; // }
// Defines a method that returns a string passed to it. CodeMemberMethod method1 = new CodeMemberMethod(); method1.set_Name("ReturnString"); method1.set_ReturnType(new CodeTypeReference("System.String")); method1.get_Parameters().Add(new CodeParameterDeclarationExpression( "System.String", "text")); method1.get_Statements().Add(new CodeMethodReturnStatement(new CodeArgumentReferenceExpression("text"))); // A VJ# code generator produces the following source code for // the preceeding example code: // private String ReturnString(String text) // { // return text; // } //ReturnString

System.CodeDom.CodeObject
System.CodeDom.CodeStatement
System.CodeDom.CodeMethodReturnStatement


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


CodeMethodReturnStatement コンストラクタ ()
アセンブリ: System (system.dll 内)


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


CodeMethodReturnStatement コンストラクタ (CodeExpression)
アセンブリ: System (system.dll 内)

Public Sub New ( _ expression As CodeExpression _ )
Dim expression As CodeExpression Dim instance As New CodeMethodReturnStatement(expression)
public CodeMethodReturnStatement ( CodeExpression expression )
public: CodeMethodReturnStatement ( CodeExpression^ expression )
public CodeMethodReturnStatement ( CodeExpression expression )
public function CodeMethodReturnStatement ( expression : CodeExpression )
- expression
戻り値を示す CodeExpression。

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


CodeMethodReturnStatement コンストラクタ

名前 | 説明 |
---|---|
CodeMethodReturnStatement () | CodeMethodReturnStatement クラスの新しいインスタンスを初期化します。 |
CodeMethodReturnStatement (CodeExpression) | 式を指定して、CodeMethodReturnStatement クラスの新しいインスタンスを初期化します。 |

CodeMethodReturnStatement プロパティ

名前 | 説明 | |
---|---|---|
![]() | EndDirectives | 終了ディレクティブを含む CodeDirectiveCollection オブジェクトを取得します。 ( CodeStatement から継承されます。) |
![]() | Expression | 戻り値を取得または設定します。 |
![]() | LinePragma | コード ステートメントのある行を取得または設定します。 ( CodeStatement から継承されます。) |
![]() | StartDirectives | 開始ディレクティブを含む CodeDirectiveCollection オブジェクトを取得します。 ( CodeStatement から継承されます。) |
![]() | UserData | 現在のオブジェクトのユーザー定義可能なデータを取得または設定します。 ( CodeObject から継承されます。) |

CodeMethodReturnStatement メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

CodeMethodReturnStatement メンバ
CodeMethodReturnStatement データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | EndDirectives | 終了ディレクティブを含む CodeDirectiveCollection オブジェクトを取得します。(CodeStatement から継承されます。) |
![]() | Expression | 戻り値を取得または設定します。 |
![]() | LinePragma | コード ステートメントのある行を取得または設定します。 (CodeStatement から継承されます。) |
![]() | StartDirectives | 開始ディレクティブを含む CodeDirectiveCollection オブジェクトを取得します。(CodeStatement から継承されます。) |
![]() | UserData | 現在のオブジェクトのユーザー定義可能なデータを取得または設定します。(CodeObject から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- CodeMethodReturnStatementのページへのリンク