CodeAttributeArgument クラスとは? わかりやすく解説

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

CodeAttributeArgument クラス

メタデータ属性宣言使用する引数表します

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

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

クラス作成しコード属性追加してクラスシリアル化でき、今後使用しないことを宣言するコード次に示します

    // Declare a new type called Class1.
    CodeTypeDeclaration class1 = new CodeTypeDeclaration("Class1");

    // Use attributes to mark the class as serializable and obsolete.
    CodeAttributeDeclaration codeAttrDecl = new CodeAttributeDeclaration(
                                                "System.Serializable");
    class1.CustomAttributes.Add(codeAttrDecl);

    CodeAttributeArgument codeAttr = new CodeAttributeArgument(
               new CodePrimitiveExpression("This class
 is obsolete."));
    codeAttrDecl = new CodeAttributeDeclaration("System.Obsolete",
 
                                                       codeAttr);
    class1.CustomAttributes.Add(codeAttrDecl);
// A C# code generator produces the following source code for the preceeding
 example code:
//    [System.Serializable()]
//    [System.Obsolete("This class is obsolete.")]
//    public class Class1 {
//    }
    ' Declare a new type called Class1.
    Dim class1 As New CodeTypeDeclaration("Class1")

    ' Use attributes to mark the class as serializable and obsolete.
    Dim codeAttrDecl As New
 CodeAttributeDeclaration("System.Serializable")
    class1.CustomAttributes.Add(codeAttrDecl)

    Dim codeAttr As New
 CodeAttributeArgument( _
                   new CodePrimitiveExpression("This
 class is obsolete."))
    codeAttrDecl = New CodeAttributeDeclaration("System.Obsolete",
 codeAttr)
    class1.CustomAttributes.Add(codeAttrDecl)

' A Visual Basic code generator produces the following source code for
 the preceeding example code:
'    <System.Serializable(),  _
'     System.Obsolete("This class is obsolete.")>  _
'    Public Class Class1
'    End Class
継承階層継承階層
System.Object
  System.CodeDom.CodeAttributeArgument
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeAttributeArgument メンバ
System.CodeDom 名前空間
CodeAttributeDeclaration
CodeAttributeArgumentCollection


このページでは「.NET Framework クラス ライブラリ リファレンス」からCodeAttributeArgument クラスを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCodeAttributeArgument クラスを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCodeAttributeArgument クラス を検索

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

辞書ショートカット

すべての辞書の索引

「CodeAttributeArgument クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS