void locationService_Completed(object sender, TaskHelperEventArgs e) { locationStatus = e.Status; if (runningHelperHandles.Length > 0 && runningHelperHandles[(int)TaskOrder.Location] != null) { AutoResetEvent evt = runningHelperHandles[(int)TaskOrder.Location] as AutoResetEvent; if (evt != null) { evt.Set(); } } System.Diagnostics.Debug.WriteLine("Location completed " + e.Status.ToString() + " " + DateTime.Now.ToString()); }
public TaskHelperEventArgs(TaskHelperCompletionStatus status) : base() { Status = status; }
void updater_Completed(object sender, TaskHelperEventArgs e) { // throw new NotImplementedException(); updaterStatus = e.Status; System.Diagnostics.Debug.WriteLine("Updater completed " + e.Status.ToString() + " " + DateTime.Now.ToString()); }
void locationService_Completed(object sender, TaskHelperEventArgs e) { locationStatus = e.Status; if (runningHelperHandles.Length > 0 && runningHelperHandles[(int)TaskOrder.Location] != null) { AutoResetEvent evt = runningHelperHandles[(int)TaskOrder.Location] as AutoResetEvent; if (evt != null) evt.Set(); } System.Diagnostics.Debug.WriteLine("Location completed " + e.Status.ToString() + " " + DateTime.Now.ToString()); }
public void Start() { try { isRunning = true; DoWork(); Status = TaskHelperCompletionStatus.Completed; } catch (Exception ) { Status = TaskHelperCompletionStatus.Failed; NotifyComplete(); //This should log the error } // We do not notify because this process runs asynchronous on GeoCoordinateWatcher's callback.. }
void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e) { lock (this) { if (doOnce) { Location location = LocationHelper.FindNearestMeetingThreshold(locations, e.Position.Location, 10.0); if (location != null) { ShellToast toast = new ShellToast(); toast.Content = ""; toast.Title = "You have tasks nearby " + location.Name; toast.NavigationUri = Constants.MakeNearbyPivotUri(); toast.Show(); Status = TaskHelperCompletionStatus.Completed; CleanUp(); NotifyComplete(); } doOnce = false; } }; }
public void Stop() { if (isRunning) { isRunning = false; CleanUp(); Status = TaskHelperCompletionStatus.TimedOut; NotifyComplete(); } }
public void DoWork() { try { var tiles = ShellTile.ActiveTiles; foreach (ShellTile tile in tiles) { StandardTileData updatedData = new StandardTileData(); Project project = GetProject(tile); if (project != null) { int count = GetOverdueCount(project); string color = GetColorName(project.Color); if (count > 0) { updatedData.BackgroundImage = new Uri(string.Format("/Images/Tiles/{0}{1}.png", color, count), UriKind.Relative); } else { updatedData.BackgroundImage = new Uri(string.Format("/Images/Tiles/{0}check.png", color), UriKind.Relative); } updatedData.BackBackgroundImage = new Uri( string.Format("/Images/Tiles/{0}.png", project.Color.Substring(1)), UriKind.Relative); updatedData.BackContent = GetTasks(project); tile.Update(updatedData); } } Status = TaskHelperCompletionStatus.Completed; } catch (Exception) { Status = TaskHelperCompletionStatus.Failed; } NotifyComplete(); }
public void Stop() { Status = TaskHelperCompletionStatus.TimedOut; NotifyComplete(); }