OpCode.Value 속성

정의

IL(중간 언어) 명령의 숫자 값을 가져옵니다.

public:
 property short Value { short get(); };
public short Value { get; }
member this.Value : int16
Public ReadOnly Property Value As Short

속성 값

읽기 전용입니다. IL 명령의 숫자 값입니다.

예제

다음 예제에서는 명령의 속성 값을 표시합니다 OpCodes.Add .

using System;
using System.Reflection;
using System.Reflection.Emit;

public class Example
{
   public static void Main()
   {
      OpCode op = OpCodes.Add;
      foreach (var prp in op.GetType().GetProperties())
         Console.WriteLine("{0} ({1}): {2}", prp.Name,
                           prp.PropertyType.Name, prp.GetValue(op));
   }
}
// The example displays the following output:
//       OperandType (OperandType): InlineNone
//       FlowControl (FlowControl): Next
//       OpCodeType (OpCodeType): Primitive
//       StackBehaviourPop (StackBehaviour): Pop1_pop1
//       StackBehaviourPush (StackBehaviour): Push1
//       Size (Int32): 1
//       Value (Int16): 88
//       Name (String): add
Imports System.Reflection
Imports System.Reflection.Emit

Module Example
   Public Sub Main()
      Dim op As OpCode = OpCodes.Add
      For Each prp In op.GetType().GetProperties()
         Console.WriteLine("{0} ({1}): {2}", prp.Name, 
                           prp.PropertyType.Name, prp.GetValue(op))
      Next
   End Sub
End Module
' The example displays the following output:
'       OperandType (OperandType): InlineNone
'       FlowControl (FlowControl): Next
'       OpCodeType (OpCodeType): Primitive
'       StackBehaviourPop (StackBehaviour): Pop1_pop1
'       StackBehaviourPush (StackBehaviour): Push1
'       Size (Int32): 1
'       Value (Int16): 88
'       Name (String): add

설명

속성은 Name 명령의 숫자 값에 해당하는 문자열 이름을 반환합니다.

적용 대상