NanoXLSX.Core 3.0.0-rc.4
Loading...
Searching...
No Matches
NanoXLSX.Utils.Comparators Class Reference

Class providing general comparator methods. More...

Static Public Member Functions

static bool CompareSecureStrings (SecureString value1, SecureString value2)
 Compares whether the content of two SecureString instances are equal. The comparison method tries to handle the operation as secure as possible.
static int CompareDimensions (float? dimension1, float? dimension2)
 Compares two dimensions (e.g. column width, column height).
static bool IsZero (double value)
 Checks whether the passed double value is considered as zero using a defined threshold.
static bool IsZero (float value)
 Checks whether the passed float value is considered as zero using a defined threshold.

Detailed Description

Class providing general comparator methods.

Definition at line 10 of file Comparators.cs.

Member Function Documentation

◆ CompareDimensions()

int NanoXLSX.Utils.Comparators.CompareDimensions ( float? dimension1,
float? dimension2 )
static

Compares two dimensions (e.g. column width, column height).

Parameters
dimension1Nullable dimension 1
dimension2Nullable dimension 2
Returns
1, if dimension1 is greater than dimension2, -1 if dimension1 is smaller than dimension2, 0 if both values are equal
Remarks
If dimension1 is null, -1 will be returned, if dimension2 is null, 1 will be returned. For the equality, a threshold value will be used

Definition at line 86 of file Comparators.cs.

◆ CompareSecureStrings()

bool NanoXLSX.Utils.Comparators.CompareSecureStrings ( SecureString value1,
SecureString value2 )
static

Compares whether the content of two SecureString instances are equal. The comparison method tries to handle the operation as secure as possible.

Parameters
value1SecureString instance one
value2SecureString instance two
Returns
True, if the content of the two instance is equal, otherwise false

Definition at line 28 of file Comparators.cs.

◆ IsZero() [1/2]

bool NanoXLSX.Utils.Comparators.IsZero ( double value)
static

Checks whether the passed double value is considered as zero using a defined threshold.

Parameters
valueValue to check
Returns
True, if zero, otherwise false

Definition at line 115 of file Comparators.cs.

◆ IsZero() [2/2]

bool NanoXLSX.Utils.Comparators.IsZero ( float value)
static

Checks whether the passed float value is considered as zero using a defined threshold.

Parameters
valueValue to check
Returns
True, if zero, otherwise false

Definition at line 125 of file Comparators.cs.


The documentation for this class was generated from the following file: