summaryrefslogtreecommitdiff
path: root/Tizen.NUI/src/public/Animation.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Tizen.NUI/src/public/Animation.cs')
-rwxr-xr-xTizen.NUI/src/public/Animation.cs55
1 files changed, 6 insertions, 49 deletions
diff --git a/Tizen.NUI/src/public/Animation.cs b/Tizen.NUI/src/public/Animation.cs
index ba4e606..312ad08 100755
--- a/Tizen.NUI/src/public/Animation.cs
+++ b/Tizen.NUI/src/public/Animation.cs
@@ -458,15 +458,7 @@ namespace Tizen.NUI
/// <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))
@@ -502,15 +494,7 @@ namespace Tizen.NUI
/// <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))
@@ -546,15 +530,7 @@ namespace Tizen.NUI
/// <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))
@@ -591,15 +567,7 @@ namespace Tizen.NUI
/// <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))
@@ -636,11 +604,8 @@ namespace Tizen.NUI
/// <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!");
@@ -669,15 +634,7 @@ namespace Tizen.NUI
/// <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)