当前位置: 首页>>代码示例>>C#>>正文


C# Timer.setDocumentation方法代码示例

本文整理汇总了C#中Timer.setDocumentation方法的典型用法代码示例。如果您正苦于以下问题:C# Timer.setDocumentation方法的具体用法?C# Timer.setDocumentation怎么用?C# Timer.setDocumentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Timer的用法示例。


在下文中一共展示了Timer.setDocumentation方法的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);
    }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:100,代码来源:TimerSubParser_.cs


注:本文中的Timer.setDocumentation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。