BaseWeatherProvider.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using MediaBrowser.Model.Weather;
  2. using System;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. namespace MediaBrowser.Controller.Weather
  6. {
  7. /// <summary>
  8. /// Class BaseWeatherProvider
  9. /// </summary>
  10. public abstract class BaseWeatherProvider : IDisposable
  11. {
  12. /// <summary>
  13. /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
  14. /// </summary>
  15. public void Dispose()
  16. {
  17. Dispose(true);
  18. GC.SuppressFinalize(this);
  19. }
  20. /// <summary>
  21. /// Releases unmanaged and - optionally - managed resources.
  22. /// </summary>
  23. /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
  24. protected virtual void Dispose(bool dispose)
  25. {
  26. }
  27. /// <summary>
  28. /// Gets the weather info async.
  29. /// </summary>
  30. /// <param name="location">The location.</param>
  31. /// <returns>Task{WeatherInfo}.</returns>
  32. public abstract Task<WeatherInfo> GetWeatherInfoAsync(string location, CancellationToken cancellationToken);
  33. }
  34. }