private void HandleCloseTag(EndElementEvent end) { var elementName = end.Name; var content = end.Descendants; var startCandidate = _stack.Peek() as StartElementEvent; if (startCandidate != null) { if (!string.Equals(startCandidate.Name, elementName)) { _observer.OnError(new ApplicationException($"unexpected closing tag. expected: {startCandidate.Name} actual: {elementName}")); } else { _stack.Pop(); //TODO: check if end and start are interchangable here _observer.OnNext(ProjectStructureItem.Build(startCandidate, content)); return; } } _observer.OnError(new ApplicationException($"unexpected end element: {elementName}")); }
private void HandleClosedTag(EndElementEvent end) { _observer.OnNext(ProjectStructureItem.Build(end)); }