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


C# FSM.Reset方法代码示例

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


在下文中一共展示了FSM.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LogicShit

        //private List<XmlWavEvent> pendingRussian;
        public LogicShit(AudioRecManager recMan)
        {
            this.recMan = recMan;
            FilenameFormat = DumpFolder + "/segment_{0}.wav";

            #region FSM with XML

            fsmWithXml = new FSM<Keys>()
                .addNode_0_(LogicState.Ready)
                .addEdge___(Keys.Enter, LogicState.DeqedLang1, (args) => {
                    IlyaXml = new XmlIlyaFrankAbook() {
                        Lang1Mp3Filename = Lang1Mp3,
                        Lang1Prefix = AudioBooker.classes.UtilsCore.GetFullPathWithoutExtension(Lang1Mp3)
                    };
                    new_paragraph();
                    nextLang1Phrase();
                    readCurLang1Phrase();
                    FireHandler(CurParagraphUpdated);
                })
                .addNode_0_(LogicState.DeqedLang1)
                .addEdge___(Keys.R, LogicState.DeqedLang1, (args) => readCurLang1Phrase())
                .addEdge___(Keys.P, LogicState.DeqedLang1, (args) => {
                    purgeParaAllExceptLast();
                    FireHandler(CurParagraphUpdated);
                })
                .addEdge___(Keys.Space, LogicState.Recording1st, (args) => {
                    startSegment();
                    FireHandler(CurSegmentUpdated);
                    FireHandler(CurParagraphUpdated);
                })
                .addNode_0_(LogicState.Recording1st)
                .addEdge___(Keys.R, LogicState.Recording1st, (args) => readCurLang1Phrase())
                .addEdge___(Keys.P, LogicState.DeqedLang1, (args) => {
                    purgeParaAllExceptLast();
                    stopAndDeleteSegment();
                    FireHandler(CurSegmentUpdated);
                    FireHandler(CurParagraphUpdated);
                })
                .addEdge___(Keys.Back, LogicState.Recording1st, (args) => {
                    stopAndDeleteSegment();
                    startSegment();
                    FireHandler(CurSegmentUpdated);
                })
                .addEdge___(Keys.Space, LogicState.RecordingMore, (args) => {
                    commitSegment();
                    startSegment();
                    FireHandler(CurParagraphUpdated);
                    FireHandler(CurSegmentUpdated);
                })
                .addNode_0_(LogicState.RecordingMore)
                .addEdge___(Keys.R, LogicState.RecordingMore, (args) => readCurLang1Phrase())
                .addEdge___(Keys.Back, LogicState.RecordingMore, (args) => {
                    stopAndDeleteSegment();
                    startSegment();
                    FireHandler(CurSegmentUpdated);
                })
                .addEdge___(Keys.Space, LogicState.RecordingMore, (args) => {
                    commitSegment();
                    startSegment();
                    FireHandler(CurParagraphUpdated);
                    FireHandler(CurSegmentUpdated);
                })
                .addEdge___(Keys.D1, LogicState.RecordingMore, (args) => {
                    stopAndDeleteSegment();
                    RecordedSegments = CurIlyaSentence.Lang1Segments;
                    startSegment();
                    FireHandler(CurParagraphUpdated);
                    FireHandler(CurSegmentUpdated);
                })
                .addEdge___(Keys.D2, LogicState.RecordingMore, (args) => {
                    stopAndDeleteSegment();
                    RecordedSegments = CurIlyaSentence.Lang2Segments;
                    startSegment();
                    FireHandler(CurParagraphUpdated);
                    FireHandler(CurSegmentUpdated);
                })
                .addEdge___(Keys.Enter, LogicState.DeqedLang1, (args) => {
                    stopAndDeleteSegment();
                    nextLang1Phrase();
                    readCurLang1Phrase();
                    FireHandler(CurSegmentUpdated);
                    FireHandler(CurParagraphUpdated);
                })
                .addEdge___(Keys.P, LogicState.CommitedParagraph, (args) => {
                    stopAndDeleteSegment();
                    new_paragraph();
                    FireHandler(CurSegmentUpdated);
                    FireHandler(CurParagraphUpdated);
                })
                .addNode_0_(LogicState.CommitedParagraph)
                .addEdge___(Keys.Enter, LogicState.DeqedLang1, (args) => {
                    nextLang1Phrase();
                    readCurLang1Phrase();
                    FireHandler(CurSegmentUpdated);
                    FireHandler(CurParagraphUpdated);
                })
            ;
            fsmWithXml.Reset();

//.........这里部分代码省略.........
开发者ID:miktemk,项目名称:AudioBooker,代码行数:101,代码来源:LogicShit.cs


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