teotestbluetooth / TestXamConnections / TestXamConnections.Android / Helper / ConnectionServiceProvider.cs @ 4c7eec22
Historique | Voir | Annoter | Télécharger (1,253 ko)
1 |
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 |
public class ConnectionServiceProvider : IConnectionServiceProvider |
21 |
{ |
22 |
public IConnectionService GetConnectionServiceInstance(ConnectionType ct) |
23 |
{ |
24 |
IConnectionService instance = null; |
25 |
switch (ct) |
26 |
{ |
27 |
case ConnectionType.Bluetooth: |
28 |
// instance = BluetoothConnectionService.Instance; |
29 |
instance = new BluetoothConnectionService(); |
30 |
break; |
31 |
|
32 |
case ConnectionType.Intern: |
33 |
instance = new InternConnectionService(); |
34 |
break; |
35 |
|
36 |
case ConnectionType.Wifi: |
37 |
instance = new WifiConnectionService(); |
38 |
break; |
39 |
|
40 |
default: |
41 |
break; |
42 |
} |
43 |
|
44 |
return instance; |
45 |
} |
46 |
} |
47 |
} |