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

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

Properties

Empty

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

Flatten

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

Graft

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

Icons

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

Increment

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

IsEmpty

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

Randomise

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

RemoveEmptyTwigs

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

RemoveInvalidItems

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

RemoveMetaData

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

RemoveNullItems

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

Renumber

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

Reverse

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

Simplify

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

Sort

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

Trim

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

Methods

Apply

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

Apply

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

Apply<T>

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

Apply<T>

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

Equals

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

Equals

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

GetHashCode

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

Store

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

WillAffectTree

#
public bool WillAffectTree(ITree tree)
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.
tree (ITree)

WithEmptyTwigRemoval

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

WithFlatten

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

WithGrafting

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

WithIncrement

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

WithInvalidItemRemoval

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

WithMetaDataRemoval

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

WithNullItemRemoval

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

WithoutEmptyTwigRemoval

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

WithoutFlatten

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

WithoutGrafting

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

WithoutIncrement

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

WithoutInvalidItemRemoval

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

WithoutMetaDataRemoval

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

WithoutNullItemRemoval

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

WithoutRandomise

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

WithoutRenumber

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

WithoutReverse

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

WithoutSimplify

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

WithoutSorting

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

WithoutTrimming

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

WithRandomise

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

WithRenumber

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

WithReverse

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

WithSimplify

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

WithSorting

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

WithTrimming

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