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
Value
获取宽度的字符串值。
public string Value { get; }
Property Value
Methods
Equals(NodeWidth)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(NodeWidth other)
Parameters
other
NodeWidthAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe 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
Exceptions
- ArgumentOutOfRangeException
当
percentage
小于 0 时抛出。
FromPixels(int)
通过像素值创建 NodeWidth 实例。
public static NodeWidth FromPixels(int pixels)
Parameters
pixels
int像素值,必须为非负整数。
Returns
Exceptions
- ArgumentOutOfRangeException
当
pixels
小于 0 时抛出。
FromValue(string)
通过宽度值创建 NodeWidth 实例。
public static NodeWidth FromValue(string value)
Parameters
value
string宽度值字符串。
Returns
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
Operators
operator ==(NodeWidth, NodeWidth)
确定两个 NodeWidth 实例是否相等。
public static bool operator ==(NodeWidth left, NodeWidth right)
Parameters
Returns
- bool
如果相等,则为 true;否则为 false。
operator !=(NodeWidth, NodeWidth)
确定两个 NodeWidth 实例是否不相等。
public static bool operator !=(NodeWidth left, NodeWidth right)
Parameters
Returns
- bool
如果不相等,则为 true;否则为 false。