本文整理汇总了C#中EmitContext.EmitLoadSubject方法的典型用法代码示例。如果您正苦于以下问题:C# EmitContext.EmitLoadSubject方法的具体用法?C# EmitContext.EmitLoadSubject怎么用?C# EmitContext.EmitLoadSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmitContext
的用法示例。
在下文中一共展示了EmitContext.EmitLoadSubject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitPropertyAccess
void EmitPropertyAccess (EmitContext ec, PropertyInfo property)
{
var getter = property.GetGetMethod (true);
if (!getter.IsStatic)
ec.EmitLoadSubject (expression);
ec.EmitCall (getter);
}
示例2: EmitFieldAccess
void EmitFieldAccess (EmitContext ec, FieldInfo field)
{
if (!field.IsStatic) {
ec.EmitLoadSubject (expression);
ec.ig.Emit (OpCodes.Ldfld, field);
} else
ec.ig.Emit (OpCodes.Ldsfld, field);
}
示例3: EmitLoadMember
internal LocalBuilder EmitLoadMember (EmitContext ec, LocalBuilder local)
{
ec.EmitLoadSubject (local);
return member.OnFieldOrProperty<LocalBuilder> (
field => EmitLoadField (ec, field),
prop => EmitLoadProperty (ec, prop));
}
示例4: EmitLoadMember
internal LocalBuilder EmitLoadMember(EmitContext emitContext, LocalBuilder local)
{
emitContext.EmitLoadSubject(local);
return _member.OnFieldOrProperty
(
field => EmitLoadField(emitContext, field),
prop => EmitLoadProperty(emitContext, prop)
);
}
示例5: EmitPropertyAccess
private void EmitPropertyAccess(EmitContext emitContext, PropertyInfo property)
{
var getter = property.GetGetMethod(true);
if (!getter.IsStatic)
{
emitContext.EmitLoadSubject(_expression);
}
emitContext.EmitCall(getter);
}
示例6: EmitPropertyAssignment
void EmitPropertyAssignment (EmitContext ec, PropertyInfo property, LocalBuilder local)
{
var setter = property.GetSetMethod (true);
if (setter == null)
throw new InvalidOperationException ();
ec.EmitLoadSubject (local);
expression.Emit (ec);
ec.EmitCall (setter);
}
示例7: EmitFieldAccess
private void EmitFieldAccess(EmitContext emitContext, FieldInfo field)
{
if (field.IsStatic)
{
emitContext.ig.Emit(OpCodes.Ldsfld, field);
}
else
{
emitContext.EmitLoadSubject(_expression);
emitContext.ig.Emit(OpCodes.Ldfld, field);
}
}
示例8: EmitFieldAssignment
void EmitFieldAssignment (EmitContext ec, FieldInfo field, LocalBuilder local)
{
ec.EmitLoadSubject (local);
expression.Emit (ec);
ec.ig.Emit (OpCodes.Stfld, field);
}
示例9: EmitFieldAssignment
private void EmitFieldAssignment(EmitContext emitContext, FieldInfo field, LocalBuilder local)
{
emitContext.EmitLoadSubject(local);
expression.Emit(emitContext);
emitContext.ig.Emit(OpCodes.Stfld, field);
}