aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.BL/Connectivity/IConnectivityProvider.cs
blob: 03219a9121b845038c2929eacda96946f6b1f726 (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
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.FSE.BL.Connectivity
{
    /// <summary>
    /// Represents an Internet connection validation provider.
    /// </summary>
    public interface IConnectivityProvider
    {
        /// <summary>
        /// Gets or sets the connectivity verification method.
        /// </summary>
        ConnectivityVerificationMethod VerificationMethod { get; set; }

        /// <summary>
        /// Gets a value indicating whether the system has an active Internet connection currently.
        /// </summary>
        bool IsOnline { get; }

        /// <summary>
        /// Checks whether the system has an active Internet connection.
        /// </summary>
        /// <returns></returns>
        bool CheckOnline();

        /// <summary>
        /// Checks whether the system has an active Internet connection.
        /// </summary>
        /// <returns></returns>
        Task<bool> CheckOnlineAsync();

        /// <summary>
        /// Throws an exception if there is no Internet connection.
        /// </summary>
        void ThrowIfNoInternet();
    }
}