2 * Copyright(c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 using System.ComponentModel;
22 using System.Runtime.InteropServices;
23 using Tizen.NUI.BaseComponents;
25 using System.Collections;
26 using System.Collections.Generic;
28 using System.Reflection;
30 using Tizen.NUI.Binding.Internals;
31 using Tizen.NUI.Binding;
32 using System.Globalization;
33 using Tizen.NUI.Xaml.Internals;
36 /// Animation can be used to animate the properties of any number of objects, typically view.<br />
37 /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
38 /// This is typically done in the object destructor, and requires either the animation handle to be stored.<br />
39 /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.<br />
40 /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
42 /// <since_tizen> 3 </since_tizen>
43 public class Animation : BaseHandle
45 private static bool? disableAnimation = null;
47 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
49 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
50 private System.IntPtr _finishedCallbackOfNative;
52 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
54 private string[] _properties = null;
55 private string[] _destValue = null;
56 private int[] _startTime = null;
57 private int[] _endTime = null;
60 /// Creates an initialized animation.<br />
61 /// The animation will not loop.<br />
62 /// The default end action is "Cancel".<br />
63 /// The default alpha function is linear.<br />
65 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
66 /// <param name="durationMilliSeconds">The duration in milliseconds.</param>
67 /// <since_tizen> 3 </since_tizen>
68 public Animation(int durationMilliSeconds) : this(Interop.Animation.Animation_New((float)durationMilliSeconds / 1000.0f), true)
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73 internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Animation.Animation_SWIGUpcast(cPtr), cMemoryOwn)
75 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
77 _animationFinishedEventCallback = OnFinished;
78 _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_animationFinishedEventCallback);
81 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
82 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
84 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
85 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
87 private event EventHandler _animationFinishedEventHandler;
90 * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
91 * The finished signal is emitted when an animation's animations have finished.
93 /// <since_tizen> 3 </since_tizen>
94 public event EventHandler Finished
98 if (_animationFinishedEventHandler == null && disposed == false)
100 FinishedSignal().Connect(_finishedCallbackOfNative);
102 _animationFinishedEventHandler += value;
106 _animationFinishedEventHandler -= value;
108 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
110 FinishedSignal().Disconnect(_finishedCallbackOfNative);
115 private event EventHandler _animationProgressReachedEventHandler;
118 * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
119 * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.
121 /// <since_tizen> 3 </since_tizen>
122 public event EventHandler ProgressReached
126 if (_animationProgressReachedEventHandler == null)
128 _animationProgressReachedEventCallback = OnProgressReached;
129 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
132 _animationProgressReachedEventHandler += value;
136 _animationProgressReachedEventHandler -= value;
138 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
140 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
146 /// Enumeration for what to do when the animation ends, stopped, or destroyed.
148 /// <since_tizen> 3 </since_tizen>
149 public enum EndActions
152 /// When the animation ends, the animated property values are saved.
156 /// When the animation ends, the animated property values are forgotten.
160 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
166 /// Enumeration for what interpolation method to use on key-frame animations.
168 /// <since_tizen> 3 </since_tizen>
169 public enum Interpolation
172 /// Values in between key frames are interpolated using a linear polynomial. (Default)
176 /// Values in between key frames are interpolated using a cubic polynomial.
182 /// Enumeration for what state the animation is in.
184 /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
185 /// <since_tizen> 3 </since_tizen>
189 /// The animation has stopped.
193 /// The animation is playing.
197 /// The animation is paused.
203 /// Gets or sets the duration in milliseconds of the animation.
205 /// <since_tizen> 3 </since_tizen>
210 SetDuration(MilliSecondsToSeconds(value));
214 return SecondsToMilliSeconds(GetDuration());
219 /// Gets or sets the default alpha function for the animation.
221 /// <since_tizen> 3 </since_tizen>
222 public AlphaFunction DefaultAlphaFunction
226 SetDefaultAlphaFunction(value);
230 AlphaFunction ret = GetDefaultAlphaFunction();
236 /// Queries the state of the animation.
238 /// <since_tizen> 3 </since_tizen>
248 /// Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.<br />
249 /// This property resets the looping value and should not be used with the Looping property.<br />
250 /// Setting this parameter does not cause the animation to Play().<br />
251 /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br />
252 /// The loop count is initially 1 for play once.<br />
254 /// <since_tizen> 3 </since_tizen>
263 int ret = GetLoopCount();
269 /// Gets or sets the status of whether the animation will loop.<br />
270 /// This property resets the loop count and should not be used with the LoopCount property.<br />
271 /// Setting this parameter does not cause the animation to Play().<br />
273 /// <since_tizen> 3 </since_tizen>
282 bool ret = IsLooping();
289 /// Gets or sets the end action of the animation.<br />
290 /// This action is performed when the animation ends or if it is stopped.<br />
291 /// The default end action is cancel.<br />
293 /// <since_tizen> 3 </since_tizen>
294 public EndActions EndAction
302 return GetEndAction();
307 /// Gets the current loop count.<br />
308 /// A value 0 indicating the current loop count when looping.<br />
310 /// <since_tizen> 3 </since_tizen>
311 public int CurrentLoop
315 return GetCurrentLoop();
320 /// Gets or sets the disconnect action.<br />
321 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br />
322 /// The default action is cancel.<br />
324 /// <since_tizen> 3 </since_tizen>
325 public EndActions DisconnectAction
329 Interop.Animation.Animation_SetDisconnectAction(swigCPtr, (int)value);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.Animation_GetDisconnectAction(swigCPtr);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
342 /// Gets or sets the progress of the animation.<br />
343 /// The animation will play (or continue playing) from this point.<br />
344 /// The progress must be in the 0-1 interval or in the play range interval if defined<br />
345 /// otherwise, it will be ignored.<br />
347 /// <since_tizen> 3 </since_tizen>
348 public float CurrentProgress
352 Interop.Animation.Animation_SetCurrentProgress(swigCPtr, value);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 float ret = Interop.Animation.Animation_GetCurrentProgress(swigCPtr);
358 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 /// Gets or sets specificifications of a speed factor for the animation.<br />
365 /// The speed factor is a multiplier of the normal velocity of the animation.<br />
366 /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br />
367 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br />
369 /// <since_tizen> 3 </since_tizen>
370 public float SpeedFactor
374 Interop.Animation.Animation_SetSpeedFactor(swigCPtr, value);
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 float ret = Interop.Animation.Animation_GetSpeedFactor(swigCPtr);
380 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386 /// Gets or sets the playing range.<br />
387 /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
388 /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br />
390 /// <since_tizen> 3 </since_tizen>
391 public RelativeVector2 PlayRange
395 Interop.Animation.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
396 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 Vector2 ret = new Vector2(Interop.Animation.Animation_GetPlayRange(swigCPtr), true);
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br />
409 /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30% <br />
410 /// One notification can be set on each animation.
412 /// <since_tizen> 3 </since_tizen>
413 public float ProgressNotification
417 Interop.Animation.Animation_SetProgressNotification(swigCPtr, value);
418 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 float ret = Interop.Animation.Animation_GetProgressNotification(swigCPtr);
423 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 /// Gets or sets the properties of the animation.
431 public string[] Properties
444 /// Gets or sets the destination value for each property of the animation.
446 public string[] DestValue
459 /// Gets or sets the start time for each property of the animation.
461 public int[] StartTime
474 /// Gets or sets the end time for each property of the animation.
488 private bool DisableAnimation
492 if (disableAnimation.HasValue == false)
494 string type = Environment.GetEnvironmentVariable("PlatformSmartType");
496 disableAnimation = true;
498 disableAnimation = false;
500 return disableAnimation.Value;
505 /// Downcasts a handle to animation handle.<br />
506 /// If handle points to an animation object, the downcast produces a valid handle.<br />
507 /// If not, the returned handle is left uninitialized.<br />
509 /// <param name="handle">Handle to an object.</param>
510 /// <returns>Handle to an animation object or an uninitialized handle.</returns>
511 /// <since_tizen> 3 </since_tizen>
512 [Obsolete("Deprecated in API6, Will be removed in API9, Please use as keyword instead!")]
513 [EditorBrowsable(EditorBrowsableState.Never)]
514 public static Animation DownCast(BaseHandle handle)
516 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
517 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522 /// Stops the animation.
524 /// <param name="action">The end action can be set.</param>
525 /// <since_tizen> 3 </since_tizen>
526 public void Stop(EndActions action = EndActions.Cancel)
528 SetEndAction(action);
529 Interop.Animation.Animation_Stop(swigCPtr);
530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 /// Animates a property value by a relative amount.<br />
536 /// <param name="target">The target object to animate.</param>
537 /// <param name="property">The target property to animate.</param>
538 /// <param name="relativeValue">The property value will change by this amount.</param>
539 /// <param name="alphaFunction">The alpha function to apply.</param>
540 /// <since_tizen> 3 </since_tizen>
541 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
543 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
545 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
546 if (propertyType.Equals(PropertyType.Float))
548 System.Type type = relativeValue.GetType();
549 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
551 int num = (int)relativeValue;
552 relativeValue = (float)num;
556 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
558 if (alphaFunction != null)
560 AnimateBy(_prop, val, alphaFunction);
564 AnimateBy(_prop, val);
569 /// Animates a property value by a relative amount.<br />
571 /// <param name="target">The target object to animate.</param>
572 /// <param name="property">The target property to animate.</param>
573 /// <param name="relativeValue">The property value will change by this amount.</param>
574 /// <param name="startTime">The start time of the animation.</param>
575 /// <param name="endTime">The end time of the animation.</param>
576 /// <param name="alphaFunction">The alpha function to apply.</param>
577 /// <since_tizen> 3 </since_tizen>
578 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
580 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
582 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
583 if (propertyType.Equals(PropertyType.Float))
585 System.Type type = relativeValue.GetType();
586 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
588 int num = (int)relativeValue;
589 relativeValue = (float)num;
593 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
595 if (alphaFunction != null)
597 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
598 AnimateBy(_prop, val, alphaFunction, time);
602 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
603 AnimateBy(_prop, val, time);
608 /// Animates a property to a destination value.<br />
610 /// <param name="target">The target object to animate.</param>
611 /// <param name="property">The target property to animate.</param>
612 /// <param name="destinationValue">The destination value.</param>
613 /// <param name="alphaFunction">The alpha function to apply.</param>
614 /// <since_tizen> 3 </since_tizen>
615 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
617 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
619 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
620 if (propertyType.Equals(PropertyType.Float))
622 System.Type type = destinationValue.GetType();
623 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
625 int num = (int)destinationValue;
626 destinationValue = (float)num;
630 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
632 if (alphaFunction != null)
634 AnimateTo(_prop, val, alphaFunction);
638 AnimateTo(_prop, val);
643 /// Animates one or more properties to a destination value.<br />
645 /// <param name="target">The target object to animate.</param>
646 public void PlayAnimateTo(View target)
649 if (_properties.Length == _destValue.Length && _startTime.Length == _endTime.Length && _properties.Length == _startTime.Length)
651 int length = _properties.Length;
652 for (int index = 0; index < length; index++)
654 //object destinationValue = _destValue[index];
655 var elementType = target.GetType();
656 PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == _properties[index]);
657 //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
658 if (propertyInfo != null)
660 object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType);
662 if (destinationValue != null)
664 AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]);
673 /// Animates a property to a destination value.<br />
675 /// <param name="target">The target object to animate.</param>
676 /// <param name="property">The target property to animate.</param>
677 /// <param name="destinationValue">The destination value.</param>
678 /// <param name="startTime">The start time of the animation.</param>
679 /// <param name="endTime">The end time of the animation.</param>
680 /// <param name="alphaFunction">The alpha function to apply.</param>
681 /// <since_tizen> 3 </since_tizen>
682 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
684 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
686 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
687 if (propertyType.Equals(PropertyType.Float))
689 System.Type type = destinationValue.GetType();
690 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
692 int num = (int)destinationValue;
693 destinationValue = (float)num;
697 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
699 if (alphaFunction != null)
701 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
702 AnimateTo(_prop, val, alphaFunction, time);
706 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
707 AnimateTo(_prop, val, time);
712 /// Animates a property between keyframes.
714 /// <param name="target">The target object to animate.</param>
715 /// <param name="property">The target property to animate.</param>
716 /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
717 /// <param name="interpolation">The method used to interpolate between values.</param>
718 /// <param name="alphaFunction">The alpha function to apply.</param>
719 /// <since_tizen> 3 </since_tizen>
720 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
722 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
724 if (_prop.propertyIndex == Property.INVALID_INDEX)
726 throw new System.ArgumentException("second argument string property is invalid parameter!");
729 if (alphaFunction != null)
731 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
735 AnimateBetween(_prop, keyFrames, interpolation);
740 /// Animates a property between keyframes.
742 /// <param name="target">The target object to animate</param>
743 /// <param name="property">The target property to animate</param>
744 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
745 /// <param name="startTime">The start time of animation in milliseconds.</param>
746 /// <param name="endTime">The end time of animation in milliseconds.</param>
747 /// <param name="interpolation">The method used to interpolate between values.</param>
748 /// <param name="alphaFunction">The alpha function to apply.</param>
749 /// <since_tizen> 3 </since_tizen>
750 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
752 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
754 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
755 if (alphaFunction != null)
757 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
761 AnimateBetween(_prop, keyFrames, time, interpolation);
766 /// Animates the view's position and orientation through a predefined path.<br />
767 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
768 /// If forward is the zero vector then no rotation will happen.<br />
770 /// <param name="view">The view to animate.</param>
771 /// <param name="path">It defines position and orientation.</param>
772 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
773 /// <param name="alphaFunction">The alpha function to apply.</param>
774 /// <since_tizen> 3 </since_tizen>
775 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
777 if (alphaFunction == null)
779 Animate(view, path, forward);
783 Animate(view, path, forward, alphaFunction);
788 /// Animates the view's position and orientation through a predefined path.<br />
789 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
790 /// If forward is the zero vector then no rotation will happen.<br />
792 /// <param name="view">The view to animate.</param>
793 /// <param name="path">It defines position and orientation.</param>
794 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
795 /// <param name="startTime">The start time of the animation.</param>
796 /// <param name="endTime">The end time of the animation.</param>
797 /// <param name="alphaFunction">The alpha function to apply.</param>
798 /// <since_tizen> 3 </since_tizen>
799 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
801 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
802 if (alphaFunction == null)
804 Animate(view, path, forward, time);
808 Animate(view, path, forward, alphaFunction, time);
813 /// Creates an initialized animation.<br />
814 /// The animation will not loop.<br />
815 /// The default end action is "Cancel".<br />
816 /// The default alpha function is linear.<br />
818 /// <since_tizen> 3 </since_tizen>
819 public Animation() : this(Interop.Animation.Animation_New(0.0f), true)
821 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
825 /// Plays the animation.
827 /// <since_tizen> 3 </since_tizen>
830 Interop.Animation.Animation_Play(swigCPtr);
831 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833 if (DisableAnimation == true)
834 Stop(EndActions.StopFinal);
838 /// Plays the animation from a given point.<br />
839 /// The progress must be in the 0-1 interval or in the play range interval if defined,
840 /// otherwise, it will be ignored.<br />
842 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
843 /// <since_tizen> 3 </since_tizen>
844 public void PlayFrom(float progress)
846 Interop.Animation.Animation_PlayFrom(swigCPtr, progress);
847 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
851 /// Plays the animation after a given delay time.<br/>
852 /// The delay time is not included in the looping time.<br/>
853 /// When the delay time is a negative value, it would treat as play immediately.<br/>
855 /// <param name="delayMilliseconds">The delay time.</param>
856 /// <since_tizen> 4 </since_tizen>
857 public void PlayAfter(int delayMilliseconds)
859 Interop.Animation.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
860 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
864 /// Pauses the animation.
866 /// <since_tizen> 3 </since_tizen>
869 Interop.Animation.Animation_Pause(swigCPtr);
870 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
874 /// Stops the animation.
876 /// <since_tizen> 3 </since_tizen>
879 Interop.Animation.Animation_Stop(swigCPtr);
880 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
884 /// Clears the animation.<br />
885 /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
887 /// <since_tizen> 3 </since_tizen>
890 Interop.Animation.Animation_Clear(swigCPtr);
891 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
894 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
896 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
899 internal object ConvertTo(object value, Type toType)
901 Func<object> getConverter = () =>
903 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
904 if (converterTypeName == null)
907 Type convertertype = Type.GetType(converterTypeName);
908 return Activator.CreateInstance(convertertype);
911 return ConvertTo(value, toType, getConverter);
914 internal object ConvertTo(object value, Type toType, Func<object> getConverter)
919 var str = value as string;
922 //If there's a [TypeConverter], use it
923 object converter = getConverter?.Invoke();
924 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
925 if (xfTypeConverter != null)
926 return value = xfTypeConverter.ConvertFromInvariantString(str);
927 var converterType = converter?.GetType();
928 if (converterType != null)
930 var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
931 new[] { typeof(string) });
932 if (convertFromStringInvariant != null)
933 return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
936 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
937 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
938 toType = Nullable.GetUnderlyingType(toType);
940 //Obvious Built-in conversions
941 if (toType.GetTypeInfo().IsEnum)
942 return Enum.Parse(toType, str, true);
943 if (toType == typeof(SByte))
944 return SByte.Parse(str, CultureInfo.InvariantCulture);
945 if (toType == typeof(Int16))
946 return Int16.Parse(str, CultureInfo.InvariantCulture);
947 if (toType == typeof(Int32))
948 return Int32.Parse(str, CultureInfo.InvariantCulture);
949 if (toType == typeof(Int64))
950 return Int64.Parse(str, CultureInfo.InvariantCulture);
951 if (toType == typeof(Byte))
952 return Byte.Parse(str, CultureInfo.InvariantCulture);
953 if (toType == typeof(UInt16))
954 return UInt16.Parse(str, CultureInfo.InvariantCulture);
955 if (toType == typeof(UInt32))
956 return UInt32.Parse(str, CultureInfo.InvariantCulture);
957 if (toType == typeof(UInt64))
958 return UInt64.Parse(str, CultureInfo.InvariantCulture);
959 if (toType == typeof(Single))
960 return Single.Parse(str, CultureInfo.InvariantCulture);
961 if (toType == typeof(Double))
962 return Double.Parse(str, CultureInfo.InvariantCulture);
963 if (toType == typeof(Boolean))
964 return Boolean.Parse(str);
965 if (toType == typeof(TimeSpan))
966 return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
967 if (toType == typeof(DateTime))
968 return DateTime.Parse(str, CultureInfo.InvariantCulture);
969 if (toType == typeof(Char))
972 Char.TryParse(str, out c);
975 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
976 return str.Substring(2);
977 if (toType == typeof(String))
979 if (toType == typeof(Decimal))
980 return Decimal.Parse(str, CultureInfo.InvariantCulture);
983 //if the value is not assignable and there's an implicit conversion, convert
984 if (value != null && !toType.IsAssignableFrom(value.GetType()))
986 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
987 ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
988 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
989 // ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
991 if (opImplicit != null)
993 value = opImplicit.Invoke(null, new[] { value });
1001 internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
1003 var converterAttribute =
1004 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
1005 if (converterAttribute == null)
1007 if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
1008 return (string)converterAttribute.ConstructorArguments[0].Value;
1009 if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
1010 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
1014 internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
1017 var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
1019 var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
1020 var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
1022 if (mi == null) return null;
1023 if (!mi.IsSpecialName) return null;
1024 if (!mi.IsPublic) return null;
1025 if (!mi.IsStatic) return null;
1026 if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
1031 internal Animation(float durationSeconds) : this(Interop.Animation.Animation_New(durationSeconds), true)
1033 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1037 internal Animation(Animation handle) : this(Interop.Animation.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
1039 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1042 internal Animation Assign(Animation rhs)
1044 Animation ret = new Animation(Interop.Animation.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
1045 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1049 internal void SetDuration(float seconds)
1051 Interop.Animation.Animation_SetDuration(swigCPtr, seconds);
1052 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1055 internal float GetDuration()
1057 float ret = Interop.Animation.Animation_GetDuration(swigCPtr);
1058 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1062 internal void SetLooping(bool looping)
1064 Interop.Animation.Animation_SetLooping(swigCPtr, looping);
1065 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1068 internal void SetLoopCount(int count)
1070 Interop.Animation.Animation_SetLoopCount(swigCPtr, count);
1071 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1074 internal int GetLoopCount()
1076 int ret = Interop.Animation.Animation_GetLoopCount(swigCPtr);
1077 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1081 internal int GetCurrentLoop()
1083 int ret = Interop.Animation.Animation_GetCurrentLoop(swigCPtr);
1084 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1088 internal bool IsLooping()
1090 bool ret = Interop.Animation.Animation_IsLooping(swigCPtr);
1091 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1095 internal void SetEndAction(Animation.EndActions action)
1097 Interop.Animation.Animation_SetEndAction(swigCPtr, (int)action);
1098 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1101 internal Animation.EndActions GetEndAction()
1103 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.Animation_GetEndAction(swigCPtr);
1104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1108 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1110 Interop.Animation.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
1111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1114 internal Animation.EndActions GetDisconnectAction()
1116 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.Animation_GetDisconnectAction(swigCPtr);
1117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1121 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1123 Interop.Animation.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
1124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1127 internal AlphaFunction GetDefaultAlphaFunction()
1129 AlphaFunction ret = new AlphaFunction(Interop.Animation.Animation_GetDefaultAlphaFunction(swigCPtr), true);
1130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1134 internal void SetCurrentProgress(float progress)
1136 Interop.Animation.Animation_SetCurrentProgress(swigCPtr, progress);
1137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1140 internal float GetCurrentProgress()
1142 float ret = Interop.Animation.Animation_GetCurrentProgress(swigCPtr);
1143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1147 internal void SetSpeedFactor(float factor)
1149 Interop.Animation.Animation_SetSpeedFactor(swigCPtr, factor);
1150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1153 internal float GetSpeedFactor()
1155 float ret = Interop.Animation.Animation_GetSpeedFactor(swigCPtr);
1156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1160 internal void SetPlayRange(Vector2 range)
1162 Interop.Animation.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
1163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1166 internal Vector2 GetPlayRange()
1168 Vector2 ret = new Vector2(Interop.Animation.Animation_GetPlayRange(swigCPtr), true);
1169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1173 internal Animation.States GetState()
1175 Animation.States ret = (Animation.States)Interop.Animation.Animation_GetState(swigCPtr);
1176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1180 internal AnimationSignal FinishedSignal()
1182 AnimationSignal ret = new AnimationSignal(Interop.Animation.Animation_FinishedSignal(swigCPtr), false);
1183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1187 internal AnimationSignal ProgressReachedSignal()
1189 AnimationSignal ret = new AnimationSignal(Interop.Animation.Animation_ProgressReachedSignal(swigCPtr), false);
1190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1194 internal void AnimateBy(Property target, PropertyValue relativeValue)
1196 Interop.Animation.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1200 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1202 Interop.Animation.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1208 Interop.Animation.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1212 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1214 Interop.Animation.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1218 internal void AnimateTo(Property target, PropertyValue destinationValue)
1220 Interop.Animation.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1226 Interop.Animation.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1230 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1232 Interop.Animation.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1236 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1238 Interop.Animation.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1242 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1244 Interop.Animation.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1248 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1250 Interop.Animation.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1254 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1256 Interop.Animation.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1260 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1262 Interop.Animation.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1266 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1268 Interop.Animation.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1272 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1274 Interop.Animation.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1278 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1280 Interop.Animation.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1284 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1286 Interop.Animation.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1290 internal void Animate(View view, Path path, Vector3 forward)
1292 Interop.Animation.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1293 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1296 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1298 Interop.Animation.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1302 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1304 Interop.Animation.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1308 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1310 Interop.Animation.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1314 internal void Show(View view, float delaySeconds)
1316 Interop.Animation.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1320 internal void Hide(View view, float delaySeconds)
1322 Interop.Animation.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1323 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1327 /// To make animation instance be disposed.
1329 /// <since_tizen> 3 </since_tizen>
1330 protected override void Dispose(DisposeTypes type)
1334 if (_animationFinishedEventCallback != null)
1336 FinishedSignal().Disconnect(_finishedCallbackOfNative);
1339 if (_animationProgressReachedEventCallback != null)
1342 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
1356 //Release your own unmanaged resources here.
1357 //You should not access any managed member here except static instance.
1358 //because the execution order of Finalizes is non-deterministic.
1360 if (swigCPtr.Handle != global::System.IntPtr.Zero)
1364 swigCMemOwn = false;
1365 Interop.Animation.delete_Animation(swigCPtr);
1367 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1373 private void OnFinished(IntPtr data)
1375 if (_animationFinishedEventHandler != null)
1377 //here we send all data to user event handlers
1378 _animationFinishedEventHandler(this, null);
1382 private void OnProgressReached(IntPtr data)
1384 if (_animationProgressReachedEventHandler != null)
1386 //here we send all data to user event handlers
1387 _animationProgressReachedEventHandler(this, null);
1391 private float MilliSecondsToSeconds(int millisec)
1393 return (float)millisec / 1000.0f;
1396 private int SecondsToMilliSeconds(float sec)
1398 return (int)(sec * 1000);