本文整理汇总了C#中Timer.setEndCond方法的典型用法代码示例。如果您正苦于以下问题:C# Timer.setEndCond方法的具体用法?C# Timer.setEndCond怎么用?C# Timer.setEndCond使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer.setEndCond方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseElement
public override void ParseElement(XmlElement element)
{
XmlNodeList
initscondition = element.SelectNodes("init-condition"),
endscondition = element.SelectNodes("end-condition"),
effects = element.SelectNodes("effect"),
postseffect = element.SelectNodes("post-effect");
string tmpArgVal;
string time = "";
bool usesEndCondition = true;
bool runsInLoop = true;
bool multipleStarts = true;
bool countDown = false, showWhenStopped = false, showTime = false;
string displayName = "timer";
tmpArgVal = element.GetAttribute("time");
if (!string.IsNullOrEmpty(tmpArgVal))
{
time = tmpArgVal;
}
tmpArgVal = element.GetAttribute("usesEndCondition");
if (!string.IsNullOrEmpty(tmpArgVal))
{
usesEndCondition = tmpArgVal.Equals("yes");
}
tmpArgVal = element.GetAttribute("runsInLoop");
if (!string.IsNullOrEmpty(tmpArgVal))
{
runsInLoop = tmpArgVal.Equals("yes");
}
tmpArgVal = element.GetAttribute("multipleStarts");
if (!string.IsNullOrEmpty(tmpArgVal))
{
multipleStarts = tmpArgVal.Equals("yes");
}
tmpArgVal = element.GetAttribute("showTime");
if (!string.IsNullOrEmpty(tmpArgVal))
{
showTime = tmpArgVal.Equals("yes");
}
tmpArgVal = element.GetAttribute("displayName");
if (!string.IsNullOrEmpty(tmpArgVal))
{
displayName = tmpArgVal;
}
tmpArgVal = element.GetAttribute("countDown");
if (!string.IsNullOrEmpty(tmpArgVal))
{
countDown = tmpArgVal.Equals("yes");
}
tmpArgVal = element.GetAttribute("showWhenStopped");
if (!string.IsNullOrEmpty(tmpArgVal))
{
showWhenStopped = tmpArgVal.Equals("yes");
}
timer = new Timer(long.Parse(time));
timer.setRunsInLoop(runsInLoop);
timer.setUsesEndCondition(usesEndCondition);
timer.setMultipleStarts(multipleStarts);
timer.setShowTime(showTime);
timer.setDisplayName(displayName);
timer.setCountDown(countDown);
timer.setShowWhenStopped(showWhenStopped);
if (element.SelectSingleNode("documentation") != null)
timer.setDocumentation(element.SelectSingleNode("documentation").InnerText);
foreach (XmlElement el in initscondition)
{
currentConditions = new Conditions();
new ConditionSubParser_(currentConditions, chapter).ParseElement(el);
timer.setInitCond(currentConditions);
}
foreach (XmlElement el in endscondition)
{
currentConditions = new Conditions();
new ConditionSubParser_(currentConditions, chapter).ParseElement(el);
timer.setEndCond(currentConditions);
}
foreach (XmlElement el in effects)
{
currentEffects = new Effects();
new EffectSubParser_(currentEffects, chapter).ParseElement(el);
timer.setEffects(currentEffects);
}
foreach (XmlElement el in postseffect)
{
currentEffects = new Effects();
new EffectSubParser_(currentEffects, chapter).ParseElement(el);
timer.setPostEffects(currentEffects);
}
chapter.addTimer(timer);
}