aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Weather/BaseWeatherProvider.cs
blob: 4ae7a3991c4f00d557b2e0b881378b923b15b762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using MediaBrowser.Model.Weather;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace MediaBrowser.Controller.Weather
{
    /// <summary>
    /// Class BaseWeatherProvider
    /// </summary>
    public abstract class BaseWeatherProvider : IDisposable
    {
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Releases unmanaged and - optionally - managed resources.
        /// </summary>
        /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        protected virtual void Dispose(bool dispose)
        {
        }

        /// <summary>
        /// Gets the weather info async.
        /// </summary>
        /// <param name="location">The location.</param>
        /// <returns>Task{WeatherInfo}.</returns>
        public abstract Task<WeatherInfo> GetWeatherInfoAsync(string location, CancellationToken cancellationToken);
    }
}