public void ResetAll() {
            List<string> keys;

            keys = new List<string>(counters.Keys);
            foreach (var key in keys) {
                counters[key] = 0;
            }

            keys = new List<string>(events.Keys);
            foreach (var key in keys) {
                events[key] = false;
            }

            if (sSplits.Length > 0) {
                currentSplitIdx = 0;
                currentSplit = sSplits[currentSplitIdx];
            }
        }
        public void SetSettings(XmlNode settings) {
            XmlNodeList splitNodes = settings.SelectNodes("//Splits/Split");

            XmlNode autostartNode = settings.SelectSingleNode("//Autostart");
            if (autostartNode != null && autostartNode.InnerText != "") {
                this.autoStart = bool.Parse(autostartNode.InnerText);
            } else {
                this.autoStart = false;
            }

            XmlNode autoresetNode = settings.SelectSingleNode("//Autoreset");
            if (autoresetNode != null && autoresetNode.InnerText != "") {
                this.autoReset = bool.Parse(autoresetNode.InnerText);
            } else {
                this.autoReset = false;
            }

            XmlNode showMapNode = settings.SelectSingleNode("//MapDisplay");
            if (showMapNode != null && showMapNode.InnerText != "") {
                this.showMapDisplay = bool.Parse(showMapNode.InnerText);
            } else {
                this.showMapDisplay = false;
            }

            splitsState.Clear();
            foreach (XmlNode splitNode in splitNodes) {
                string name = splitNode.InnerText;
                string value = splitNode.Attributes["Value"].Value;
                var splitItem = splitNode.Attributes["DontSplit"];
                bool dontSplit = false;
                if (splitItem != null) {
                    dontSplit = bool.Parse(splitItem.Value);
                }

                Split split = new Split(name, value, dontSplit);

                splitsState.Add(split);
            }

            parent.oriState.UpdateAutoStart(this.autoStart);
            parent.oriState.UpdateAutoReset(this.autoReset);
            parent.oriState.UpdateSplits(this.splitsState);
        }
        public Split GoToNextSplit() {
            if (currentSplitIdx + 1 >= sSplits.Length) return currentSplit;

            currentSplitIdx++;
            currentSplit = sSplits[currentSplitIdx];

            return currentSplit;
        }
        public void UpdateSettings() {
            if (isLoading) return;

            splitsState.Clear();
            foreach (Control c in flowMain.Controls) {
                if (c is SplitSettings) {
                    SplitSettings setting = (SplitSettings)c;
                    if (!string.IsNullOrEmpty(setting.cboName.Text) && !string.IsNullOrEmpty(setting.txtValue.Text)) {
                        Split split = new Split();
                        split.name = setting.cboName.Text;
                        split.value = setting.txtValue.Text;
                        split.dontSplit = setting.chkDontSplit.Checked;

                        splitsState.Add(split);
                    }
                }
            }

            this.autoStart = chkAutoStart.Checked;
            this.autoReset = chkAutoReset.Checked;
            this.showMapDisplay = chkShowMapDisplay.Checked;

            parent.oriState.UpdateAutoStart(this.autoStart);
            parent.oriState.UpdateAutoReset(this.autoReset);
            parent.oriState.UpdateSplits(this.splitsState);
        }