Modifiers

References
[IoId("00000000-d22a-4b09-92af-cec49036f042")] public sealed class Modifiers : IEquatable<Modifiers>, IStorable
Encapsulates all standard modifiers that can be applied to a data tree.

Constructors

Modifiers

#
Deserialize an instance of this class.
public Modifiers(
reader
)

Properties

Empty

#
Gets the default, empty modifiers.
public static Modifiers Empty { get; }

Flatten

#
Gets whether the data tree ought to be flattened.
public bool Flatten { get; }

Graft

#
Gets whether the data tree ought to be grafted.
public bool Graft { get; }

Icons

#
Gets an array of modeicons, representing all active modifiers. This array is cached and should not be modified.
public ModifierIcons Icons { get; }

Increment

#
Gets whether the data tree ought to have its paths renumbered incrementally.
public bool Increment { get; }

IsEmpty

#
Gets whether any modifiers are enabled.
public bool IsEmpty { get; }

Randomise

#
Gets whether the items inside twigs ought to be randomised. This setting makes no sense in combination with Sort or Reverse.
public bool Randomise { get; }

RemoveEmptyTwigs

#
Gets whether empty twigs ought to be removed from the data tree.
public bool RemoveEmptyTwigs { get; }

RemoveInvalidItems

#
Gets whether invalid items ought to be removed from the data tree.
public bool RemoveInvalidItems { get; }

RemoveMetaData

#
Gets whether all meta data ought to be removed from the data tree.
public bool RemoveMetaData { get; }

RemoveNullItems

#
Gets whether null items ought to be removed from the data tree.
public bool RemoveNullItems { get; }

Renumber

#
Gets whether the data tree ought to be renumbered.
public bool Renumber { get; }

Reverse

#
Gets whether the data tree ought to be reversed.
public bool Reverse { get; }

Simplify

#
Gets whether the data tree ought to be simplified.
public bool Simplify { get; }

Sort

#
Gets whether the twigs ought to be sorted. This method will either use the default Comparer or find a comparer based on type assistants.
public bool Sort { get; }

Trim

#
Gets the trim-depth. The [depth] number of elements will be removed from all leading tree elements and appropriate merging will happen.
public int Trim { get; }

Methods

Apply

#
Apply all enabled modifiers to a data tree.
public ITree Apply(
tree,
Tree to modify.
token
Token for cancellation.
)
Modified tree, or original tree if no modifications are defined.

Apply

#
Apply all enabled modifiers to a data tree.
public ITree Apply(
tree
Tree to modify.
)
Modified tree, or original tree if no modifications are defined.

Apply<T>

#
Apply all enabled modifiers to a data tree.
public Tree<T> Apply<T>(
Tree<T>
tree,
Tree to modify.
token
Token for cancellation.
)
Modified tree, or original tree if no modifications are defined.

Apply<T>

#
Apply all enabled modifiers to a data tree.
public Tree<T> Apply<T>(
Tree<T>
tree
Tree to modify.
)
Modified tree, or original tree if no modifications are defined.

Equals

#
Compare two modifiers for equality.
public bool Equals(
other
Other modifiers to compare against.
)
True if both modifiers are identical.

Equals

#
Compare two modifiers for equality.
public override bool Equals(
obj
Other modifiers to compare against.
)
True if both modifiers are identical.
Object.Equals

GetHashCode

#
Gets the hash code of these modifiers.
public override int GetHashCode()
Hash code.

Store

#
Serialize these modifiers.
public void Store(
writer
Writer object.
)
Store

WillAffectTree

#
Tests whether any modifiers have been defined that apply to the given tree. This method does not check whether RemoveInvalidItems should or shouldn't execute, as testing for validity is potentially an expensive operation.
public bool WillAffectTree(
tree
)

WithEmptyTwigRemoval

#
Sets the RemoveEmptyTwigs flag and returns an updated Modifiers instance.
public Modifiers WithEmptyTwigRemoval()

WithFlatten

#
Sets the Flatten flag and returns an updated Modifiers instance.
public Modifiers WithFlatten()

WithGrafting

#
Sets the Graft flag and returns an updated Modifiers instance.
public Modifiers WithGrafting()

WithIncrement

#
Sets the Increment flag and returns an updated Modifiers instance.
public Modifiers WithIncrement()

WithInvalidItemRemoval

#
Sets the RemoveInvalidItems flag and returns an updated Modifiers instance.
public Modifiers WithInvalidItemRemoval()

WithMetaDataRemoval

#
Sets the RemoveMetaData flag and returns an updated Modifiers instance.
public Modifiers WithMetaDataRemoval()

WithNullItemRemoval

#
Sets the RemoveNullItems flag and returns an updated Modifiers instance.
public Modifiers WithNullItemRemoval()

WithoutEmptyTwigRemoval

#
Removes the RemoveEmptyTwigs flag and returns an updated Modifiers instance.
public Modifiers WithoutEmptyTwigRemoval()

WithoutFlatten

#
Remove the Flatten flag and returns an updated Modifiers instance.
public Modifiers WithoutFlatten()

WithoutGrafting

#
Removes the Graft flag and returns an updated Modifiers instance.
public Modifiers WithoutGrafting()

WithoutIncrement

#
Removes the Increment flag and returns an updated Modifiers instance.
public Modifiers WithoutIncrement()

WithoutInvalidItemRemoval

#
Removes the RemoveInvalidItems flag and returns an updated Modifiers instance.
public Modifiers WithoutInvalidItemRemoval()

WithoutMetaDataRemoval

#
Removes the RemoveMetaData flag and returns an updated Modifiers instance.
public Modifiers WithoutMetaDataRemoval()

WithoutNullItemRemoval

#
Removes the RemoveNullItems flag and returns an updated Modifiers instance.
public Modifiers WithoutNullItemRemoval()

WithoutRandomise

#
Removes the Randomise flag and returns an updated Modifiers instance.
public Modifiers WithoutRandomise()

WithoutRenumber

#
Removes the Renumber flag and returns an updated Modifiers instance.
public Modifiers WithoutRenumber()

WithoutReverse

#
Removes the Reverse flag and returns an updated Modifiers instance.
public Modifiers WithoutReverse()

WithoutSimplify

#
Removes the Simplify flag and returns an updated Modifiers instance.
public Modifiers WithoutSimplify()

WithoutSorting

#
Removes the Sort flag and returns an updated Modifiers instance.
public Modifiers WithoutSorting()

WithoutTrimming

#
Removes the trim depth and returns an updated Modifiers instance.
public Modifiers WithoutTrimming()

WithRandomise

#
Sets the Randomise flag and returns an updated Modifiers instance.
public Modifiers WithRandomise()

WithRenumber

#
Sets the Renumber flag and returns an updated Modifiers instance.
public Modifiers WithRenumber()

WithReverse

#
Sets the Reverse flag and returns an updated Modifiers instance.
public Modifiers WithReverse()

WithSimplify

#
Sets the Simplify flag and returns an updated Modifiers instance.
public Modifiers WithSimplify()

WithSorting

#
Sets the Sort flag and returns an updated Modifiers instance.
public Modifiers WithSorting()

WithTrimming

#
Sets the trim depth and returns an updated Modifiers instance.
public Modifiers WithTrimming(
depth
Collapsing depth.
)