Table of Contents

Struct SectionReplacement<T>

Namespace
ChartTools.Extensions.Linq
Assembly
ChartTools.dll

Defines a set of rules for performing a section replacement operation in a collection.

public readonly struct SectionReplacement<T> : IEquatable<SectionReplacement<T>>

Type Parameters

T
Implements
Inherited Members
Extension Methods

Remarks

Items matching the and EndReplace predicates should not be included in the output.

Constructors

SectionReplacement(IEnumerable<T>, Predicate<T>, Predicate<T>, bool)

Defines a set of rules for performing a section replacement operation in a collection.

public SectionReplacement(IEnumerable<T> Replacement, Predicate<T> StartReplace, Predicate<T> EndReplace, bool AddIfMissing)

Parameters

Replacement IEnumerable<T>

Items to replace with

StartReplace Predicate<T>

Method that defines if a source marks the start of the section to replace

EndReplace Predicate<T>

Method that defines if a source item marks the end of the section to replace

AddIfMissing bool

The replacement should be appended to the collection if the section to replace is not found

Remarks

Items matching the and EndReplace predicates should not be included in the output.

Properties

AddIfMissing

The replacement should be appended to the collection if the section to replace is not found

public bool AddIfMissing { get; init; }

Property Value

bool

EndReplace

Method that defines if a source item marks the end of the section to replace

public Predicate<T> EndReplace { get; init; }

Property Value

Predicate<T>

Replacement

Items to replace with

public IEnumerable<T> Replacement { get; init; }

Property Value

IEnumerable<T>

StartReplace

Method that defines if a source marks the start of the section to replace

public Predicate<T> StartReplace { get; init; }

Property Value

Predicate<T>

Methods

Deconstruct(out IEnumerable<T>, out Predicate<T>, out Predicate<T>, out bool)

public void Deconstruct(out IEnumerable<T> Replacement, out Predicate<T> StartReplace, out Predicate<T> EndReplace, out bool AddIfMissing)

Parameters

Replacement IEnumerable<T>
StartReplace Predicate<T>
EndReplace Predicate<T>
AddIfMissing bool

Equals(SectionReplacement<T>)

public bool Equals(SectionReplacement<T> other)

Parameters

other SectionReplacement<T>

Returns

bool

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 ==(SectionReplacement<T>, SectionReplacement<T>)

public static bool operator ==(SectionReplacement<T> left, SectionReplacement<T> right)

Parameters

left SectionReplacement<T>
right SectionReplacement<T>

Returns

bool

operator !=(SectionReplacement<T>, SectionReplacement<T>)

public static bool operator !=(SectionReplacement<T> left, SectionReplacement<T> right)

Parameters

left SectionReplacement<T>
right SectionReplacement<T>

Returns

bool