dispatcherTimer.Tick += dispatcherTimer_Tick; dispatcherTimer.Interval = new TimeSpan(0, 0, 10); // TimeSpan for 10 secs
async void dispatcherTimer_Tick(object sender, object e)
public class BackGroundService { DispatcherTimer dispatcherTimer; public void DispatcherTimerSetup(HttpClient httpClient, string lati, string longi, string UserId) { dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += dispatcherTimer_Tick; dispatcherTimer.Interval = new TimeSpan(0, 0, 10); // TimeSpan for 10 secs if (!dispatcherTimer.IsEnabled) { dispatcherTimer.Start(); } } async void dispatcherTimer_Tick(object sender, object e) { ILinkUser Objuser = new LinkUsers(); await Objuser.LinkUsertoGroups(UserCookieWrapper.UserAccessToken, Latitude, Longitude, UserId); await Objuser.LinkDeptUsertoSGroups(UserCookieWrapper.UserAccessToken, Latitude, Longitude, UserId); } }
if (!dispatcherTimer.IsEnabled) { dispatcherTimer.Start(); }
if (dispatcherTimer.IsEnabled) { dispatcherTimer.Start(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)