public bool addForwardState(UniState state) { foreach (UniState _state in forwardStateList) { if (_state == state) { return(false); } } forwardStateList.Add(state); state.addPreState(this); return(true); }
public static void xmlEle2BlockLinks(XmlElement xblock) { BlockState blockState = getBlockState(xblock.GetAttribute("name")); XmlNodeList stateList = xblock.SelectNodes("state"); foreach (XmlElement xstate in stateList) { UniState state = null; foreach (UniState _state in blockState.stateList) { if (_state.name.Equals(xstate.GetAttribute("name"))) { state = _state; } } foreach (XmlElement xele in xstate.ChildNodes) { if ("previous".Equals(xele.Name)) { string[] preList = xele.InnerText.Split(';'); foreach (string pre in preList) { string key = pre; if (string.IsNullOrEmpty(key)) { continue; } if (!key.Contains(".")) { key = xblock.GetAttribute("name") + "." + key; } if (s_Instance.stateDict.ContainsKey(key)) { state.addPreState(s_Instance.stateDict[key]); } } } if ("forward".Equals(xele.Name)) { string[] forList = xele.InnerText.Split(';'); foreach (string forw in forList) { string key = forw; if (string.IsNullOrEmpty(key)) { continue; } if (!key.Contains(".")) { key = xblock.GetAttribute("name") + "." + key; } if (s_Instance.stateDict.ContainsKey(key)) { state.addForwardState(s_Instance.stateDict[key]); } } } } } }