// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using ICSharpCode.AvalonEdit.Document;
namespace ICSharpCode.AvalonEdit.Xml
{
///
/// Represents any markup starting with "<" and (hopefully) ending with ">"
///
public class AXmlTag: AXmlContainer
{
/// These identify the start of DTD elements
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification="ReadOnlyCollection is immutable")]
public static readonly ReadOnlyCollection DtdNames = new ReadOnlyCollection(
new string[] {" Opening bracket - usually "<"
public string OpeningBracket { get; internal set; }
/// Name following the opening bracket
public string Name { get; internal set; }
/// Opening bracket - usually ">"
public string ClosingBracket { get; internal set; }
/// True if tag starts with "<"
public bool IsStartOrEmptyTag { get { return OpeningBracket == "<"; } }
/// True if tag starts with "<" and ends with ">"
public bool IsStartTag { get { return OpeningBracket == "<" && ClosingBracket == ">"; } }
/// True if tag starts with "<" and does not end with ">"
public bool IsEmptyTag { get { return OpeningBracket == "<" && ClosingBracket != ">" ; } }
/// True if tag starts with "</"
public bool IsEndTag { get { return OpeningBracket == ""; } }
/// True if tag starts with "<?"
public bool IsProcessingInstruction { get { return OpeningBracket == ""; } }
/// True if tag starts with "<!--"
public bool IsComment { get { return OpeningBracket == "