private static bool EndElement(Stack<IPropertyListItem> items, string elementName, string expectedName, PropertyListItemTypes type) { if (elementName == expectedName) { if (items != null && items.Count > 0 && items.Peek().Type == type) { items.Pop(); return true; } throw new FormatException("Expected '" + expectedName + "' element closing tag"); } return false; }
/// <summary> /// Hidden constructor. /// </summary> protected PropertyListItem(string key, PropertyListItemTypes type) { _key = key; _type = type; }
private static bool EndElement(Stack <IPropertyListItem> items, string elementName, string expectedName, PropertyListItemTypes type) { if (elementName == expectedName) { if (items != null && items.Count > 0 && items.Peek().Type == type) { items.Pop(); return(true); } throw new FormatException("Expected '" + expectedName + "' element closing tag"); } return(false); }