private void AddStateName(DocumentNode stateNode, string stateName) { DocumentNode parentNode = StateNameBuilder.GetParentNode(stateNode); if (parentNode == null) { return; } IType nodeType = StateNameBuilder.GetNodeType(parentNode); List <string> list; if (nodeType.XamlSourcePath != null) { if (!this.stateNamesByType.TryGetValue(nodeType, out list)) { list = new List <string>(); this.stateNamesByType[nodeType] = list; } } else if (!this.stateNamesByNode.TryGetValue(parentNode, out list)) { list = new List <string>(); this.stateNamesByNode[parentNode] = list; } list.Add(stateName); }
public IEnumerable <string> GetStateNamesForNode(DocumentNode node) { IType nodeType = StateNameBuilder.GetNodeType(node); List <string> list; if (!this.stateNamesByNode.TryGetValue(node, out list) && !this.stateNamesByType.TryGetValue(nodeType, out list)) { list = new List <string>(); } return((IEnumerable <string>)list); }