本文整理汇总了C#中IRunnable.run方法的典型用法代码示例。如果您正苦于以下问题:C# IRunnable.run方法的具体用法?C# IRunnable.run怎么用?C# IRunnable.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRunnable
的用法示例。
在下文中一共展示了IRunnable.run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: connect
/// <summary>
/// Connect according to the info in ConnectionInfo, and use elementListener.
/// </summary>
///
/// <param name="connectionInfo">A TcpTransport.ConnectionInfo.</param>
/// <param name="elementListener"></param>
/// <param name="onConnected"></param>
/// <exception cref="IOException">For I/O error.</exception>
public override void connect(Transport.ConnectionInfo connectionInfo,
ElementListener elementListener, IRunnable onConnected)
{
close();
socket_ = connectSocket
(((ConnectionInfo)connectionInfo).getHost(),
((ConnectionInfo)connectionInfo).getPort());
elementReader_ = new ElementReader(elementListener);
if (onConnected != null)
onConnected.run();
}
示例2: execute
/// <summary>
/// Executes the given command at some time in the future.
/// The command may execute in a new thread, in a pooled thread,
/// or in the calling thread, at the discretion of the Executor implementation.
/// </summary>
/// <param name="command"></param>
public void execute(IRunnable command)
{
command.run();
}