/// The <see cref="Efl.Object.FreezeEvent"/> and <see cref="Efl.Object.ThawEvent"/> calls are used to pause and unpause the timer.
/// (Since EFL 1.22)</summary>
[Efl.LoopTimer.NativeMethods]
-public class LoopTimer : Efl.LoopConsumer, Efl.Eo.IWrapper
+public class LoopTimer : Efl.LoopConsumer
{
///<summary>Pointer to the native class description.</summary>
public override System.IntPtr NativeClass
/// <param name="raw">The native pointer to be wrapped.</param>
protected LoopTimer(System.IntPtr raw) : base(raw)
{
- }
+ }
/// <summary>Initializes a new instance of the <see cref="LoopTimer"/> class.
/// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
{
}
- /// <summary>Verifies if the given object is equal to this one.</summary>
- /// <param name="instance">The object to compare to.</param>
- /// <returns>True if both objects point to the same native object.</returns>
- public override bool Equals(object instance)
- {
- var other = instance as Efl.Object;
- if (other == null)
- {
- return false;
- }
- return this.NativeHandle == other.NativeHandle;
- }
-
- /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
- /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
- public override int GetHashCode()
- {
- return this.NativeHandle.ToInt32();
- }
-
- /// <summary>Turns the native pointer into a string representation.</summary>
- /// <returns>A string with the type and the native pointer for this object.</returns>
- public override String ToString()
- {
- return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
- }
-
/// <summary>Event triggered when the specified time as passed.
/// (Since EFL 1.22)</summary>
public event EventHandler TimerTickEvt
{
lock (eventLock)
{
- var wRef = new WeakReference(this);
Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
{
- var obj = wRef.Target as Efl.Eo.IWrapper;
+ var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
if (obj != null)
{
EventArgs args = EventArgs.Empty;
Eina.Error.RaiseIfUnhandledException();
}
/// <summary>Interval the timer ticks on.
-/// (Since EFL 1.22)</summary>
-/// <value>The new interval in seconds</value>
+ /// (Since EFL 1.22)</summary>
+ /// <value>The new interval in seconds</value>
public double TimerInterval {
get { return GetTimerInterval(); }
set { SetTimerInterval(value); }
}
/// <summary>Pending time regarding a timer.
-/// (Since EFL 1.22)</summary>
-/// <value>Pending time</value>
+ /// (Since EFL 1.22)</summary>
+ /// <value>Pending time</value>
public double TimePending {
get { return GetTimePending(); }
}
return Efl.LoopTimer.efl_loop_timer_class_get();
}
- #pragma warning disable CA1707, SA1300, SA1600
+ #pragma warning disable CA1707, CS1591, SA1300, SA1600
private delegate double efl_loop_timer_interval_get_delegate(System.IntPtr obj, System.IntPtr pd);
private static double timer_interval_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_loop_timer_interval_get was called");
- Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
- if (wrapper != null)
+ var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
+ if (ws != null)
{
double _ret_var = default(double);
try
{
- _ret_var = ((LoopTimer)wrapper).GetTimerInterval();
+ _ret_var = ((LoopTimer)ws.Target).GetTimerInterval();
}
catch (Exception e)
{
private static void timer_interval_set(System.IntPtr obj, System.IntPtr pd, double kw_in)
{
Eina.Log.Debug("function efl_loop_timer_interval_set was called");
- Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
- if (wrapper != null)
+ var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
+ if (ws != null)
{
try
{
- ((LoopTimer)wrapper).SetTimerInterval(kw_in);
+ ((LoopTimer)ws.Target).SetTimerInterval(kw_in);
}
catch (Exception e)
{
private static double time_pending_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_loop_timer_time_pending_get was called");
- Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
- if (wrapper != null)
+ var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
+ if (ws != null)
{
double _ret_var = default(double);
try
{
- _ret_var = ((LoopTimer)wrapper).GetTimePending();
+ _ret_var = ((LoopTimer)ws.Target).GetTimePending();
}
catch (Exception e)
{
private static void timer_reset(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_loop_timer_reset was called");
- Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
- if (wrapper != null)
+ var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
+ if (ws != null)
{
try
{
- ((LoopTimer)wrapper).ResetTimer();
+ ((LoopTimer)ws.Target).ResetTimer();
}
catch (Exception e)
{
private static void timer_loop_reset(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_loop_timer_loop_reset was called");
- Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
- if (wrapper != null)
+ var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
+ if (ws != null)
{
try
{
- ((LoopTimer)wrapper).ResetTimerLoop();
+ ((LoopTimer)ws.Target).ResetTimerLoop();
}
catch (Exception e)
{
private static void timer_delay(System.IntPtr obj, System.IntPtr pd, double add)
{
Eina.Log.Debug("function efl_loop_timer_delay was called");
- Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
- if (wrapper != null)
+ var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
+ if (ws != null)
{
try
{
- ((LoopTimer)wrapper).TimerDelay(add);
+ ((LoopTimer)ws.Target).TimerDelay(add);
}
catch (Exception e)
{
private static efl_loop_timer_delay_delegate efl_loop_timer_delay_static_delegate;
- #pragma warning restore CA1707, SA1300, SA1600
+ #pragma warning restore CA1707, CS1591, SA1300, SA1600
}
}