當前位置: 首頁>>代碼示例>>C#>>正文


C# PhpStack.PeekValueUnchecked方法代碼示例

本文整理匯總了C#中PHP.Core.PhpStack.PeekValueUnchecked方法的典型用法代碼示例。如果您正苦於以下問題:C# PhpStack.PeekValueUnchecked方法的具體用法?C# PhpStack.PeekValueUnchecked怎麽用?C# PhpStack.PeekValueUnchecked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PHP.Core.PhpStack的用法示例。


在下文中一共展示了PhpStack.PeekValueUnchecked方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Filter

        private object Filter(object instance, PhpStack/*!*/ stack)
		{
            StringBuilder result = new StringBuilder();

			Debug.Assert(stack.ArgCount >= 1, "Called by output buffering, so should be ok");

            string data = PhpVariable.AsString(stack.PeekValueUnchecked(1));

			stack.RemoveFrame();

            // parse the text
            if (parser == null)
                parser = new TagsUrlRewriter(this);

            return parser.ParseHtml(parserState, data);
		}
開發者ID:tiaohai,項目名稱:Phalanger,代碼行數:16,代碼來源:UrlRewriter.CLR.cs

示例2: MapIdentity

		/// <summary>
		/// Default callback for <see cref="Map"/>.
		/// </summary>
		/// <param name="instance">Unused.</param>
		/// <param name="stack">A PHP stack.</param>
		/// <returns>A <see cref="PhpArray"/> containing items on the stack (passed as arguments).</returns>
		private static object MapIdentity(object instance, PhpStack stack)
		{
			PhpArray result = new PhpArray(stack.ArgCount, 0);

			for (int i = 1; i <= stack.ArgCount; i++)
			{
				result.Add(PhpVariable.Copy(stack.PeekValueUnchecked(i), CopyReason.PassedByCopy));
			}
			stack.RemoveFrame();

			return result;
		}
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:18,代碼來源:Arrays.cs

示例3: InvokeMethodDynamic

        public static object InvokeMethodDynamic(string moduleName, string className, string methodName, PhpObject self,
            PhpStack stack, int[] refInfo)
        {
            int arg_count = stack.ArgCount;
            object[] args = new object[arg_count];
            PhpReference[] references = new PhpReference[arg_count];

            // convert arguments on calling stack into the args array
            stack.CalleeName = methodName;
            int ref_ptr = (refInfo != null && refInfo.Length > 0 ? 0 : -1);
            for (int i = 0; i < arg_count; i++)
            {
                if (ref_ptr >= 0)
                {
                    if (i == refInfo[ref_ptr])
                    {
                        args[i] = references[i] = stack.PeekReferenceUnchecked(i + 1);
                        if (++ref_ptr >= refInfo.Length) ref_ptr = -1;
                        continue;
                    }
                    else if (refInfo[ref_ptr] == -1)
                    {
                        args[i] = references[i] = stack.PeekReferenceUnchecked(i + 1);
                        continue;
                    }
                }
                args[i] = stack.PeekValueUnchecked(i + 1);
            }
            stack.RemoveFrame();

            if (refInfo == null || refInfo.Length == 0)
            {
                return InvokeMethod(moduleName, className, methodName, self, stack.Context, ref args, null);
            }
            else
            {
                object ret_val = InvokeMethod(moduleName, className, methodName, self, stack.Context, ref args, refInfo);

                // propagate back byref parameters
                for (int i = 0; i < arg_count; i++)
                {
                    if (references[i] != null) references[i].Value = args[i];
                }

                return ret_val;
            }
        }
開發者ID:kripper,項目名稱:Phalanger,代碼行數:47,代碼來源:Externals.CLR.cs


注:本文中的PHP.Core.PhpStack.PeekValueUnchecked方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。