Révision 12ddf7ef GES_PAC/Services/ConnexionService.cs
GES_PAC/Services/ConnexionService.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 | 1 |
using System.ComponentModel; |
4 |
using System.Linq; |
|
5 | 2 |
using System.Net.NetworkInformation; |
6 | 3 |
using System.Runtime.CompilerServices; |
7 |
using System.Text; |
|
8 |
using System.Threading.Tasks; |
|
9 | 4 |
|
10 | 5 |
namespace GES_PAC.Services |
11 | 6 |
{ |
... | ... | |
40 | 35 |
public ConnexionService() |
41 | 36 |
{ |
42 | 37 |
Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged; |
43 |
Task.Run(() => this.SetIsConnected()).Wait();
|
|
38 |
Task.Run(() => SetIsConnected()).Wait(); |
|
44 | 39 |
// ou : new Action(async () => await SetIsConnected())(); |
45 | 40 |
} |
46 | 41 |
|
... | ... | |
51 | 46 |
|
52 | 47 |
public void Connectivity_ConnectivityChanged(object sender, ConnectivityChangedEventArgs e) |
53 | 48 |
{ |
54 |
Task.Run(() => this.SetIsConnected(e)).Wait();
|
|
49 |
Task.Run(() => SetIsConnected(e)).Wait(); |
|
55 | 50 |
} |
56 | 51 |
|
57 | 52 |
#region INPC |
Formats disponibles : Unified diff