Back to top OpenSVG (c) Veridict AB, www.veridict.com
Edit this page

Struct AbsoluteOrRatio

Represents a value that can be either an absolute value or a ratio.

Implements
IEquatable<AbsoluteOrRatio>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: OpenSvg
Assembly: OpenSvg.dll
Syntax
public readonly struct AbsoluteOrRatio : IEquatable<AbsoluteOrRatio>

Constructors

| Edit this page View Source

AbsoluteOrRatio(float, bool)

Initializes a new instance of the AbsoluteOrRatio struct.

Declaration
public AbsoluteOrRatio(float value, bool isAbsolute)
Parameters
Type Name Description
float value

The value of the AbsoluteOrRatio.

bool isAbsolute

Indicates whether the value is absolute or a ratio.

Fields

| Edit this page View Source

IsAbsolute

Indicates whether the value is absolute or a ratio.

Declaration
public readonly bool IsAbsolute
Field Value
Type Description
bool
| Edit this page View Source

Value

The value of the AbsoluteOrRatio.

Declaration
public readonly float Value
Field Value
Type Description
float

Methods

| Edit this page View Source

Absolute(float)

Creates a new AbsoluteOrRatio with an absolute value.

Declaration
public static AbsoluteOrRatio Absolute(float value)
Parameters
Type Name Description
float value

The absolute value.

Returns
Type Description
AbsoluteOrRatio

A new AbsoluteOrRatio with an absolute value.

| Edit this page View Source

Equals(AbsoluteOrRatio)

Determines whether the specified AbsoluteOrRatio is equal to the current AbsoluteOrRatio.

Declaration
public bool Equals(AbsoluteOrRatio other)
Parameters
Type Name Description
AbsoluteOrRatio other

The AbsoluteOrRatio to compare with the current AbsoluteOrRatio.

Returns
Type Description
bool

true if the specified AbsoluteOrRatio is equal to the current AbsoluteOrRatio; otherwise, false.

| Edit this page View Source

Equals(object?)

Determines whether the specified object is equal to the current AbsoluteOrRatio.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current AbsoluteOrRatio.

Returns
Type Description
bool

true if the specified object is equal to the current AbsoluteOrRatio; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

FromXmlString(string)

Declaration
public static AbsoluteOrRatio FromXmlString(string xmlString)
Parameters
Type Name Description
string xmlString
Returns
Type Description
AbsoluteOrRatio
| Edit this page View Source

GetHashCode()

Returns a hash code for the current AbsoluteOrRatio.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current AbsoluteOrRatio.

Overrides
ValueType.GetHashCode()
| Edit this page View Source

Ratio(float)

Creates a new AbsoluteOrRatio with a ratio value.

Declaration
public static AbsoluteOrRatio Ratio(float value)
Parameters
Type Name Description
float value

The ratio value.

Returns
Type Description
AbsoluteOrRatio

A new AbsoluteOrRatio with a ratio value.

| Edit this page View Source

Resolve(Func<float>)

Resolves the value of the AbsoluteOrRatio.

Declaration
public float Resolve(Func<float> GetReferenceValue)
Parameters
Type Name Description
Func<float> GetReferenceValue

A function that returns the reference value for resolving the abolute value.

Returns
Type Description
float

The resolved value of the AbsoluteOrRatio.

| Edit this page View Source

ToString()

Returns the fully qualified type name of this instance.

Declaration
public override string ToString()
Returns
Type Description
string

The fully qualified type name.

Overrides
ValueType.ToString()
| Edit this page View Source

ToXmlString()

Returns an XML string representation for the object.

Declaration
public string ToXmlString()
Returns
Type Description
string

A string representing the object in XML format.

Operators

| Edit this page View Source

operator ==(AbsoluteOrRatio, AbsoluteOrRatio)

Determines whether two AbsoluteOrRatio objects are equal.

Declaration
public static bool operator ==(AbsoluteOrRatio left, AbsoluteOrRatio right)
Parameters
Type Name Description
AbsoluteOrRatio left

The first AbsoluteOrRatio to compare.

AbsoluteOrRatio right

The second AbsoluteOrRatio to compare.

Returns
Type Description
bool

true if the two AbsoluteOrRatio objects are equal; otherwise, false.

| Edit this page View Source

implicit operator AbsoluteOrRatio(float)

Implicitly converts a float to an AbsoluteOrRatio with an absolute value.

Declaration
public static implicit operator AbsoluteOrRatio(float value)
Parameters
Type Name Description
float value

The absolute value.

Returns
Type Description
AbsoluteOrRatio

An AbsoluteOrRatio with an absolute value.

| Edit this page View Source

operator !=(AbsoluteOrRatio, AbsoluteOrRatio)

Determines whether two AbsoluteOrRatio objects are not equal.

Declaration
public static bool operator !=(AbsoluteOrRatio left, AbsoluteOrRatio right)
Parameters
Type Name Description
AbsoluteOrRatio left

The first AbsoluteOrRatio to compare.

AbsoluteOrRatio right

The second AbsoluteOrRatio to compare.

Returns
Type Description
bool

true if the two AbsoluteOrRatio objects are not equal; otherwise, false.

Implements

IEquatable<T>