AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.8.7" />

.NET API 1,175,040 bytes

 MutationRecord

namespace AngleSharp.Dom { internal sealed class MutationRecord : IMutationRecord { private static readonly string CharacterDataType = "characterData"; private static readonly string AttributesType = "attributes"; private static readonly string ChildListType = "childList"; public bool IsAttribute => Type == AttributesType; public bool IsCharacterData => Type == CharacterDataType; public bool IsChildList => Type == ChildListType; public string Type { get; set; } public INode Target { get; set; } public INodeList Added { get; set; } public INodeList Removed { get; set; } public INode PreviousSibling { get; set; } public INode NextSibling { get; set; } public string AttributeName { get; set; } public string AttributeNamespace { get; set; } public string PreviousValue { get; set; } private MutationRecord() { } public static MutationRecord CharacterData(INode target, string previousValue = null) { MutationRecord mutationRecord = new MutationRecord(); mutationRecord.Type = CharacterDataType; mutationRecord.Target = target; mutationRecord.PreviousValue = previousValue; return mutationRecord; } public static MutationRecord ChildList(INode target, INodeList addedNodes = null, INodeList removedNodes = null, INode previousSibling = null, INode nextSibling = null) { MutationRecord mutationRecord = new MutationRecord(); mutationRecord.Type = ChildListType; mutationRecord.Target = target; mutationRecord.Added = addedNodes; mutationRecord.Removed = removedNodes; mutationRecord.PreviousSibling = previousSibling; mutationRecord.NextSibling = nextSibling; return mutationRecord; } public static MutationRecord Attributes(INode target, string attributeName = null, string attributeNamespace = null, string previousValue = null) { MutationRecord mutationRecord = new MutationRecord(); mutationRecord.Type = AttributesType; mutationRecord.Target = target; mutationRecord.AttributeName = attributeName; mutationRecord.AttributeNamespace = attributeNamespace; mutationRecord.PreviousValue = previousValue; return mutationRecord; } public MutationRecord Copy(bool clearPreviousValue) { MutationRecord mutationRecord = new MutationRecord(); mutationRecord.Type = Type; mutationRecord.Target = Target; mutationRecord.PreviousSibling = PreviousSibling; mutationRecord.NextSibling = NextSibling; mutationRecord.AttributeName = AttributeName; mutationRecord.AttributeNamespace = AttributeNamespace; mutationRecord.PreviousValue = (clearPreviousValue ? null : PreviousValue); mutationRecord.Added = Added; mutationRecord.Removed = Removed; return mutationRecord; } } }