[C#] 属性 (Attribute) クラスやメソッドに対して付加情報を付け加える方法 角括弧で囲んだ属性名を適用先のエンティティの宣言の前に配置する。 例 C# [Serializable] public class SampleClass { // Objects of this type can be serialized. } 12345 [Serializable]public class SampleClass{ // Objects of this type can be serialized.} C# [System.Runtime.InteropServices.DllImport("user32.dll")] extern static void SampleMethod(); 12 [System.Runtime.InteropServices.DllImport("user32.dll")]extern static void SampleMethod(); 参考リンク 属性(C#) | Microsoft Docs @IT 連載:C#入門 第20回 実行時に参照可能な属性