Solution

References
public sealed class Solution
Maintains a set of methods and properties which are used by IDocumentObjects while computing new solution data.

Constructors

Solution

#
Create a new solution with an existing cancellation source.
public Solution(
document,
Document that owns this intance.
id,
Solution id.
source,
Source used for the cancellation mechanism.
mode = SolutionMode.Regular
Solution mode.
)

Solution

#
Create a new solution with its own cancellation source.
public Solution(
document,
Document that owns this intance.
id,
Solution id.
mode = SolutionMode.Regular
Solution mode.
)

Properties

Age

#
Gets the age of this solution. Note that a solution never stops aging, even after it completes.
public TimeSpan Age { get; }

ComputableCount

#
Gets the total number of expired, cancelled or faulted objects that will be solved as part of this solution.
public int ComputableCount { get; }

Document

#
Gets the document associated with this solution. Note that this may be a different document from the one which hosts whatever object is given this Solution instance.
public Document Document { get; }

Id

#
Gets the solution identifier.
public SolutionId Id { get; }

InvalidParameters

#
Gets the number of invalid parameters recorded in this solution.
public int InvalidParameters { get; }

Mode

#
Gets the mode this solution is running in.
public SolutionMode Mode { get; }

OverallProgress

#
Gets the overall progress of the solution. This property does a fair amount of heavy lifting, so try not to call it too often, there's a good boy...
public int OverallProgress { get; }

Phase

#
Gets the state this solution is currently in.
public SolutionPhase Phase { get; }

Time

#
Gets the time (in UTC coordinates) when this solution began.
public DateTime Time { get; }

Token

#
Gets the cancellation token associated with this solution. The IsCancelRequested property and Cancel method are the fastest way to determine/trigger cancellation state, but you can use the Token to pass to Tasks that require one.
public CancellationToken Token { get; }

Methods

Cancel

#
Move the solution into the Cancelled state.
public void Cancel()

Cancelled

#
public void Cancelled()
obsoleteUse Cancel() instead.

HashParameter

#
Hash the volatile data inside a parameter and store that hash locally in this solution. Any subsequent calls to this method with the same parameter will record whether the hash has changed. This method only works when the Mode equals either SolutionMode.Validating or SolutionMode.ValidatingSafe.
public void HashParameter(
parameter
Parameter to hash.
)

IsParameterHashValid

#
Test whether the given parameter is considered valid. This method only makes sense once the solution has completed, and when the Mode equals either SolutionMode.Validating or SolutionMode.ValidatingSafe.
public bool IsParameterHashValid(
parameter
)

ToString

#
Get a string representation of this solution.
public override string ToString()
Object.ToString

Events

StateChanged

#
Raised whenever the Phase of this solution changes.