Table of Contents

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

attributes IEnumerable<ForeignAttribute>

The foreign attributes, in order.

elements IEnumerable<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

ImmutableArray<ForeignAttribute>

Elements

Gets the foreign elements' XML text, in order.

public ImmutableArray<string> Elements { get; }

Property Value

ImmutableArray<string>

IsEmpty

Gets a value indicating whether there is none.

public bool IsEmpty { get; }

Property Value

bool

None

Gets no foreign content.

public static ForeignContent None { get; }

Property Value

ForeignContent

Methods

Equals(ForeignContent?)

Whether the two hold the same attributes and elements, in order.

public bool Equals(ForeignContent? other)

Parameters

other ForeignContent

The other content.

Returns

bool

true when equal.

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ForeignContent?, ForeignContent?)

public static bool operator ==(ForeignContent? left, ForeignContent? right)

Parameters

left ForeignContent
right ForeignContent

Returns

bool

operator !=(ForeignContent?, ForeignContent?)

public static bool operator !=(ForeignContent? left, ForeignContent? right)

Parameters

left ForeignContent
right ForeignContent

Returns

bool