return ret;
}
- public static PropertyCondition LessThanCondition(float arg)
- {
- PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.LessThanCondition(arg), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- public static PropertyCondition GreaterThanCondition(float arg)
- {
- PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.GreaterThanCondition(arg), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- public static PropertyCondition InsideCondition(float arg0, float arg1)
- {
- PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.InsideCondition(arg0, arg1), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- public static PropertyCondition OutsideCondition(float arg0, float arg1)
- {
- PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.OutsideCondition(arg0, arg1), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- public static PropertyCondition StepCondition(float stepAmount, float initialValue)
- {
- PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_0(stepAmount, initialValue), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- public static PropertyCondition StepCondition(float stepAmount)
- {
- PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_1(stepAmount), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
public static int WEIGHT
{
get
--- /dev/null
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+ internal static class PropertyHelper
+ {
+ ///<summary>
+ /// Returns a Property if stringProperty is a valid index
+ ///</summary>
+ internal static Property GetPropertyFromString(Animatable handle, string stringProperty)
+ {
+ /// Convert property string to be lowercase
+ string str1 = stringProperty.Substring(0, 1);
+ string str2 = stringProperty.Substring(1);
+ string str = str1.ToLower() + str2;
+
+ Property property = new Property(handle, str);
+ if (property.propertyIndex == Property.INVALID_INDEX)
+ {
+ throw new System.ArgumentException("string property is invalid");
+ }
+
+ return property;
+ }
+ }
+}
return ret;
}
- internal PropertyNotification AddPropertyNotification(int index, PropertyCondition condition)
+ public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition)
{
- PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, index, PropertyCondition.getCPtr(condition)), true);
+ PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, PropertyHelper.GetPropertyFromString(this, property).propertyIndex, PropertyCondition.getCPtr(condition)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
return ret;
}
- internal void RemovePropertyNotification(PropertyNotification propertyNotification)
+ public void RemovePropertyNotification(PropertyNotification propertyNotification)
{
NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal void RemovePropertyNotifications()
+ public void RemovePropertyNotifications()
{
NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <param name="alphaFunction">The alpha function to apply.</param>
public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
{
- string _str1 = property.Substring(0, 1);
- string _str2 = property.Substring(1);
- string _str = _str1.ToLower() + _str2;
-
- Property _prop = new Property(target, _str);
- if (_prop.propertyIndex == Property.INVALID_INDEX)
- {
- throw new System.ArgumentException("second argument string property is invalid parameter!");
- }
+ Property _prop = PropertyHelper.GetPropertyFromString(target, property);
PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
if(propertyType.Equals(PropertyType.Float))
/// <param name="alphaFunction">The alpha function to apply.</param>
public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
{
- string _str1 = property.Substring(0, 1);
- string _str2 = property.Substring(1);
- string _str = _str1.ToLower() + _str2;
-
- Property _prop = new Property(target, _str);
- if (_prop.propertyIndex == Property.INVALID_INDEX)
- {
- throw new System.ArgumentException("second argument string property is invalid parameter!");
- }
+ Property _prop = PropertyHelper.GetPropertyFromString(target, property);
PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
if(propertyType.Equals(PropertyType.Float))
/// <param name="alphaFunction">The alpha function to apply.</param>
public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
{
- string _str1 = property.Substring(0, 1);
- string _str2 = property.Substring(1);
- string _str = _str1.ToLower() + _str2;
-
- Property _prop = new Property(target, _str);
- if (_prop.propertyIndex == Property.INVALID_INDEX)
- {
- throw new System.ArgumentException("second argument string property is invalid parameter!");
- }
+ Property _prop = PropertyHelper.GetPropertyFromString(target, property);
PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
if(propertyType.Equals(PropertyType.Float))
/// <param name="alphaFunction">The alpha function to apply.</param>
public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
{
- string _str1 = property.Substring(0, 1);
- string _str2 = property.Substring(1);
- string _str = _str1.ToLower() + _str2;
-
- Property _prop = new Property(target, _str);
- if (_prop.propertyIndex == Property.INVALID_INDEX)
- {
- throw new System.ArgumentException("second argument string property is invalid parameter!");
- }
+ Property _prop = PropertyHelper.GetPropertyFromString(target, property);
PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
if(propertyType.Equals(PropertyType.Float))
/// <param name="alphaFunction">The alpha function to apply.</param>
public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
{
- string _str1 = property.Substring(0, 1);
- string _str2 = property.Substring(1);
- string _str = _str1.ToLower() + _str2;
+ Property _prop = PropertyHelper.GetPropertyFromString(target, property);
- Property _prop = new Property(target, _str);
if (_prop.propertyIndex == Property.INVALID_INDEX)
{
throw new System.ArgumentException("second argument string property is invalid parameter!");
/// <param name="alphaFunction">The alpha function to apply.</param>
public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
{
- string _str1 = property.Substring(0, 1);
- string _str2 = property.Substring(1);
- string _str = _str1.ToLower() + _str2;
-
- Property _prop = new Property(target, _str);
- if (_prop.propertyIndex == Property.INVALID_INDEX)
- {
- throw new System.ArgumentException("second argument string property is invalid parameter!");
- }
+ Property _prop = PropertyHelper.GetPropertyFromString(target, property);
Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
if (alphaFunction != null)
namespace Tizen.NUI
{
-
- internal class PropertyCondition : BaseHandle
+ /// <summary>
+ /// A condition that can be evaluated on a Property Value
+ /// </summary>
+ public class PropertyCondition : BaseHandle
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- public PropertyCondition(PropertyCondition handle) : this(NDalicPINVOKE.new_PropertyCondition__SWIG_1(PropertyCondition.getCPtr(handle)), true)
+ /// <summary>
+ /// Retrieves the arguments that this condition uses.
+ /// </summary>
+ public uint GetArgumentCount()
{
+ uint ret = NDalicPINVOKE.PropertyCondition_GetArgumentCount(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ ///<summary>
+ /// Retrieves the arguments that this condition uses
+ ///</summary>
+ public float GetArgument(uint index)
+ {
+ float ret = NDalicPINVOKE.PropertyCondition_GetArgument(swigCPtr, index);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- public PropertyCondition Assign(PropertyCondition rhs)
+ ///<summary>
+ /// LessThan condition compares whether property is less than arg.
+ ///</summary>
+ public static PropertyCondition LessThan(float arg)
{
- PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.PropertyCondition_Assign(swigCPtr, PropertyCondition.getCPtr(rhs)), false);
+ PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.LessThanCondition(arg), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public uint GetArgumentCount()
+ ///<summary>
+ /// GreaterThan condition compares whether property is greater than arg.
+ ///</summary>
+ public static PropertyCondition GreaterThan(float arg)
{
- uint ret = NDalicPINVOKE.PropertyCondition_GetArgumentCount(swigCPtr);
+ PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.GreaterThanCondition(arg), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public float GetArgument(uint index)
+ ///<summary>
+ /// Inside condition compares whether property is greater than arg0 and less than arg1.
+ ///</summary>
+ public static PropertyCondition Inside(float arg0, float arg1)
{
- float ret = NDalicPINVOKE.PropertyCondition_GetArgument(swigCPtr, index);
+ PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.InsideCondition(arg0, arg1), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ ///<summary>
+ /// Outside condition compares whether property is less than arg0 or greater than arg1
+ ///</summary>
+ public static PropertyCondition Outside(float arg0, float arg1)
+ {
+ PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.OutsideCondition(arg0, arg1), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ ///<summary>
+ /// Detects when a property changes by stepAmount from initialValue, in both positive and negative directions. This will continue checking for multiples of stepAmount.
+ ///</summary>
+ public static PropertyCondition Step(float stepAmount, float initialValue)
+ {
+ PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_0(stepAmount, initialValue), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ ///<summary>
+ /// Receives notifications as a property goes above/below the inputted values. Values must be ordered and can be either ascending or descending.
+ ///</summary>
+ public static PropertyCondition Step(float stepAmount)
+ {
+ PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.StepCondition__SWIG_1(stepAmount), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
using System;
using System.Runtime.InteropServices;
-
- internal class PropertyNotification : BaseHandle
+ ///<summary>
+ /// Issues a notification upon a condition of the property being met.
+ /// See PropertyCondition for available defined conditions.
+ ///</summary>
+ public class PropertyNotification : BaseHandle
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
namespace Tizen.NUI
{
- internal class PropertyNotifySignal : global::System.IDisposable
+ ///<summary>
+ /// Signal connection class for PropertyNotification
+ ///</summary>
+ public class PropertyNotifySignal : global::System.IDisposable
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;