MethodBuilder.SetSymCustomAttribute メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As MethodBuilder Dim name As String Dim data As Byte() instance.SetSymCustomAttribute(name, data)



SetSymCustomAttribute メソッドを使用して、メソッドに割り当てられたカスタム属性の名前とキーにバイト値を設定する方法を次のコード例に示します。
Dim myMethod As MethodBuilder = myDynamicType.DefineMethod("MyMethod", _ MethodAttributes.Public, GetType(Integer), _ New Type() {GetType(String)}) ' A 128-bit key in hex form, represented as a byte array. Dim keyVal As Byte() = {&H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, _ &H0, &H0, &H0, &H0, &H0, &H60, &HFF, &HFF} Dim encoder As New System.Text.ASCIIEncoding() Dim symFullName As Byte() = encoder.GetBytes("My Dynamic Method") myMethod.SetSymCustomAttribute("SymID", keyVal) myMethod.SetSymCustomAttribute("SymFullName", symFullName)
MethodBuilder myMethod = myDynamicType.DefineMethod("MyMethod", MethodAttributes.Public, typeof(int), new Type[] { typeof(string) }); // A 128-bit key in hex form, represented as a byte array. byte[] keyVal = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xFF, 0xFF }; System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding(); byte[] symFullName = encoder.GetBytes("My Dynamic Method"); myMethod.SetSymCustomAttribute("SymID", keyVal); myMethod.SetSymCustomAttribute("SymFullName", symFullName);
array<Type^>^ temp0 = { String::typeid }; MethodBuilder^ myMethod = myDynamicType->DefineMethod( "MyMethod", MethodAttributes::Public, int::typeid, temp0 ); // A 128-bit key in hex form, represented as a Byte array. array<Byte>^ keyVal = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xFF, 0xFF}; System::Text::ASCIIEncoding^ encoder = gcnew System::Text::ASCIIEncoding; array<Byte>^ symFullName = encoder->GetBytes( "My Dynamic Method" ); myMethod->SetSymCustomAttribute( "SymID", keyVal ); myMethod->SetSymCustomAttribute( "SymFullName", symFullName );
MethodBuilder myMethod = myDynamicType.DefineMethod("MyMethod", MethodAttributes.Public, int.class.ToType(), new Type[] { String.class.ToType() }); // A 128-bit key in hex form, represented as a byte array. ubyte keyVal[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x60, 0xFF, 0xFF }; System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding(); ubyte symFullName[] = encoder.GetBytes("My Dynamic Method"); myMethod.SetSymCustomAttribute("SymID", keyVal); myMethod.SetSymCustomAttribute("SymFullName", symFullName);

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


Weblioに収録されているすべての辞書からMethodBuilder.SetSymCustomAttribute メソッドを検索する場合は、下記のリンクをクリックしてください。

- MethodBuilder.SetSymCustomAttribute メソッドのページへのリンク