本文整理汇总了C#中System.Timers.Timer.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Timer.GetHashCode方法的具体用法?C# Timer.GetHashCode怎么用?C# Timer.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Timers.Timer
的用法示例。
在下文中一共展示了Timer.GetHashCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SuspendRedraw
/// <summary>
/// Takes a time-out value which indicates that redraw shall not occur until: (a) the
/// corresponding unsuspendRedraw(suspend_handle_id) call has been made, (b) an
/// unsuspendRedrawAll() call has been made, or (c) its timer has timed out. In
/// environments that do not support interactivity (e.g., print media), then redraw shall
/// not be suspended. suspend_handle_id = suspendRedraw(max_wait_milliseconds) and
/// unsuspendRedraw(suspend_handle_id) must be packaged as balanced pairs. When you
/// want to suspend redraw actions as a collection of SVG DOM changes occur, then
/// precede the changes to the SVG DOM with a method call similar to
/// suspend_handle_id = suspendRedraw(max_wait_milliseconds) and follow the changes with
/// a method call similar to unsuspendRedraw(suspend_handle_id). Note that multiple
/// suspendRedraw calls can be used at once and that each such method call is treated
/// independently of the other suspendRedraw method calls.
/// </summary>
/// <param name="max_wait_milliseconds">The amount of time in milliseconds to hold off
/// before redrawing the device. Values greater than 60 seconds will be truncated
/// down to 60 seconds.</param>
/// <returns>A number which acts as a unique identifier for the given suspendRedraw() call. This value must be passed as the parameter to the corresponding unsuspendRedraw() method call.</returns>
public int SuspendRedraw(int maxWaitMilliseconds)
{
if (maxWaitMilliseconds > 60000)
maxWaitMilliseconds = 60000;
Timer t = new Timer(maxWaitMilliseconds);
t.AutoReset = false;
t.Elapsed += new ElapsedEventHandler(this.RedrawTimerElapsed);
t.Enabled = true;
redrawTimers.Add(t);
return t.GetHashCode();
}