# Size3D 結構

## 定義

``public value class Size3D : IFormattable``
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Size3DConverter))]
public struct Size3D : IFormattable``````
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Size3DConverter))]
[System.Serializable]
public struct Size3D : IFormattable``````
``````[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Size3DConverter))>]
type Size3D = struct
interface IFormattable``````
``````[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Size3DConverter))>]
[<System.Serializable>]
type Size3D = struct
interface IFormattable``````
``````Public Structure Size3D
Implements IFormattable``````

Size3D

## 範例

``````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 結構的新執行個體。Initializes a new instance of the Size3D structure.

## 屬性

 取得值，這個值表示空白 Size3D 結構。Gets a value that represents an empty Size3D structure. 取得值，這個值表示這個 Size3D 結構是否空白。Gets a value that indicates whether this Size3D structure is empty. 取得或設定這個 X 結構的 Size3D 值。Gets or sets the X value of this Size3D structure. 取得或設定這個 Y 結構的 Size3D 值。Gets or sets the Y value of this Size3D structure. 取得或設定這個 Z 結構的 Size3D 值。Gets or sets the Z value of this Size3D structure.

## 方法

 判斷指定的物件是否為 Size3D 結構，以及指定之 Object 的 X、Y 和 Z 屬性是否等於這個 Size3D 結構的 X、Y 和 Z 屬性。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. 比較兩個 Size3D 結構是否相等。Compares two Size3D structures for equality. 比較兩個 Size3D 結構是否相等。Compares two Size3D structures for equality. 兩個 Size3D 結構的 X、Y 和 Z 屬性若相同，就表示兩個結構相等。Two Size3D structures are equal if the values of their X, Y, and Z properties are the same. 傳回這個 Size3D 結構的雜湊程式碼。Returns a hash code for this Size3D structure. 將三維大小結構的 String 表示轉換為對等的 Size3D 結構。Converts a String representation of a three-dimensional size structure into the equivalent Size3D structure. 建立這個 String 結構的 Size3D 表示。Creates a String representation of this Size3D structure. 建立這個 String 結構的 Size3D 表示。Creates a String representation of this Size3D structure.

## 運算子

 比較兩個 Size3D 結構是否相等。Compares two Size3D structures for equality. 兩個 Size3D 結構的 X、Y 和 Z 屬性若相同，就表示兩個結構相等。Two Size3D structures are equal if the values of their X, Y, and Z properties are the same. 將這個 Size3D 結構轉換為 Point3D 結構。Converts this Size3D structure into a Point3D structure. 將這個 Size3D 結構轉換為 Vector3D 結構。Converts this Size3D structure into a Vector3D structure. 比較兩個 Size3D 結構是否相等。Compares two Size3D structures for inequality. 如果兩個 Size3D 結構的 X、Y 和 Z 屬性值不同，則這兩個結構不相等。Two Size3D structures are not equal if the values of their X, Y and Z properties are different.

## 明確介面實作

 此成員支援 Windows Presentation Foundation (WPF) 基礎結構，而且不適合直接從程式碼使用。This member supports the 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).