CodeVariableDeclarationStatementとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CodeVariableDeclarationStatementの意味・解説 

CodeVariableDeclarationStatement クラス

変数宣言表します

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

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class CodeVariableDeclarationStatement
    Inherits CodeStatement
Dim instance As CodeVariableDeclarationStatement
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
public class CodeVariableDeclarationStatement
 : CodeStatement
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
public ref class CodeVariableDeclarationStatement
 : public CodeStatement
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
public class CodeVariableDeclarationStatement
 extends CodeStatement
SerializableAttribute 
ComVisibleAttribute(true) 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
public class CodeVariableDeclarationStatement
 extends CodeStatement
解説解説
使用例使用例

CodeVariableDeclarationStatement使用して変数宣言する例を次に示します

 Dim variableDeclaration As New
 CodeVariableDeclarationStatement( _
    GetType(String), "TestString",
 _ 
    New CodePrimitiveExpression("Testing"))
 

' The first two parameters indicate the type and name of the variable
 to declare.
' The optional initExpression parameter initializes the variable.

' A Visual Basic code generator produces the following source code for
 the preceeding example code:

' Dim TestString As String = "Testing"
CodeVariableDeclarationStatement variableDeclaration = new CodeVariableDeclarationStatement(
    // Type of the variable to declare.
    typeof(string),
    // Name of the variable to declare.
    "TestString",
    // Optional initExpression parameter initializes the variable.
    new CodePrimitiveExpression("Testing") );

// A C# code generator produces the following source code for the preceeding
 example code:

// string TestString = "Testing";
// Type of the variable to declare.
// Name of the variable to declare.
// Optional initExpression parameter initializes the variable.
CodeVariableDeclarationStatement^ variableDeclaration = gcnew CodeVariableDeclarationStatement(
 String::typeid,"TestString",gcnew CodePrimitiveExpression( "Testing"
 ) );

// A C# code generator produces the following source code for the preceeding
 example code:
// string TestString = "Testing";
CodeVariableDeclarationStatement variableDeclaration = 
    new CodeVariableDeclarationStatement(
    // Type of the variable to declare.
    String.class.ToType(),
    // Name of the variable to declare.
    "TestString",
    // Optional initExpression parameter initializes the variable.
    new CodePrimitiveExpression("Testing"));
// A VJ# code generator produces the following source code for the
// preceeding example code:
// String testString = "Testing";
継承階層継承階層
System.Object
   System.CodeDom.CodeObject
     System.CodeDom.CodeStatement
      System.CodeDom.CodeVariableDeclarationStatement
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeVariableDeclarationStatement メンバ
System.CodeDom 名前空間

CodeVariableDeclarationStatement コンストラクタ ()


CodeVariableDeclarationStatement コンストラクタ (Type, String)


CodeVariableDeclarationStatement コンストラクタ (String, String)


CodeVariableDeclarationStatement コンストラクタ (Type, String, CodeExpression)

データ型変数名、および初期化式を指定して、CodeVariableDeclarationStatement クラス新しインスタンス初期化します。

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

Public Sub New ( _
    type As Type, _
    name As String, _
    initExpression As CodeExpression _
)
Dim type As Type
Dim name As String
Dim initExpression As CodeExpression

Dim instance As New CodeVariableDeclarationStatement(type,
 name, initExpression)
public CodeVariableDeclarationStatement (
    Type type,
    string name,
    CodeExpression initExpression
)
public:
CodeVariableDeclarationStatement (
    Type^ type, 
    String^ name, 
    CodeExpression^ initExpression
)
public CodeVariableDeclarationStatement (
    Type type, 
    String name, 
    CodeExpression initExpression
)
public function CodeVariableDeclarationStatement
 (
    type : Type, 
    name : String, 
    initExpression : CodeExpression
)

パラメータ

type

変数データ型

name

変数の名前。

initExpression

変数初期化式を示す CodeExpression。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeVariableDeclarationStatement クラス
CodeVariableDeclarationStatement メンバ
System.CodeDom 名前空間

CodeVariableDeclarationStatement コンストラクタ (CodeTypeReference, String, CodeExpression)

データ型変数名、および初期化式を指定して、CodeVariableDeclarationStatement クラス新しインスタンス初期化します。

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

Public Sub New ( _
    type As CodeTypeReference, _
    name As String, _
    initExpression As CodeExpression _
)
Dim type As CodeTypeReference
Dim name As String
Dim initExpression As CodeExpression

Dim instance As New CodeVariableDeclarationStatement(type,
 name, initExpression)
public CodeVariableDeclarationStatement (
    CodeTypeReference type,
    string name,
    CodeExpression initExpression
)
public:
CodeVariableDeclarationStatement (
    CodeTypeReference^ type, 
    String^ name, 
    CodeExpression^ initExpression
)
public CodeVariableDeclarationStatement (
    CodeTypeReference type, 
    String name, 
    CodeExpression initExpression
)
public function CodeVariableDeclarationStatement
 (
    type : CodeTypeReference, 
    name : String, 
    initExpression : CodeExpression
)

パラメータ

type

変数の型を示す CodeTypeReference。

name

変数の名前。

initExpression

変数初期化式を示す CodeExpression。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeVariableDeclarationStatement クラス
CodeVariableDeclarationStatement メンバ
System.CodeDom 名前空間
CodeExpression クラス

CodeVariableDeclarationStatement コンストラクタ (String, String, CodeExpression)

データ型変数名、および初期化式を指定して、CodeVariableDeclarationStatement クラス新しインスタンス初期化します。

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

Public Sub New ( _
    type As String, _
    name As String, _
    initExpression As CodeExpression _
)
Dim type As String
Dim name As String
Dim initExpression As CodeExpression

Dim instance As New CodeVariableDeclarationStatement(type,
 name, initExpression)
public CodeVariableDeclarationStatement (
    string type,
    string name,
    CodeExpression initExpression
)
public:
CodeVariableDeclarationStatement (
    String^ type, 
    String^ name, 
    CodeExpression^ initExpression
)
public CodeVariableDeclarationStatement (
    String type, 
    String name, 
    CodeExpression initExpression
)
public function CodeVariableDeclarationStatement
 (
    type : String, 
    name : String, 
    initExpression : CodeExpression
)

パラメータ

type

変数データ型の名前。

name

変数の名前。

initExpression

変数初期化式を示す CodeExpression。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeVariableDeclarationStatement クラス
CodeVariableDeclarationStatement メンバ
System.CodeDom 名前空間

CodeVariableDeclarationStatement コンストラクタ (CodeTypeReference, String)

型と名前を指定して、CodeVariableDeclarationStatement クラス新しインスタンス初期化します。

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

Public Sub New ( _
    type As CodeTypeReference, _
    name As String _
)
Dim type As CodeTypeReference
Dim name As String

Dim instance As New CodeVariableDeclarationStatement(type,
 name)
public CodeVariableDeclarationStatement (
    CodeTypeReference type,
    string name
)
public:
CodeVariableDeclarationStatement (
    CodeTypeReference^ type, 
    String^ name
)
public CodeVariableDeclarationStatement (
    CodeTypeReference type, 
    String name
)
public function CodeVariableDeclarationStatement
 (
    type : CodeTypeReference, 
    name : String
)

パラメータ

type

変数データ型を示す CodeTypeReference。

name

変数の名前。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeVariableDeclarationStatement クラス
CodeVariableDeclarationStatement メンバ
System.CodeDom 名前空間

CodeVariableDeclarationStatement コンストラクタ

CodeVariableDeclarationStatement クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
CodeVariableDeclarationStatement () CodeVariableDeclarationStatement クラス新しインスタンス初期化します。
CodeVariableDeclarationStatement (CodeTypeReference, String) 型と名前を指定してCodeVariableDeclarationStatement クラス新しインスタンス初期化します。
CodeVariableDeclarationStatement (String, String) データ型名と変数名指定してCodeVariableDeclarationStatement クラス新しインスタンス初期化します。
CodeVariableDeclarationStatement (Type, String) データ型変数名指定してCodeVariableDeclarationStatement クラス新しインスタンス初期化します。
CodeVariableDeclarationStatement (CodeTypeReference, String, CodeExpression) データ型変数名、および初期化式を指定してCodeVariableDeclarationStatement クラス新しインスタンス初期化します。
CodeVariableDeclarationStatement (String, String, CodeExpression) データ型変数名、および初期化式を指定してCodeVariableDeclarationStatement クラス新しインスタンス初期化します。
CodeVariableDeclarationStatement (Type, String, CodeExpression) データ型変数名、および初期化式を指定してCodeVariableDeclarationStatement クラス新しインスタンス初期化します。
参照参照

関連項目

CodeVariableDeclarationStatement クラス
CodeVariableDeclarationStatement メンバ
System.CodeDom 名前空間

CodeVariableDeclarationStatement プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ EndDirectives  終了ディレクティブを含む CodeDirectiveCollection オブジェクト取得します。 ( CodeStatement から継承されます。)
パブリック プロパティ InitExpression 変数初期化式を取得または設定します
パブリック プロパティ LinePragma  コード ステートメントのある行を取得または設定します。 ( CodeStatement から継承されます。)
パブリック プロパティ Name 変数の名前を取得または設定します
パブリック プロパティ StartDirectives  開始ディレクティブを含む CodeDirectiveCollection オブジェクト取得します。 ( CodeStatement から継承されます。)
パブリック プロパティ Type 変数データ型取得または設定します
パブリック プロパティ UserData  現在のオブジェクトユーザー定義可能なデータ取得または設定します。 ( CodeObject から継承されます。)
参照参照

関連項目

CodeVariableDeclarationStatement クラス
System.CodeDom 名前空間

CodeVariableDeclarationStatement メソッド


CodeVariableDeclarationStatement メンバ

変数宣言表します

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


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド CodeVariableDeclarationStatement オーバーロードされます。 CodeVariableDeclarationStatement クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ EndDirectives  終了ディレクティブを含む CodeDirectiveCollection オブジェクト取得します。(CodeStatement から継承されます。)
パブリック プロパティ InitExpression 変数初期化式を取得または設定します
パブリック プロパティ LinePragma  コード ステートメントのある行を取得または設定します。 (CodeStatement から継承されます。)
パブリック プロパティ Name 変数の名前を取得または設定します
パブリック プロパティ StartDirectives  開始ディレクティブを含む CodeDirectiveCollection オブジェクト取得します。(CodeStatement から継承されます。)
パブリック プロパティ Type 変数データ型取得または設定します
パブリック プロパティ UserData  現在のオブジェクトユーザー定義可能なデータ取得または設定します。(CodeObject から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

CodeVariableDeclarationStatement クラス
System.CodeDom 名前空間



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

辞書ショートカット

すべての辞書の索引

「CodeVariableDeclarationStatement」の関連用語

CodeVariableDeclarationStatementのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS