public static extern void Detach(global::System.Runtime.InteropServices.HandleRef visualObject);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualObject_Raise")]
- public static extern uint Raise(global::System.Runtime.InteropServices.HandleRef visualObject);
+ public static extern void Raise(global::System.Runtime.InteropServices.HandleRef visualObject);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualObject_Lower")]
- public static extern uint Lower(global::System.Runtime.InteropServices.HandleRef visualObject);
+ public static extern void Lower(global::System.Runtime.InteropServices.HandleRef visualObject);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualObject_RaiseToTop")]
- public static extern uint RaiseToTop(global::System.Runtime.InteropServices.HandleRef visualObject);
+ public static extern void RaiseToTop(global::System.Runtime.InteropServices.HandleRef visualObject);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualObject_LowerToBottom")]
- public static extern uint LowerToBottom(global::System.Runtime.InteropServices.HandleRef visualObject);
+ public static extern void LowerToBottom(global::System.Runtime.InteropServices.HandleRef visualObject);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualObject_RaiseAbove")]
- public static extern uint RaiseAbove(global::System.Runtime.InteropServices.HandleRef visualObject, global::System.Runtime.InteropServices.HandleRef target);
+ public static extern void RaiseAbove(global::System.Runtime.InteropServices.HandleRef visualObject, global::System.Runtime.InteropServices.HandleRef target);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualObject_LowerBelow")]
- public static extern uint LowerBelow(global::System.Runtime.InteropServices.HandleRef visualObject, global::System.Runtime.InteropServices.HandleRef target);
+ public static extern void LowerBelow(global::System.Runtime.InteropServices.HandleRef visualObject, global::System.Runtime.InteropServices.HandleRef target);
}
}
}
using System;
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.InteropServices;
using Tizen.NUI.Binding;
/// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void RaiseToTop()
{
var parentChildren = GetParent()?.Children;
/// Raise view above the next sibling view.
/// </summary>
/// <since_tizen> 9 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void Raise()
{
var parentChildren = GetParent()?.Children;
/// </remarks>
/// <param name="target">Will be raised above this view.</param>
/// <since_tizen> 9 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void RaiseAbove(View target)
{
var parentChildren = GetParent()?.Children;
using System;
using Tizen.NUI.BaseComponents;
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Tizen.NUI
/// Increments the depth of the layer.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void Raise()
{
var parentChildren = window?.LayersChildren;
/// Raises the layer to the top.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void RaiseToTop()
{
var parentChildren = window?.LayersChildren;
/// <since_tizen> 3 </since_tizen>
public PropertyValue GetValue(uint position)
{
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyValue ret = new PropertyValue(Interop.PropertyMap.GetValue(SwigCPtr, position), false);
+#pragma warning restore CA2000 // Dispose objects before losing scope
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public PropertyKey GetKeyAt(uint position)
{
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyKey ret = new PropertyKey(Interop.PropertyMap.GetKeyAt(SwigCPtr, position), true);
+#pragma warning restore CA2000 // Dispose objects before losing scope
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public PropertyValue Find(string stringKey)
{
global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, stringKey);
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false);
+#pragma warning restore CA2000 // Dispose objects before losing scope
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public PropertyValue Find(int key)
{
global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key);
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false);
+#pragma warning restore CA2000 // Dispose objects before losing scope
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public PropertyValue Find(int indexKey, string stringKey)
{
global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, indexKey, stringKey);
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false);
+#pragma warning restore CA2000 // Dispose objects before losing scope
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <returns>The value for the element with the specified key.</returns>
internal PropertyValue ValueOfIndex(string key)
{
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyValue ret = new PropertyValue(Interop.PropertyMap.ValueOfIndex(SwigCPtr, key), false);
+#pragma warning restore CA2000 // Dispose objects before losing scope
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <returns>The value for the element with the specified key.</returns>
internal PropertyValue ValueOfIndex(int key)
{
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyValue ret = new PropertyValue(Interop.PropertyMap.ValueOfIndex(SwigCPtr, key), false);
+#pragma warning restore CA2000 // Dispose objects before losing scope
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
namespace Tizen.NUI.Visuals
{
private bool visualFittingModeApplied = false; // Whether we use fitting mode, or DontCare.
- internal struct VisualTransformInfo
+ internal class VisualTransformInfo : System.IDisposable
{
public float width;
public float height;
public PropertyMap cachedVisualTransformPropertyMap;
internal bool changed;
+
+ public VisualTransformInfo()
+ {
+ Clear();
+ }
+
+ ~VisualTransformInfo() => Dispose(false);
public void Clear()
{
changed = true;
}
+ public void Dispose()
+ {
+ Dispose(true);
+ global::System.GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ cachedVisualTransformPropertyMap?.Dispose();
+ }
+ }
+
internal PropertyMap ConvertToPropertyMap()
{
if (cachedVisualTransformPropertyMap == null)
cachedVisualTransformPropertyMap.Clear();
// TODO : Let we optimize here after native map add API binded
- cachedVisualTransformPropertyMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(width, height))
- .Add((int)VisualTransformPropertyType.Offset, new PropertyValue(offsetX, offsetY))
- .Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue((float)widthPolicy, (float)heightPolicy))
- .Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue((float)offsetXPolicy, (float)offsetYPolicy))
- .Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)origin))
- .Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)pivotPoint))
- .Add((int)VisualTransformPropertyType.ExtraSize, new PropertyValue(extraWidth, extraHeight));
+ cachedVisualTransformPropertyMap.Append((int)VisualTransformPropertyType.Size, new UIVector2(width, height))
+ .Append((int)VisualTransformPropertyType.Offset, new UIVector2(offsetX, offsetY))
+ .Append((int)VisualTransformPropertyType.SizePolicy, new UIVector2((float)widthPolicy, (float)heightPolicy))
+ .Append((int)VisualTransformPropertyType.OffsetPolicy, new UIVector2((float)offsetXPolicy, (float)offsetYPolicy))
+ .Add((int)VisualTransformPropertyType.Origin, (int)origin)
+ .Add((int)VisualTransformPropertyType.AnchorPoint, (int)pivotPoint)
+ .Append((int)VisualTransformPropertyType.ExtraSize, new UIVector2(extraWidth, extraHeight));
return cachedVisualTransformPropertyMap;
}
internal void ConvertFromPropertyMap(PropertyMap inputMap)
{
+#pragma warning disable CA2000 // Dispose objects before losing scope
PropertyValue value = null;
if ((value = inputMap?.Find((int)VisualTransformPropertyType.Size)) != null)
}
}
value?.Dispose();
+#pragma warning restore CA2000 // Dispose objects before losing scope
}
};
internal VisualTransformInfo transformInfo;
internal VisualBase(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
- transformInfo.Clear();
+ transformInfo = new VisualTransformInfo();
}
#endregion
UpdateVisualProperty((int)Tizen.NUI.Visual.Property.MixColor, value, false);
// warning : We should set cached Opacity after set MixColor.
- UpdateVisualProperty((int)Tizen.NUI.Visual.Property.Opacity, value.A, false);
+ if (value != null)
+ {
+ UpdateVisualProperty((int)Tizen.NUI.Visual.Property.Opacity, value.A, false);
+ }
}
get
{
+#pragma warning disable CA2000 // Dispose objects before losing scope
Tizen.NUI.Color ret = new Tizen.NUI.Color(1.0f, 1.0f, 1.0f, 1.0f);
+#pragma warning restore CA2000 // Dispose objects before losing scope
using var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.Visual.Property.MixColor);
propertyValue?.Get(ret);
return ret;
/// Raise above the next sibling visual object
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void Raise()
{
Interop.VisualObject.Raise(SwigCPtr);
/// Raise above all other sibling visual objects
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void RaiseToTop()
{
Interop.VisualObject.RaiseToTop(SwigCPtr);
/// Raise above target visual objects. No effects if visual object is already above target.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void RaiseAbove(Visuals.VisualBase target)
{
Interop.VisualObject.RaiseAbove(SwigCPtr, Visuals.VisualBase.getCPtr(target));
}
else
{
+#pragma warning disable CA2000 // Dispose objects before losing scope
ret = new Visuals.VisualObjectsContainer(cPtr, true);
+#pragma warning restore CA2000 // Dispose objects before losing scope
}
}
NDalicPINVOKE.ThrowExceptionIfExists();
// Since if visual is already under some VisualObjectsContainer,
// it will never be GC.
Detach();
+
+ changedPropertyMap?.Dispose();
+ changedPropertyMap = null;
+ cachedVisualPropertyMap?.Dispose();
+ cachedVisualPropertyMap = null;
+ transformInfo?.Dispose();
+ transformInfo = null;
}
visualCreationRequiredFlag = false;
- changedPropertyMap?.Dispose();
- changedPropertyMap = null;
- cachedVisualPropertyMap?.Dispose();
- cachedVisualPropertyMap = null;
-
base.Dispose(type);
}
#endregion
using System;
using System.ComponentModel;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Tizen.NUI
/// Raises the window to the top of the window stack.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void Raise()
{
Interop.GLWindow.GlWindowRaise(SwigCPtr);
using System;
using System.ComponentModel;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
using Tizen.Common;
/// Raises the window to the top of the window stack.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate", Justification = "Method used to raise the object, not event")]
public void Raise()
{
Interop.Window.Raise(SwigCPtr);