DefineLiteral() 공개 메소드

public DefineLiteral ( string literalName, object literalValue ) : System.Reflection.Emit.FieldBuilder
literalName string
literalValue object
리턴 System.Reflection.Emit.FieldBuilder
예제 #1
0
 public void TestDefineLiteral()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     FieldBuilder myField = _myEnumBuilder.DefineLiteral("FieldOne", 1);
     _myEnumBuilder.AsType();
     Assert.True(myField.IsLiteral);
     Assert.True(myField.IsPublic);
     Assert.True(myField.IsStatic);
 }
예제 #2
0
		private static FieldBuilder GenerateField (EnumBuilder enumBuilder)
		{
			return enumBuilder.DefineLiteral (_fieldName, _fieldValue);
		}