*/
using System;
using System.ComponentModel;
+using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Tizen.NUI.BaseComponents.VectorGraphics
/// <since_tizen> 9 </since_tizen>
public class CanvasView : View
{
+ private List<Drawable> drawables; //The list of added drawables
+
static CanvasView() { }
/// <summary>
internal CanvasView(global::System.IntPtr cPtr, bool shown = true) : base(cPtr, shown)
{
+ drawables = new List<Drawable>();
if (!shown)
{
SetVisible(false);
{
return;
}
+
+ if (type == DisposeTypes.Explicit)
+ {
+ drawables.Clear();
+ }
+
base.Dispose(type);
}
/// This method is similar to registration. The added shape is drawn on the inner canvas.
/// </summary>
/// <param name="drawable">Drawable object</param>
+ /// <exception cref="ArgumentNullException"> Thrown when drawable is null. </exception>
/// <since_tizen> 9 </since_tizen>
public void AddDrawable(Drawable drawable)
{
+ if (drawable == null)
+ {
+ throw new ArgumentNullException(nameof(drawable));
+ }
Interop.CanvasView.AddDrawable(View.getCPtr(this), BaseHandle.getCPtr(drawable));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ if (!drawables.Contains(drawable))
+ {
+ drawables.Add(drawable);
+ }
}
}
}