本文整理汇总了C#中IClock.RaiseTimeNotifyEvent方法的典型用法代码示例。如果您正苦于以下问题:C# IClock.RaiseTimeNotifyEvent方法的具体用法?C# IClock.RaiseTimeNotifyEvent怎么用?C# IClock.RaiseTimeNotifyEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClock
的用法示例。
在下文中一共展示了IClock.RaiseTimeNotifyEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetClockConfiguration
/// <summary>
/// Sets the clock configuration. Setting the configuration will
/// only have effect if the game hasn't started yet.
/// </summary>
/// <param name="clockConfiguration">The configuration to set</param>
public void SetClockConfiguration(ClockConfiguration clockConfiguration)
{
if (UndoCount == 0 && RedoCount == 0)
{
if (m_clock != null)
{
m_clock.StopClock();
m_clock.WhiteClockNotifier -= WhiteClockEventHandler;
m_clock.BlackClockNotifier -= BlackClockEventHandler;
}
switch (clockConfiguration.ClockType)
{
case ClockType.Conventional:
m_clock = new ConventionalClock(clockConfiguration.ConventionalMoves, clockConfiguration.ConventionalTime);
break;
case ClockType.Incremental:
m_clock = new IncrementalClock(clockConfiguration.IncrementStartTime, clockConfiguration.IncrementPlusTime);
break;
case ClockType.None:
m_clock = new NoneClock();
break;
}
m_clock.WhiteClockNotifier += WhiteClockEventHandler;
m_clock.BlackClockNotifier += BlackClockEventHandler;
m_clock.RaiseTimeNotifyEvent();
}
}