Table of Contents

Class PrecisionOverride

Namespace
CADability
Assembly
CADability.dll

Use this class to temporary override the values for the precision. The best way to use this class is the C# using statement. The constructor of this class overrides the values of Precision for the current thread, other threads keep their values. The Dispose() method restores the previous values, it must be called on the same thread (so there must be no await inside the using statement), otherwise it throws an InvalidOperationException. A value that is not positive keeps the value that is valid when the override is made.

public class PrecisionOverride : IDisposable
Inheritance
PrecisionOverride
Implements
Inherited Members

Constructors

PrecisionOverride(double)

Sets Precision.eps for the current thread.

public PrecisionOverride(double eps)

Parameters

eps double

The new Precision.eps value; a value that is not positive keeps the current one

PrecisionOverride(double, double)

Sets Precision.eps and Precision.epsa for the current thread.

public PrecisionOverride(double eps, double epsa)

Parameters

eps double

The new Precision.eps value; a value that is not positive keeps the current one

epsa double

The new Precision.epsa value; a value that is not positive keeps the current one

Methods

Dispose()

Restores the previous (at time of construction of this object) Precision values.

public void Dispose()

Exceptions

InvalidOperationException

when called on another thread than the one that made the override: the values are thread static, so it would set the values of that thread and leave the override in place on the thread that made it