SolutionData

References
public sealed class SolutionData
Storage class for object solution results.

Properties

CustomData

#
public FleetingCustomData CustomData { get; }
Gets the fleeting custom data dictionary where custom values can be stored.

Duration

#
public TimeSpan Duration { get; set; }
Gets the time it took to compute this data. This property can be set in case additional duration needs to be added to the measured duration so far. Just make sure you're adding the correct amount to the correct state if you are setting this.

Id

#
public SolutionId Id { get; }
Gets the id of the solution which spawned this data.

IsEmpty

#
public bool IsEmpty { get; }
Gets whether this result contains an ITree, any messages, or any custom data.

KeyedTreeCount

#
public int KeyedTreeCount { get; }
Gets the number of keyed trees stored in this data.

Messages

#
public Messages Messages { get; }
Gets all messages associated with this object.

Methods

AddMessage

#
public void AddMessage(Message message)
Add a message to the message set.
message (Message)

AddMessages

#
public void AddMessages(Messages messages)
Add a collection of messages to the message set.
messages (Messages)

AddMessages

#
public void AddMessages(params Message[] messages)
Add a collection of messages to the message set.
messages (params Message[])

Empty

#
public static SolutionData Empty(SolutionId id)
Create an empty result, to be populated at a later time.
id (SolutionId)

FromData

#
public static SolutionData FromData(SolutionId id, TimeSpan duration, ITree tree)
Create results with a data tree.
id (SolutionId)
duration (TimeSpan)
tree (ITree)

FromException

#
public static SolutionData FromException(SolutionId id, Exception exception)
Create empty results with exception messaging.
id (SolutionId)
exception (Exception)

RemoveMessages

#
public void RemoveMessages(MessageLevel level, string filter)
Remove all messages which match the given level and filter.
level (MessageLevel)Message level.
filter (string)Message text (or part of message text).

SetTree

#
public void SetTree(Guid key, ITree tree)
Sets or overwrites a keyed tree. This is typically only used so that components can store the data trees meant for their output parameters.
key (Guid)
tree (ITree)

SetTree

#
public void SetTree(ITree tree)
Sets or overwrites the unkeyed tree.
tree (ITree)

Tree

#
public ITree Tree()
Gets the unkeyed tree, if any.

Tree

#
public ITree Tree(Guid key)
Gets a keyed tree, if it exists.
key (Guid)