Export (0) Print
Expand All

Size3D.Equals Method (Object)

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.

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public override bool Equals(
	Object o


Type: System.Object

The Object to compare.

Return Value

Type: System.Boolean
true if instances are equal; otherwise, false.
true if o is a Size3D structure and is identical with this Size3D structure; otherwise, false.

Because Double values can lose precision when arithmetic operations are performed on them, a comparison between two Size3D instances that are logically equal might fail.

The following example shows how to check if an Object and a Size3D structure are equal.

// Checks if an Object and a Size3D structure are equal using the non-static Equals method.  
// Returns a Boolean. 

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

// Declaring 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;

areEqual = size1.Equals(size2);
// areEqual is False 

// Displaying Results
syntaxString = "areEqual = Size3D.Equals(size1, size2);";
resultType = "Boolean";
operationString = "Checking if an object and a Size3D structure are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft