Table of Contents

Struct NodeWidth

Namespace
HeyBox
Assembly
HeyBox.Net.Core.dll

表示一个 CSS 宽度的结构体。

public readonly struct NodeWidth : IEquatable<NodeWidth>
Implements
Inherited Members

Properties

Default

获取一个表示默认宽度的 NodeWidth 实例。

public static NodeWidth Default { get; }

Property Value

NodeWidth

Value

获取宽度的字符串值。

public string Value { get; }

Property Value

string

Methods

Equals(NodeWidth)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(NodeWidth other)

Parameters

other NodeWidth

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

FromPercentage(double)

通过百分比值创建 NodeWidth 实例。

public static NodeWidth FromPercentage(double percentage)

Parameters

percentage double

百分比值,必须为非负数。

Returns

NodeWidth

对应的 NodeWidth 实例。

Exceptions

ArgumentOutOfRangeException

percentage 小于 0 时抛出。

FromPixels(int)

通过像素值创建 NodeWidth 实例。

public static NodeWidth FromPixels(int pixels)

Parameters

pixels int

像素值,必须为非负整数。

Returns

NodeWidth

对应的 NodeWidth 实例。

Exceptions

ArgumentOutOfRangeException

pixels 小于 0 时抛出。

FromValue(string)

通过宽度值创建 NodeWidth 实例。

public static NodeWidth FromValue(string value)

Parameters

value string

宽度值字符串。

Returns

NodeWidth

对应的 NodeWidth 实例。

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

获取宽度的字符串值。

public override string ToString()

Returns

string

Operators

operator ==(NodeWidth, NodeWidth)

确定两个 NodeWidth 实例是否相等。

public static bool operator ==(NodeWidth left, NodeWidth right)

Parameters

left NodeWidth

左侧的 NodeWidth 实例。

right NodeWidth

右侧的 NodeWidth 实例。

Returns

bool

如果相等,则为 true;否则为 false。

operator !=(NodeWidth, NodeWidth)

确定两个 NodeWidth 实例是否不相等。

public static bool operator !=(NodeWidth left, NodeWidth right)

Parameters

left NodeWidth

左侧的 NodeWidth 实例。

right NodeWidth

右侧的 NodeWidth 实例。

Returns

bool

如果不相等,则为 true;否则为 false。