MethodBuilder.SetSymCustomAttribute(String, Byte[]) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Blob을 사용하여 기호화된 사용자 지정 특성을 설정합니다.
public:
void SetSymCustomAttribute(System::String ^ name, cli::array <System::Byte> ^ data);
public void SetSymCustomAttribute(string name, byte[] data);
member this.SetSymCustomAttribute : string * byte[] -> unit
Public Sub SetSymCustomAttribute (name As String, data As Byte())
매개 변수
- name
- String
기호화된 사용자 지정 특성의 이름입니다.
- data
- Byte[]
기호화된 사용자 지정 특성의 값을 나타내는 바이트 Blob입니다.
예외
포함 형식은 이전에 .를 사용하여 CreateType()만들었습니다.
-또는-
이 메서드를 포함하는 모듈은 디버그 모듈이 아닙니다.
-또는-
현재 메서드의 경우 속성은 IsGenericMethodtrue.이지만 IsGenericMethodDefinition 속성은 false.
예제
아래 코드 샘플에서는 메서드에 연결된 사용자 지정 특성의 SetSymCustomAttribute 이름과 키에 대한 바이트 값을 설정하는 메서드의 컨텍스트 사용법을 보여 줍니다.
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);
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)
설명
메타데이터 사용자 지정 특성과 달리 이 사용자 지정 특성은 기호 작성기와 연결됩니다.