tolto timers inutilizzato
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
|
||||
namespace GWMS.UI.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Timer a consumo
|
||||
/// https://wellsb.com/csharp/aspnet/blazor-timer-navigate-programmatically/
|
||||
/// (da verificare)
|
||||
/// </summary>
|
||||
public class BlazorTimer
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private Timer _timer;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Events
|
||||
|
||||
public event Action OnElapsed;
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void NotifyTimerElapsed(Object source, ElapsedEventArgs e)
|
||||
{
|
||||
OnElapsed?.Invoke();
|
||||
_timer.Dispose();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void SetTimer(double interval)
|
||||
{
|
||||
_timer = new Timer(interval);
|
||||
_timer.Elapsed += NotifyTimerElapsed;
|
||||
_timer.Enabled = true;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user