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


C# ICallable.Call方法代码示例

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


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

示例1: BlockTag

		private void BlockTag(string tag, IDictionary attributes, ICallable block)
		{
			Output.Write("<{0}", tag);

			System.Collections.Generic.List<string> attributeValues = new System.Collections.Generic.List<string>();

			if (null != attributes)
			{
				foreach(DictionaryEntry entry in attributes)
				{
					attributeValues.Add(string.Format("{0}=\"{1}\"", entry.Key, entry.Value));
				}
			}

			if (0 != attributeValues.Count)
			{
				Output.Write(" ");
				Output.Write(string.Join(" ", attributeValues.ToArray()));
			}

			Output.Write(">");
			if (block != null)
			{
				block.Call(null);
			}
			Output.Write("</{0}>", tag);
		}
开发者ID:ralescano,项目名称:castle,代码行数:27,代码来源:HtmlExtension.cs

示例2: Call

 public int Call(ICallable callable, double salience, object value, IContinuation succ, IFailure fail)
 {
     if (callable is IAgent)
         ((IAgent)callable).Initialize(this, salience);
     if (salience > 0)
         return callable.Call(value, succ, fail);
     return 1;
 }
开发者ID:sarang25491,项目名称:Virsona-ChatBot-Tools,代码行数:8,代码来源:ImmediateArena.cs

示例3: BlockTag

		private void BlockTag(string tag, IDictionary attributes, ICallable block)
		{
			writer.WriteStartElement(tag);

			if (null != attributes)
			{
				foreach(DictionaryEntry entry in attributes)
				{
					writer.WriteAttributeString((string) entry.Key, (string) entry.Value);
				}
			}

			if (block != null)
			{
				block.Call(null);
			}
			writer.WriteEndElement();
		}
开发者ID:ralescano,项目名称:castle,代码行数:18,代码来源:XmlExtension.cs

示例4: map

        public static IEnumerable map(object enumerable, ICallable function)
        {
            if (null == enumerable) throw new ArgumentNullException("enumerable");
            if (null == function) throw new ArgumentNullException("function");

            object[] args = new object[1];
            foreach (object item in iterator(enumerable))
            {
                args[0] = item;
                yield return function.Call(args);
            }
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:12,代码来源:Builtins.cs

示例5: Call

        /// <summary> Call {@link
        /// Callable#call(Context cx, Scriptable scope, Scriptable thisObj,
        /// Object[] args)}
        /// using the Context instance associated with the current thread.
        /// If no Context is associated with the thread, then
        /// {@link ContextFactory#makeContext()} will be called to construct
        /// new Context instance. The instance will be temporary associated
        /// with the thread during call to {@link ContextAction#run(Context)}.
        /// <p>
        /// It is allowed to use null for <tt>factory</tt> argument
        /// in which case the factory associated with the scope will be
        /// used to create new context instances.
        /// 
        /// </summary>
        public static object Call(ContextFactory factory, ICallable callable, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (factory == null) {
                factory = ContextFactory.Global;
            }

            Context cx = CurrentContext;
            if (cx != null) {
                object result;
                if (cx.factory != null) {
                    result = callable.Call (cx, scope, thisObj, args);
                }
                else {
                    // Context was associated with the thread via Context.enter,
                    // set factory to make Context.enter/exit to be no-op
                    // during call
                    cx.factory = factory;
                    try {
                        result = callable.Call (cx, scope, thisObj, args);
                    }
                    finally {
                        cx.factory = null;
                    }
                }
                return result;
            }

            cx = PrepareNewContext (AppDomain.CurrentDomain, factory);
            try {
                return callable.Call (cx, scope, thisObj, args);
            }
            finally {
                ReleaseContext (cx);
            }
        }
开发者ID:arifbudiman,项目名称:TridionMinifier,代码行数:49,代码来源:Context.cs

示例6: callSpecial

        public static object callSpecial(Context cx, ICallable fun, IScriptable thisObj, object [] args, IScriptable scope, IScriptable callerThis, int callType, string filename, int lineNumber)
        {
            if (callType == Node.SPECIALCALL_EVAL) {
                if (BuiltinGlobal.isEvalFunction (fun)) {
                    return evalSpecial (cx, scope, callerThis, args, filename, lineNumber);
                }
            }
            else if (callType == Node.SPECIALCALL_WITH) {
                if (BuiltinWith.IsWithFunction (fun)) {
                    throw Context.ReportRuntimeErrorById ("msg.only.from.new", "With");
                }
            }
            else {
                throw Context.CodeBug ();
            }

            return fun.Call (cx, scope, thisObj, args);
        }
开发者ID:arifbudiman,项目名称:TridionMinifier,代码行数:18,代码来源:ScriptRuntime.cs

示例7: ForEach

 public static void ForEach(Context ctx, IEnumerable<object> set, ICallable func)
 {
     foreach (var obj in set)
     {
         func.Call(ctx.GameState, ctx, new[] { obj });
     }
 }
开发者ID:hgabor,项目名称:boardgame,代码行数:7,代码来源:Game_globals.cs

示例8: DoTopCall

 /// <summary> Execute top call to script or function.
 /// When the runtime is about to execute a script or function that will
 /// create the first stack frame with scriptable code, it calls this method
 /// to perform the real call. In this way execution of any script
 /// happens inside this function.
 /// </summary>
 protected internal virtual object DoTopCall(ICallable callable, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
 {
     return callable.Call (cx, scope, thisObj, args);
 }
开发者ID:arifbudiman,项目名称:TridionMinifier,代码行数:10,代码来源:ContextFactory.cs


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