Statistiques
| Branche: | Révision:

teotestbluetooth / TestXamConnections / TestXamConnections.Android / Helper / ConnectionServiceProvider.cs @ 4af7febc

Historique | Voir | Annoter | Télécharger (1,247 ko)

1 91ef3e8c Martin Toutant
using Android.App;
2
using Android.Content;
3
using Android.OS;
4
using Android.Runtime;
5
using Android.Views;
6
using Android.Widget;
7
using System;
8
using System.Collections.Generic;
9
using System.Linq;
10
using System.Text;
11
using System.Threading.Tasks;
12
using TestXamConnections;
13
using TestXamConnections.Connection;
14
using TestXamConnections.Droid.Connection;
15
using TestXamConnections.Helper;
16
using Xamarin.Forms;
17
18
namespace TestBLE.Droid.Helper
19
{
20 d14bc0b1 Martin Toutant
    public class ConnectionServiceProvider : IConnectionServiceProvider
21 91ef3e8c Martin Toutant
    {
22
        public IConnectionService GetConnectionInstance(ConnectionType ct)
23
        {
24
            IConnectionService instance = null;
25
            switch (ct)
26
            {
27
                case ConnectionType.Bluetooth:
28 d14bc0b1 Martin Toutant
                    // instance = BluetoothConnectionService.Instance;
29
                    instance = new BluetoothConnectionService();
30 91ef3e8c Martin Toutant
                    break;
31
32
                case ConnectionType.Intern:
33 d14bc0b1 Martin Toutant
                    instance = new InternConnectionService();
34 91ef3e8c Martin Toutant
                    break;
35
36
                case ConnectionType.Wifi:
37 d14bc0b1 Martin Toutant
                    instance = new WifiConnectionService ();
38 91ef3e8c Martin Toutant
                    break;
39
40
                default:
41
                    break;
42
            }
43
44
            return instance;
45
        }
46
    }
47
}