Class ForeignContent
- Namespace
- NanoQL.Extensions.Conventions
- Assembly
- NanoQL.Extensions.dll
Another tool's content kept on a record or a document's root: the attributes and elements in a namespace other than the conventions', each as the XML text it was read as, compared by content.
public sealed record ForeignContent : IEquatable<ForeignContent>
- Inheritance
-
ForeignContent
- Implements
- Inherited Members
Remarks
An element is kept with its namespace declarations, so it writes back alone. On a record the elements follow its fields; on a root each element keeps its place among the records (ConventionSnapshot).
Constructors
ForeignContent(IEnumerable<ForeignAttribute>, IEnumerable<string>)
Initializes a new instance of the ForeignContent class.
public ForeignContent(IEnumerable<ForeignAttribute> attributes, IEnumerable<string> elements)
Parameters
attributesIEnumerable<ForeignAttribute>The foreign attributes, in order.
elementsIEnumerable<string>The foreign elements' XML text, in order.
Exceptions
- ArgumentNullException
A sequence, an attribute or an element is null.
- ArgumentException
An attribute is in no namespace or the conventions' namespace, or an element isn't one well-formed element in another namespace.
Properties
Attributes
Gets the foreign attributes, in order.
public ImmutableArray<ForeignAttribute> Attributes { get; }
Property Value
Elements
Gets the foreign elements' XML text, in order.
public ImmutableArray<string> Elements { get; }
Property Value
IsEmpty
Gets a value indicating whether there is none.
public bool IsEmpty { get; }
Property Value
None
Gets no foreign content.
public static ForeignContent None { get; }
Property Value
Methods
Equals(ForeignContent?)
Whether the two hold the same attributes and elements, in order.
public bool Equals(ForeignContent? other)
Parameters
otherForeignContentThe other content.
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(ForeignContent?, ForeignContent?)
public static bool operator ==(ForeignContent? left, ForeignContent? right)
Parameters
leftForeignContentrightForeignContent
Returns
operator !=(ForeignContent?, ForeignContent?)
public static bool operator !=(ForeignContent? left, ForeignContent? right)
Parameters
leftForeignContentrightForeignContent