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


C# ICallable类代码示例

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


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


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