本文整理汇总了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));
}
示例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();
}
}
示例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();
}
}
示例4: With
public virtual void With(object value, IRunnable block)
{
object previous = _value.Get();
_value.Set(value);
try
{
block.Run();
}
finally
{
_value.Set(previous);
}
}
示例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);
}
示例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();
}
}
示例7: Execute
public override void Execute(IRunnable run)
{
run.Run();
}
示例8: BlockedAction
/// <summary>
/// <see cref="IBlockedExecutionHandler.BlockedAction"/>
/// </summary>
/// <returns><c>true</c></returns>
public virtual bool BlockedAction(IRunnable command)
{
command.Run();
return true;
}
示例9: RunSome
static void RunSome(IRunnable runner)
{
runner.Run();
}
示例10: WithContent
protected virtual void WithContent(AbstractBufferContext context, IRunnable runnable
)
{
runnable.Run();
}
示例11: ExchangeUnderlyingBin
public virtual void ExchangeUnderlyingBin(IRunnable closure)
{
lock (this)
{
closure.Run();
}
}
示例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;
}
}
示例13: ExecuteRunnable
/// <summary>
/// Executes the runnable with specified parameter.
/// </summary>
protected virtual Object ExecuteRunnable(IRunnable runnable, Object parameter)
{
return runnable.Run(parameter);
}
示例14: SyncFiles
public override void SyncFiles(IRunnable runnable)
{
runnable.Run();
}
示例15: Warmup
private void Warmup(IRunnable runnable)
{
for (int i = 0; i < 10; i++)
{
// System.out.println(databaseFileSize());
runnable.Run();
}
}