The throttle timer is useful for limiting the number of requests to a method if the method is repeatedly called many times but you only want the method raised once. It delays raising the method until a set interval, and any previous calls to the actions in that interval will be cancelled.
Пример #1
0
		private void UpdateLayerItemsSource()
		{
			if (_updateTimer == null)
			{
				_updateTimer = new ThrottleTimer(100) { Action = UpdateLayerItemsSourceImpl };
			}
			_updateTimer.Invoke();
		}
 private void InitItemsSource()
 {
     // wait for the map to stop navigating so
     //map navigation performance doesn't suffer from it.
     if (_updateItemsSourceTimer == null)
     {
         _updateItemsSourceTimer = new ThrottleTimer(50) { Action = InitItemsSourceImpl };
     }
     _updateItemsSourceTimer.Invoke();
 }
Пример #3
0
 private void UpdateAttributionItems()
 {
     // wait for the map to stop navigating so
     //map navigation performance doesn't suffer from it.
     if (_updateItemsTimer == null)
     {
         _updateItemsTimer = new ThrottleTimer(100) { Action = UpdateAttributionItemsImpl };
     }
     _updateItemsTimer.Invoke();
 }
Пример #4
0
 private void OnScaleChanged()
 {
     //Update Layer Visibilities is expensive, so wait for the map to stop navigating so
     //map navigation performance doesn't suffer from it.
     if (_updateTimer == null)
     {
         _updateTimer = new ThrottleTimer(100) { Action = UpdateLayerVisibilities };
     }
     _updateTimer.Invoke();
 }