• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ICallable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ICallable类属于命名空间,在下文中一共展示了ICallable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: CallableAsEvaluable

 public CallableAsEvaluable(ICallable callable, object value, IContinuation succ, IFailure fail)
 {
     this.callable = callable;
     this.value = value;
     this.succ = succ;
     this.fail = fail;
 }
开发者ID:jrising,项目名称:ActionReaction,代码行数:7,代码来源:Callables.cs


示例3: Submit

 /// <summary>提交一个线程等待执行
 /// </summary>
 /// <param name="callable">The callable.</param>
 /// <param name="state">The state.</param>
 public static void Submit(ICallable callable, object state)
 {
     if (!callable.IsRunning)
     {
         ThreadPool.QueueUserWorkItem(new WaitCallback(callable.Call), state);
     }
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:11,代码来源:ThreadExcutor.cs


示例4: Invoke

        public object Invoke(ICallable method, object[] parameters)
        {
            if (this.host == null)
                this.host = Machine.Current.GetHost(this.HostId);

            return this.host.Invoke(this, method, parameters);
        }
开发者ID:ajlopez,项目名称:AjSharp,代码行数:7,代码来源:ObjectProxy.cs


示例5: 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


示例6: BrailViewComponentContext

		/// <summary>
		/// Initializes a new instance of the <see cref="BrailViewComponentContext"/> class.
		/// </summary>
		/// <param name="parent">The parent.</param>
		/// <param name="body">The body.</param>
		/// <param name="name">The name.</param>
		/// <param name="text">The text.</param>
		/// <param name="parameters">The parameters.</param>
		public BrailViewComponentContext(BrailBase parent, ICallable body,
										 string name, TextWriter text, IDictionary parameters)
		{
			this.parent = parent;
			this.body = body;
			componentName = name;
			default_writer = text;
			componentParameters = parameters;
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:17,代码来源:BrailViewComponentContext.cs


示例7: BrailViewComponentContext

		/// <summary>
		/// Initializes a new instance of the <see cref="BrailViewComponentContext"/> class.
		/// </summary>
		/// <param name="parent">The parent.</param>
		/// <param name="body">The body.</param>
		/// <param name="name">The name.</param>
		/// <param name="text">The text.</param>
		/// <param name="parameters">The parameters.</param>
		public BrailViewComponentContext(BrailBase parent, ICallable body,
		                                 string name, TextWriter text, IDictionary parameters)
		{
			this.parent = parent;
			this.body = body;
			componentName = name;
			default_writer = text;
			componentParameters = IgnoreNull.ReplaceIgnoreNullsWithTargets(parameters);
		}
开发者ID:candland,项目名称:Castle.MonoRail,代码行数:17,代码来源:BrailViewComponentContext.cs


示例8: AbstractInvocation

		public AbstractInvocation( ICallable callable, object proxy, MethodInfo method, object newtarget )
		{
			this.callable = callable;
			this.proxy = proxy;

			this.target = callable.Target;
			
			if (newtarget != null)
			{
				this.target = newtarget;
			}

			this.method = method;
		}
开发者ID:atczyc,项目名称:castle,代码行数:14,代码来源:AbstractInvocation.cs


示例9: Iterator

        public Iterator(IEnvironment environment, IDynamic iterable)
        {
            _environment = environment;

            var o = iterable.ConvertToObject();
            var createIterator = o.Get("createIterator") as ICallable;
            if (createIterator == null)
                throw environment.CreateTypeError("The object supplied does not contain a callable property named 'createIterator'.");
            _iterator = createIterator.Call(environment, iterable, environment.EmptyArgs).ConvertToObject();
            if (!_iterator.HasProperty("current"))
                throw environment.CreateTypeError("The object returned from the iterable supplied does not have a property named 'current'.");
            _next = _iterator.Get("next") as ICallable;
            if (_next == null)
                throw environment.CreateTypeError("The object returned from the iterable supplied does not have a callable property named 'next'.");
        }
开发者ID:ChaosPandion,项目名称:Machete,代码行数:15,代码来源:Iterator.cs


示例10: Add

        /// <summary>
        /// Adds the given function to the symbol table.
        /// </summary>
        public void Add(ICallable callable)
        {
            // match against the unique name
            var uniqueName = callable.UniqueName();

            //### bob: if we want users to be able to override intrinsics, we may need to handle this differently
            if (mCallables.ContainsKey(uniqueName)) throw new CompileException("A function named " + uniqueName + " has already been declared.");

            mCallables.Add(uniqueName, callable);

            // if there is an inferrable name, also include the name without the type arguments
            if (callable.HasInferrableTypeArguments)
            {
                mCallables.Add(callable.UniqueInferredName(), callable);
            }
        }
开发者ID:rwaldron,项目名称:magpie,代码行数:19,代码来源:FunctionTable.cs


示例11: CallResult

        public static object CallResult(ICallable callable, object value, int maxtime, double exitscore)
        {
            QueueArena arena = new QueueArena();
            BestContinuation getbest = new BestContinuation();
            LastFailure getlast = new LastFailure();

            arena.Call(callable, 100.0, value, getbest.GetContinue(), getlast.GetFail());

            while (maxtime > 0 && getbest.Salience <= exitscore && !arena.IsEmpty)
                maxtime -= arena.EvaluateOne();

            if (getbest.Value == null && getlast.Reason != null)
                return new Exception(getlast.Reason);

            return getbest.Value;
        }
开发者ID:sarang25491,项目名称:Virsona-ChatBot-Tools,代码行数:16,代码来源:QueueArena.cs


示例12: 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:JonKruger,项目名称:MvcContrib,代码行数:18,代码来源:XmlExtension.cs


示例13: RegisterSection

		public void RegisterSection(string name, ICallable section)
		{
			if (sections == null)
			{
				sections = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
			}
			sections[name] = section;
		}
开发者ID:candland,项目名称:Castle.MonoRail,代码行数:8,代码来源:BrailViewComponentContext.cs


示例14: TryFind

        private bool TryFind(string name, IEnumerable<IBoundDecl> typeArguments, IBoundDecl paramType, out ICallable bound)
        {
            string uniqueName = Callable.UniqueName(name, typeArguments, paramType);

            // look up by unique name
            if (mCallables.TryGetValue(uniqueName, out bound)) return true;

            // wasn't found
            return false;
        }
开发者ID:rwaldron,项目名称:magpie,代码行数:10,代码来源:FunctionTable.cs


示例15: Tag

 public void Tag(string name, IDictionary attributes, ICallable block)
 {
     BlockTag(name, attributes, block);
 }
开发者ID:JonKruger,项目名称:MvcContrib,代码行数:4,代码来源:XmlExtension.cs


示例16: ArgumentList

        void ArgumentList(AST parent, ICallable list)
        {
            bool matched;
            ts.allow_reg_exp = true;
            matched = ts.MatchToken (Token.RP);
            ts.allow_reg_exp = false;

            if (!matched) {
                bool first = true;
                do {
                    if (!first)
                        decompiler.AddToken (Token.COMMA);
                    first = false;
                    list.AddArg (AssignExpr (parent, false));
                } while (ts.MatchToken (Token.COMMA));
                MustMatchToken (Token.RP, "msg.no.paren.arg");
            }
            decompiler.AddToken (Token.RP);
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:19,代码来源:Parser.cs


示例17: Invoke

 public virtual object Invoke(ICallable method, object[] parameters)
 {
     return method.Invoke(null, this, parameters);
 }
开发者ID:ajlopez,项目名称:AjScript,代码行数:4,代码来源:DynamicObject.cs


示例18: DefineGetter

 public virtual void DefineGetter (string name, ICallable getter)
 {
     Slot slot = GetSlot (name, name.GetHashCode ());
     if (slot == null) {
         slot = new Slot ();
         AddSlot (name, name.GetHashCode (), slot);
     }
     slot.getter = getter;
 }
开发者ID:rumincayman,项目名称:EcmaScript.NET,代码行数:9,代码来源:ScriptableObject.cs


示例19: DoTopCall

        public static object DoTopCall(ICallable callable, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (scope == null)
                throw new ArgumentException ();
            if (cx.topCallScope != null)
                throw new ApplicationException ();

            object result;
            cx.topCallScope = ScriptableObject.GetTopLevelScope (scope);
            cx.useDynamicScope = cx.HasFeature (Context.Features.DynamicScope);
            ContextFactory f = cx.Factory;
            try {
                result = f.DoTopCall (callable, cx, scope, thisObj, args);
            }
            finally {
                cx.topCallScope = null;
                // Cleanup cached references
                cx.cachedXMLLib = null;

                if (cx.currentActivationCall != null) {
                    // Function should always call exitActivationFunction
                    // if it creates activation record
                    throw new ApplicationException (
                        "ActivationCall without exitActivationFunction() invokation."
                    );
                }
            }
            return result;
        }
开发者ID:arifbudiman,项目名称:TridionMinifier,代码行数:29,代码来源:ScriptRuntime.cs


示例20: HFilterIterable

 public HFilterIterable(IEnvironment environment, IObject iterable, ICallable predicate)
     : base(environment)
 {
     _iterable = iterable;
     _predicate = predicate;
 }
开发者ID:ChaosPandion,项目名称:Machete,代码行数:6,代码来源:HFilterIterable.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICallableType类代码示例发布时间:2022-05-24
下一篇:
C# ICallContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap