本文整理汇总了C#中Business.StartTimer方法的典型用法代码示例。如果您正苦于以下问题:C# Business.StartTimer方法的具体用法?C# Business.StartTimer怎么用?C# Business.StartTimer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Business
的用法示例。
在下文中一共展示了Business.StartTimer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PromptTimerStart
private void PromptTimerStart(Business.Time time){
if (UI.AskYesNoDefNo(this, "Do you want to begin the timer for " + ((time.ForEffort) ? "effort: " + time.Effort.ConventionalId : "rollout: " + time.Rollout.ToString())) == DialogResult.Yes){
_times.Add(time);
time.StartTimer();
Button btn = (time.ForEffort) ? btnTestTimer : btnRollTimer;
UpdateTimerButton(time, btn);
time.OnMinuteChange += new Business.Time.OnMinuteChangeHandler(Time_OnMinuteChange);
}
}
示例2: PromptTimerStop
private void PromptTimerStop(Business.Time time, ref bool cancel){
DialogResult res;
res = MessageBox.Show(this,
"A timer is running for " + ((time.ForEffort) ? "effort: " + time.Effort.ConventionalId : "rollout: " + time.Rollout.ToString()) + "\r\n" +
"Click Yes to stop this timer and submit time to the database\r\n" +
"Click No to allow the timer to continue running in the background\r\n" +
"Click Cancel to return to abort search",
"QED",
MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
if (res == DialogResult.Yes){
time.StopTimer();
SubmitTime(time, ref cancel);
if (!cancel){
_times.Remove(time);
if (time.ForEffort){
UpdateTimerButton(time, btnTestTimer);
}
if (time.ForRollout){
UpdateTimerButton(time, btnRollTimer);
}
}else{
time.StartTimer();
return;
}
}
if (res == DialogResult.No){
cancel = false;
}
if (res == DialogResult.Cancel){
cancel = true;
}else{ // Yes or No
time.OnMinuteChange -= new Business.Time.OnMinuteChangeHandler(Time_OnMinuteChange);
}
}