Size3D Size3D Size3D Size3D Struct

定義

用來描述三維物件大小的資料結構。Data structure that describes the size of a three-dimensional object.

public value class Size3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Size3DConverter))]
[System.Serializable]
public struct Size3D : IFormattable
type Size3D = struct
    interface IFormattable
Public Structure Size3D
Implements IFormattable
繼承
屬性
實作

範例

這個範例示範如何Size3D Size3D使用靜態Equals方法判斷兩個結構是否相等。This example shows how to determine if two Size3D structures are equal using the Size3D static Equals method.

下列程式碼說明如何檢查Size3D結構是否相等。The following code illustrates how to check Size3D structures for equality. 結構Size3D是宣告和指派的值。The Size3D structures are declared and assigned values. 然後Equals , 會使用方法來判斷兩個結構是否相等。The Equals method is then used to determine if the two structures are equal.

private bool size3DEqualityExample()
{

    // Checks if two Size3D structures are equal using the static Equals method. 
    // Returns a Boolean.

    // Declaring Size3D structure without initializing x,y,z values
    Size3D size1 = new Size3D();

    // Delcaring Size3D structure and initializing x,y,z values
    Size3D size2 = new Size3D(5, 10, 15);
    Boolean areEqual;

    // Assigning values to size1
    size1.X = 2;
    size1.Y = 4;
    size1.Z = 6;

    // checking for equality
    areEqual = Size3D.Equals(size1, size2);

    // areEqual is False
    return areEqual;

}

備註

Size3DRect3D通常不會用於 XAML 中, 因為在使用這些類型的 WPF 3d 物件模型中, 沒有可設定的屬性存在。Size3D and Rect3D are not typically used in XAML, because no settable properties exist in the WPF 3D object model that use those types.

建構函式

Size3D(Double, Double, Double) Size3D(Double, Double, Double) Size3D(Double, Double, Double) Size3D(Double, Double, Double)

初始化 Size3D 結構的新執行個體。Initializes a new instance of the Size3D structure.

屬性

Empty Empty Empty Empty

取得值,這個值表示空白 Size3D 結構。Gets a value that represents an empty Size3D structure.

IsEmpty IsEmpty IsEmpty IsEmpty

取得值,這個值表示這個 Size3D 結構是否空白。Gets a value that indicates whether this Size3D structure is empty.

X X X X

取得或設定這個 X 結構的 Size3D 值。Gets or sets the X value of this Size3D structure.

Y Y Y Y

取得或設定這個 Y 結構的 Size3D 值。Gets or sets the Y value of this Size3D structure.

Z Z Z Z

取得或設定這個 Z 結構的 Size3D 值。Gets or sets the Z value of this Size3D structure.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否為 Size3D 結構,以及指定之 ObjectXYZ 屬性是否等於這個 Size3D 結構的 XYZ 屬性。Determines whether the specified object is a Size3D structure and whether the X, Y and Z properties of the specified Object are equal to the X, Y and Z properties of this Size3D structure.

Equals(Size3D) Equals(Size3D) Equals(Size3D) Equals(Size3D)

比較兩個 Size3D 結構是否相等。Compares two Size3D structures for equality.

Equals(Size3D, Size3D) Equals(Size3D, Size3D) Equals(Size3D, Size3D) Equals(Size3D, Size3D)

比較兩個 Size3D 結構是否相等。Compares two Size3D structures for equality. 兩個 Size3D 結構的 XYZ 屬性若相同,就表示兩個結構相等。Two Size3D structures are equal if the values of their X, Y, and Z properties are the same.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個 Size3D 結構的雜湊程式碼。Returns a hash code for this Size3D structure.

Parse(String) Parse(String) Parse(String) Parse(String)

將三維大小結構的 String 表示轉換為對等的 Size3D 結構。Converts a String representation of a three-dimensional size structure into the equivalent Size3D structure.

ToString() ToString() ToString() ToString()

建立這個 String 結構的 Size3D 表示。Creates a String representation of this Size3D structure.

ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider)

建立這個 String 結構的 Size3D 表示。Creates a String representation of this Size3D structure.

運算子

Equality(Size3D, Size3D) Equality(Size3D, Size3D) Equality(Size3D, Size3D) Equality(Size3D, Size3D)

比較兩個 Size3D 結構是否相等。Compares two Size3D structures for equality. 兩個 Size3D 結構的 XYZ 屬性若相同,就表示兩個結構相等。Two Size3D structures are equal if the values of their X, Y, and Z properties are the same.

Explicit(Size3D to Vector3D) Explicit(Size3D to Vector3D) Explicit(Size3D to Vector3D) Explicit(Size3D to Vector3D)

將這個 Size3D 結構轉換為 Vector3D 結構。Converts this Size3D structure into a Vector3D structure.

Explicit(Size3D to Point3D) Explicit(Size3D to Point3D) Explicit(Size3D to Point3D) Explicit(Size3D to Point3D)

將這個 Size3D 結構轉換為 Point3D 結構。Converts this Size3D structure into a Point3D structure.

Inequality(Size3D, Size3D) Inequality(Size3D, Size3D) Inequality(Size3D, Size3D) Inequality(Size3D, Size3D)

比較兩個 Size3D 結構是否相等。Compares two Size3D structures for inequality. 如果兩個 Size3D 結構的 XYZ 屬性值不同,則這兩個結構不相等。Two Size3D structures are not equal if the values of their X, Y and Z properties are different.

明確介面實作

IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider)

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. 如需這個成員的說明,請參閱 ToString(String, IFormatProvider)For a description of this member, see ToString(String, IFormatProvider).

適用於