public static DomElementEvent Pop(Fragment fragment) => new DomElementEvent(fragment, DomElementEventType.Pop);
public static DomElementEvent Child(Fragment fragment) => new DomElementEvent(fragment, DomElementEventType.Child);
public static DomElementEvent Push(Fragment fragment) => new DomElementEvent(fragment, DomElementEventType.Push);
public DomElementEvent(Fragment fragment, DomElementEventType type) { Fragment = fragment; Type = type; }
public static bool IsNamed(this Fragment fragment, string name) => string.Compare(fragment.Value, name, true) == 0;
public static Fragment AsCloseFragment(this Fragment fragment) => Fragment.CloseTag(fragment.Value);
public static bool AttributeIs(this Fragment fragment, string name, string value) => (fragment.FragmentType == FragmentType.Open) && fragment.HasAttribute(name) && string.Compare(fragment.GetAttributeValue(name), value, true) == 0;
public static bool IsClose(this Fragment fragment, string name = null) => (fragment.FragmentType == FragmentType.Close) && (name == null || IsNamed(fragment, name));