本文整理汇总了C#中EmitContext.EmitNullableGetValue方法的典型用法代码示例。如果您正苦于以下问题:C# EmitContext.EmitNullableGetValue方法的具体用法?C# EmitContext.EmitNullableGetValue怎么用?C# EmitContext.EmitNullableGetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmitContext
的用法示例。
在下文中一共展示了EmitContext.EmitNullableGetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitUserDefinedLiftedOperator
void EmitUserDefinedLiftedOperator (EmitContext ec)
{
var local = ec.EmitStored (operand);
ec.EmitNullableGetValue (local);
ec.EmitCall (method);
}
示例2: EmitCoalesce
void EmitCoalesce (EmitContext ec)
{
var ig = ec.ig;
var done = ig.DefineLabel ();
var load_right = ig.DefineLabel ();
var left = ec.EmitStored (this.left);
var left_is_nullable = left.LocalType.IsNullable ();
if (left_is_nullable)
ec.EmitNullableHasValue (left);
else
ec.EmitLoad (left);
ig.Emit (OpCodes.Brfalse, load_right);
if (left_is_nullable && !Type.IsNullable ())
ec.EmitNullableGetValue (left);
else
ec.EmitLoad (left);
ig.Emit (OpCodes.Br, done);
ig.MarkLabel (load_right);
ec.Emit (this.right);
ig.MarkLabel (done);
}
示例3: EmitCoalesce
private void EmitCoalesce(EmitContext emitContext)
{
var ig = emitContext.ig;
var done = ig.DefineLabel();
var load_right = ig.DefineLabel();
var left = emitContext.EmitStored(_left);
var left_is_nullable = left.LocalType.IsNullable();
if (left_is_nullable)
{
emitContext.EmitNullableHasValue(left);
}
else
{
emitContext.EmitLoad(left);
}
ig.Emit(OpCodes.Brfalse, load_right);
if (left_is_nullable && !Type.IsNullable())
{
emitContext.EmitNullableGetValue(left);
}
else
{
emitContext.EmitLoad(left);
}
ig.Emit(OpCodes.Br, done);
ig.MarkLabel(load_right);
emitContext.Emit(_right);
ig.MarkLabel(done);
}