Class Size2D

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll
API Level:
3

A two-dimensional size.

C#
Copy
public class Size2D : Disposable, ICloneable
Inheritance
Implements
ICloneable

Constructors

View Source

Size2D()

The constructor.

Declaration
C#
Copy
public Size2D()
Remarks

Size2D and Size are implicitly converted to each other, so these are compatible and can be replaced without any type casting.
For example, the followings are possible.
view.Size2D = new Size(10.0f, 10.0f, 10.0f); // be aware that here the depth value(10.0f) will be lost.
view.Size = new Size2D(10, 10); // be aware that here the depth value is 0.0f by default.
view.MinimumSize = new Size(10, 10, 0);
Size Tmp = view.MaximumSize; //here Tmp.Depth will be 0.0f.

API Level: 3
View Source

Size2D(Int32, Int32)

The constructor.

Declaration
C#
Copy
public Size2D(int width, int height)
Parameters
Type Name Description
Int32 width

The width component.

Int32 height

The height component.

Remarks

Size2D and Size are implicitly converted to each other, so these are compatible and can be replaced without any type casting.
For example, the followings are possible.
view.Size2D = new Size(10.0f, 10.0f, 10.0f); // be aware that here the depth value(10.0f) will be lost.
view.Size = new Size2D(10, 10); // be aware that here the depth value is 0.0f by default.
view.MinimumSize = new Size(10, 10, 0);
Size Tmp = view.MaximumSize; //here Tmp.Depth will be 0.0f.

API Level: 3

Properties

View Source

Height

The property for the height component of a size.

Declaration
C#
Copy
public int Height { get; set; }
Property Value
Type Description
Int32
Remarks

The setter is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor.

API Level: 3
View Source

Item[UInt32]

The array subscript operator.

Declaration
C#
Copy
public float this[uint index] { get; }
Parameters
Type Name Description
UInt32 index

The subscript index.

Property Value
Type Description
Single

The float at the given index.

API Level: 3
View Source

Width

The property for the width component of a size.

Declaration
C#
Copy
public int Width { get; set; }
Property Value
Type Description
Int32
Remarks

The setter is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor.

API Level: 3

Methods

View Source

Clone()

Declaration
C#
Copy
public object Clone()
Returns
Type Description
Object
View Source

Dispose(Boolean)

Hidden API (Inhouse API). Dispose.

Declaration
C#
Copy
protected override void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

true in order to free managed objects

Overrides
Remarks

Following the guide of https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose. This will replace "protected virtual void Dispose(DisposeTypes type)" which is exactly same in functionality.

View Source

Equals(Object)

Determines whether the specified object is equal to the current object.

Declaration
C#
Copy
public override bool Equals(Object obj)
Parameters
Type Name Description
Tizen.System.Object obj

The object to compare with the current object.

Returns
Type Description
Boolean

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

View Source

EqualTo(Size2D)

Checks equality.
Utilizes appropriate machine epsilon values.

Declaration
C#
Copy
public bool EqualTo(Size2D rhs)
Parameters
Type Name Description
Size2D rhs

The size to test against.

Returns
Type Description
Boolean

True if the sizes are equal.

API Level: 3
View Source

GetHashCode()

Gets the hash code of this Size2D.

Declaration
C#
Copy
public override int GetHashCode()
Returns
Type Description
Int32

The Hash Code.

API Level: 6
View Source

NotEqualTo(Size2D)

Checks inequality.
Utilizes appropriate machine epsilon values.

Declaration
C#
Copy
public bool NotEqualTo(Size2D rhs)
Parameters
Type Name Description
Size2D rhs

The size to test against.

Returns
Type Description
Boolean

True if the sizes are not equal.

API Level: 3
View Source

ReleaseSwigCPtr(Runtime.InteropServices.HandleRef)

Declaration
C#
Copy
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type Name Description
Tizen.System.Runtime.InteropServices.HandleRef swigCPtr
Overrides

Operators

View Source

Addition(Size2D, Size2D)

The addition operator for A+B.

Declaration
C#
Copy
public static Size2D operator +(Size2D arg1, Size2D arg2)
Parameters
Type Name Description
Size2D arg1

Size A.

Size2D arg2

Size to assign B.

Returns
Type Description
Size2D

A size containing the result of the addition.

API Level: 3
View Source

Division(Size2D, Int32)

The division operator.

Declaration
C#
Copy
public static Size2D operator /(Size2D arg1, int arg2)
Parameters
Type Name Description
Size2D arg1

Size for division.

Int32 arg2

The integer value to scale the size by.

Returns
Type Description
Size2D

A size containing the result of the scaling.

API Level: 3
View Source

Division(Size2D, Size2D)

The division operator.

Declaration
C#
Copy
public static Size2D operator /(Size2D arg1, Size2D arg2)
Parameters
Type Name Description
Size2D arg1

Size for division.

Size2D arg2

Size to divide.

Returns
Type Description
Size2D

A size containing the result of the division.

API Level: 3
View Source

Implicit(Size to Size2D)

Implicit type cast operator, Size to Size2D

Declaration
C#
Copy
public static implicit operator Size2D(Size size)
Parameters
Type Name Description
Size size

The object of Size type.

Returns
Type Description
Size2D
API Level: none
View Source

Implicit(Size2D to Vector2)

The type cast operator, Size2D to Vector2.

Declaration
C#
Copy
public static implicit operator Vector2(Size2D size)
Parameters
Type Name Description
Size2D size

An object of the Size2D type.

Returns
Type Description
Vector2

return a Vector2 instance

API Level: 3
View Source

Implicit(Vector2 to Size2D)

The type cast operator, Vector2 to Size2D type.

Declaration
C#
Copy
public static implicit operator Size2D(Vector2 vector2)
Parameters
Type Name Description
Vector2 vector2

An object of the Vector2 type.

Returns
Type Description
Size2D

return a Size2D instance

API Level: 3
View Source

Multiply(Size2D, Int32)

The multiplication operator.

Declaration
C#
Copy
public static Size2D operator *(Size2D arg1, int arg2)
Parameters
Type Name Description
Size2D arg1

Size for multiplication

Int32 arg2

The integer value to scale the size.

Returns
Type Description
Size2D

A size containing the result of the scaling.

API Level: 3
View Source

Multiply(Size2D, Size2D)

The multiplication operator.

Declaration
C#
Copy
public static Size2D operator *(Size2D arg1, Size2D arg2)
Parameters
Type Name Description
Size2D arg1

Size for multiplication.

Size2D arg2

Size to multiply.

Returns
Type Description
Size2D

A size containing the result of the multiplication.

API Level: 3
View Source

Subtraction(Size2D, Size2D)

The subtraction operator for A-B.

Declaration
C#
Copy
public static Size2D operator -(Size2D arg1, Size2D arg2)
Parameters
Type Name Description
Size2D arg1

Size A.

Size2D arg2

Size to subtract B.

Returns
Type Description
Size2D

A size containing the result of the subtraction.

API Level: 3
View Source

UnaryNegation(Size2D)

The unary negation operator.

Declaration
C#
Copy
public static Size2D operator -(Size2D arg1)
Parameters
Type Name Description
Size2D arg1

Size for unary negation.

Returns
Type Description
Size2D

A size containing the negation.

API Level: 3

Implements

ICloneable

Extension Methods