本文整理汇总了C#中TriAxis.RunSharp.Operand.EmitGet方法的典型用法代码示例。如果您正苦于以下问题:C# Operand.EmitGet方法的具体用法?C# Operand.EmitGet怎么用?C# Operand.EmitGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriAxis.RunSharp.Operand
的用法示例。
在下文中一共展示了Operand.EmitGet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitGetHelper
internal void EmitGetHelper(Operand op, Type desiredType, bool allowExplicitConversion)
{
if (desiredType.IsByRef)
{
if (op.Type != desiredType.GetElementType())
throw new InvalidOperationException(Properties.Messages.ErrByRefTypeMismatch);
op.EmitAddressOf(this);
return;
}
if ((object)op == null)
{
if (desiredType.IsValueType)
throw new ArgumentNullException("op");
il.Emit(OpCodes.Ldnull);
return;
}
op.EmitGet(this);
Convert(op, desiredType, allowExplicitConversion);
}
示例2: EmitArg
void EmitArg(CodeGen g, int index, Operand arg)
{
if (appliedSignature[index].IsByRef)
{
arg.EmitAddressOf(g);
return;
}
if ((object)arg == null)
g.IL.Emit(OpCodes.Ldnull);
else
arg.EmitGet(g);
conversions[index].Emit(g, paramsSignature[index], appliedSignature[index]);
}
示例3: UnsubscribeEvent
public void UnsubscribeEvent(Operand target, string eventName, Operand handler)
{
if ((object)target == null)
throw new ArgumentNullException("target");
if ((object)handler == null)
throw new ArgumentNullException("handler");
IMemberInfo evt = TypeInfo.FindEvent(target.Type, eventName, target.IsStaticTarget);
MethodInfo mi = ((EventInfo)evt.Member).GetRemoveMethod();
if (!target.IsStaticTarget)
target.EmitGet(this);
handler.EmitGet(this);
EmitCallHelper(mi, target);
}
示例4: EmitGetHelper_Conversion
void EmitGetHelper_Conversion(Operand op, Type desiredType, Conversion conv, Type from = null)
{
if (conv.RequiresAddress)
{
if (ReferenceEquals(op, null))
throw new ArgumentException("Conversion from nullref to " + desiredType.Name + " is impossible; for nullables variable it's required to load address.");
op.EmitAddressOf(this);
}
else if (ReferenceEquals(op, null))
IL.Emit(OpCodes.Ldnull);
else
op.EmitGet(this);
if (from == null)
from = (object)op == null ? null : op.GetReturnType(TypeMapper);
conv.Emit(this, from, desiredType);
}
示例5: DoInvoke
void DoInvoke(Operand invocation)
{
BeforeStatement();
invocation.EmitGet(this);
if (invocation.Type != typeof(void))
il.Emit(OpCodes.Pop);
}