/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// The property for the width component of a size.
/// </summary>
/// <remarks>
- /// The setter is deprecated in API8 and will be removed in API10. Please use new Size2D(...) constructor.
+ /// The setter is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor.
/// </remarks>
/// <code>
/// // DO NOT use like the followings!
/// Size2D size2d = new Size2D();
/// size2d.Width = 1;
- /// // Please USE like this
+ /// // USE like this
/// int width = 1, height = 2;
/// Size2D size2d = new Size2D(width, height);
/// </code>
/// <since_tizen> 3 </since_tizen>
public int Width
{
+ [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor")]
set
{
- Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size2D(...) constructor");
-
Interop.Vector2.WidthSet(SwigCPtr, (float)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// The property for the height component of a size.
/// </summary>
/// <remarks>
- /// The setter is deprecated in API8 and will be removed in API10. Please use new Size2D(...) constructor.
+ /// The setter is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor.
/// </remarks>
/// <code>
/// // DO NOT use like the followings!
/// Size2D size2d = new Size2D();
/// size2d.Height = 2;
- /// // Please USE like this
+ /// // USE like this
/// int width = 1, height = 2;
/// Size2D size2d = new Size2D(width, height);
/// </code>
/// <since_tizen> 3 </since_tizen>
public int Height
{
+ [Obsolete("Do not use this setter, that is deprecated in API8 and will be removed in API10. Use new Size2D(...) constructor")]
set
{
- Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size2D(...) constructor");
-
Interop.Vector2.HeightSet(SwigCPtr, (float)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public static implicit operator Vector2(Size2D size)
{
- return new Vector2((float)size?.Width, (float)size.Height);
+ if (size == null)
+ {
+ return null;
+ }
+ return new Vector2(size.Width, size.Height);
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public static implicit operator Size2D(Vector2 vector2)
{
- return new Size2D((int)vector2?.X, (int)vector2.Y);
+ if (vector2 == null)
+ {
+ return null;
+ }
+ return new Size2D((int)vector2.X, (int)vector2.Y);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static implicit operator Size2D(Size size)
{
- return new Size2D((int)size?.Width, (int)size.Height);
+ if (size == null)
+ {
+ return null;
+ }
+ return new Size2D((int)size.Width, (int)size.Height);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object Clone() => new Size2D(Width, Height);
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size2D obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
- }
-
/// <summary>
/// Gets the size from the pointer.
/// </summary>