SmallRefactor: Tách khai báo và khởi tạo thrStatistics
This commit is contained in:
parent
444b58721f
commit
c909ce2cc1
|
@ -9,6 +9,7 @@ namespace AIParkingApplication
|
||||||
public partial class Statistic : UserControl
|
public partial class Statistic : UserControl
|
||||||
{
|
{
|
||||||
private readonly HttpClient client;
|
private readonly HttpClient client;
|
||||||
|
private readonly Thread thrStatistics;
|
||||||
|
|
||||||
Label lblLoaiXe;
|
Label lblLoaiXe;
|
||||||
Label lblXeMay;
|
Label lblXeMay;
|
||||||
|
@ -20,8 +21,8 @@ namespace AIParkingApplication
|
||||||
public Statistic(string apiUrl)
|
public Statistic(string apiUrl)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Thread thrStatistics = new Thread(new ThreadStart(GetStatistic));
|
|
||||||
client = new HttpClient { BaseAddress = new Uri(apiUrl), Timeout = TimeSpan.FromMilliseconds(5000) };
|
client = new HttpClient { BaseAddress = new Uri(apiUrl), Timeout = TimeSpan.FromMilliseconds(5000) };
|
||||||
|
thrStatistics = new Thread(new ThreadStart(GetStatistic));
|
||||||
thrStatistics.IsBackground = true;
|
thrStatistics.IsBackground = true;
|
||||||
thrStatistics.Start();
|
thrStatistics.Start();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user