Solution
ReferencesMaintains a set of methods and properties which are used by IDocumentObjects while computing new solution data.
Constructors
Solution
#public Solution(Document document, SolutionId id, CancellationTokenSource source, SolutionMode mode = SolutionMode.Regular)
Create a new solution with an existing cancellation source.
Parameters:
| document (Document) | Document that owns this intance. |
| id (SolutionId) | Solution id. |
| source (CancellationTokenSource) | Source used for the cancellation mechanism. |
| mode (SolutionMode = SolutionMode.Regular) | Solution mode. |
Solution
#Create a new solution with its own cancellation source.
Parameters:
| document (Document) | Document that owns this intance. |
| id (SolutionId) | Solution id. |
| mode (SolutionMode = SolutionMode.Regular) | Solution mode. |
Properties
ComputableCount
#Gets the total number of expired, cancelled or faulted objects that will be solved as part of this solution.
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.
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...
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.
Methods
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.
Parameters:
| parameter (IParameter) | 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.
Parameters:
| parameter (IParameter) |