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 名前空間



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

辞書ショートカット

すべての辞書の索引

「CodeVariableDeclarationStatement クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS