当前位置: 首页>>代码示例>>C#>>正文


C# PValue.CallToString方法代码示例

本文整理汇总了C#中PValue.CallToString方法的典型用法代码示例。如果您正苦于以下问题:C# PValue.CallToString方法的具体用法?C# PValue.CallToString怎么用?C# PValue.CallToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PValue的用法示例。


在下文中一共展示了PValue.CallToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LessThanOrEqual

 public override bool LessThanOrEqual(
     StackContext sctx,
     PValue leftOperand,
     PValue rightOperand,
     out PValue result)
 {
     result =
         StringComparer.Ordinal.Compare(
             leftOperand.CallToString(sctx), rightOperand.CallToString(sctx)) <= 0;
     return true;
 }
开发者ID:SealedSun,项目名称:prx,代码行数:11,代码来源:StringPType.cs

示例2: Addition

 public override bool Addition(
     StackContext sctx, PValue leftOperand, PValue rightOperand, out PValue result)
 {
     var left = leftOperand.CallToString(sctx);
     var right = rightOperand.CallToString(sctx);
     result = System.String.Concat(left, right);
     return true;
 }
开发者ID:SealedSun,项目名称:prx,代码行数:8,代码来源:StringPType.cs

示例3: GreaterThan

 public override bool GreaterThan(
     StackContext sctx, PValue leftOperand, PValue rightOperand, out PValue result)
 {
     result =
         StringComparer.Ordinal.Compare(
             leftOperand.CallToString(sctx), rightOperand.CallToString(sctx)) > 0;
     return true;
 }
开发者ID:SealedSun,项目名称:prx,代码行数:8,代码来源:StringPType.cs

示例4: RunStatically

        public static PValue RunStatically(StackContext sctx, PValue fpv, PValue[] iargs,
            bool useIndirectCallAsFallback)
        {
            IStackAware f;
            IMaybeStackAware m;
            CilClosure cilClosure;
            PFunction func = null;
            PVariable[] sharedVars = null;

            PValue result;
            ReturnMode returnMode;

            if ((cilClosure = fpv.Value as CilClosure) != null)
            {
                func = cilClosure.Function;
                sharedVars = cilClosure.SharedVariables;
            }

            if ((func = func ?? fpv.Value as PFunction) != null && func.HasCilImplementation)
            {
                func.CilImplementation.Invoke(
                    func, CilFunctionContext.New(sctx, func), iargs, sharedVars ?? new PVariable[0],
                    out result, out returnMode);
            }
            else if ((f = fpv.Value as IStackAware) != null)
            {
                //Create stack context, let the engine execute it
                var subCtx = f.CreateStackContext(sctx, iargs);
                sctx.ParentEngine.Process(subCtx);
                result = subCtx.ReturnValue;
                returnMode = subCtx.ReturnMode;
            }
            else if ((m = fpv.Value as IMaybeStackAware) != null)
            {
                StackContext subCtx;
                if (m.TryDefer(sctx, iargs, out subCtx, out result))
                {
                    sctx.ParentEngine.Process(subCtx);
                    result = subCtx.ReturnValue;
                    returnMode = subCtx.ReturnMode;
                }
                else if (useIndirectCallAsFallback)
                {
                    returnMode = ReturnMode.Exit;
                }
                else
                {
                    throw new PrexoniteException(
                        string.Format(
                            "Invocation of {0} did not produce a valid return mode. " +
                                "Only Prexonite functions have a return mode.",
                            fpv.CallToString(sctx)));
                }
            }
            else if (useIndirectCallAsFallback)
            {
                result = fpv.IndirectCall(sctx, iargs);
                returnMode = ReturnMode.Exit;
            }
            else
            {
                throw new PrexoniteException(
                    "call\\sub\\perform requires its argument to be stack aware.");
            }

            return new PValueKeyValuePair(sctx.CreateNativePValue(returnMode), result);
        }
开发者ID:SealedSun,项目名称:prx,代码行数:67,代码来源:CallSubPerform.cs


注:本文中的PValue.CallToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。