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


C# IRunnable.Run方法代码示例

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


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

示例1: AssertQueryEvents

 private void AssertQueryEvents(IRunnable query)
 {
     var events = new ArrayList();
     var eventRegistry = EventRegistryFactory.ForObjectContainer(FileSession
         ());
     eventRegistry.QueryStarted += new _IEventListener4_40(events).OnEvent;
     eventRegistry.QueryFinished += new _IEventListener4_45(events).OnEvent;
     query.Run();
     string[] expected = {QueryStarted, QueryFinished};
     Iterator4Assert.AreEqual(expected, Iterators.Iterator(events));
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:ServerQueryEventsTestCase.cs

示例2: Run

        static void Run(IRunnable run)
        {
            string s = "y";
            while (s.StartsWith("y", StringComparison.OrdinalIgnoreCase))
            {
                run.Run();

                Console.Write("Enter y to continue:");

                s = Console.ReadLine();
            }
        }
开发者ID:karthiksk76,项目名称:Projects,代码行数:12,代码来源:Program.cs

示例3: Execute

 /// <summary> Execute the given command directly in the current thread,
 /// within the supplied lock.
 /// </summary>
 public virtual void Execute(IRunnable command)
 {
     mutex_.Acquire();
     try
     {
         command.Run();
     }
     finally
     {
         mutex_.Release();
     }
 }
开发者ID:rlxrlxrlx,项目名称:spring-net-threading,代码行数:15,代码来源:LockedExecutor.cs

示例4: With

		public virtual void With(object value, IRunnable block)
		{
			object previous = _value.Get();
			_value.Set(value);
			try
			{
				block.Run();
			}
			finally
			{
				_value.Set(previous);
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:13,代码来源:DynamicVariable.cs

示例5: WithContent

		protected override void WithContent(AbstractBufferContext context, IRunnable runnable
			)
		{
			int address = context.ReadInt();
			int length = context.ReadInt();
			if (address == 0)
			{
				return;
			}
			IReadBuffer temp = context.Buffer();
			ByteArrayBuffer indirectedBuffer = Container(context).DecryptedBufferByAddress(address
				, length);
			context.Buffer(indirectedBuffer);
			runnable.Run();
			context.Buffer(temp);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:16,代码来源:ArrayHandler0.cs

示例6: Execute

 public void Execute (IRunnable runnable)
 {            
     if (runnable == serviceSupport.StartedCommand)
     {
         ServiceSupportTest.Log ("waiting to start ...");
         starting.Acquire();
         ServiceSupportTest.Log ("starting ...");
         runnable.Run();
         wasStarted = true;
         ServiceSupportTest.Log ("releasing started sync ...");
         started.Release();
         ServiceSupportTest.Log ("started ...");
     }
     else
     {
         ServiceSupportTest.Log ("unexpected runnable: " + runnable);
         runnable.Run();
     }
 }
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:19,代码来源:ServiceSupportTest.cs

示例7: Execute

 public override void Execute(IRunnable run)
 {
     run.Run();
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:4,代码来源:CallingThreadExecutor.cs

示例8: BlockedAction

 /// <summary>
 /// <see cref="IBlockedExecutionHandler.BlockedAction"/>
 /// </summary>
 /// <returns><c>true</c></returns>
 public virtual bool BlockedAction(IRunnable command)
 {
     command.Run();
     return true;
 }
开发者ID:rlxrlxrlx,项目名称:spring-net-threading,代码行数:9,代码来源:PooledExecutor.cs

示例9: RunSome

 static void RunSome(IRunnable runner)
 {
     runner.Run();
 }
开发者ID:Elta20042004,项目名称:Training,代码行数:4,代码来源:Class1.cs

示例10: WithContent

		protected virtual void WithContent(AbstractBufferContext context, IRunnable runnable
			)
		{
			runnable.Run();
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:5,代码来源:ArrayHandler.cs

示例11: ExchangeUnderlyingBin

			public virtual void ExchangeUnderlyingBin(IRunnable closure)
			{
				lock (this)
				{
					closure.Run();
				}
			}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:SaveAsStorage.cs

示例12: WithExceptionHandlingInCallback

		private void WithExceptionHandlingInCallback(IRunnable runnable)
		{
			_inCallback = true;
			try
			{
				runnable.Run();
			}
			catch (Db4oException e)
			{
				throw;
			}
			catch (Exception x)
			{
				throw new EventException(x);
			}
			finally
			{
				_inCallback = false;
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:20,代码来源:EventRegistryImpl.cs

示例13: ExecuteRunnable

 /// <summary>
 /// Executes the runnable with specified parameter.
 /// </summary>
 protected virtual Object ExecuteRunnable(IRunnable runnable, Object parameter)
 {
     return runnable.Run(parameter);
 }
开发者ID:szabototo89,项目名称:CodeSharper,代码行数:7,代码来源:StandardExecutor.cs

示例14: SyncFiles

 public override void SyncFiles(IRunnable runnable)
 {
     runnable.Run();
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:TransportObjectContainer.cs

示例15: Warmup

		private void Warmup(IRunnable runnable)
		{
			for (int i = 0; i < 10; i++)
			{
				//        	System.out.println(databaseFileSize());
				runnable.Run();
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:FileSizeTestCase.cs


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