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
|
||||
{
|
||||
private readonly HttpClient client;
|
||||
private readonly Thread thrStatistics;
|
||||
|
||||
Label lblLoaiXe;
|
||||
Label lblXeMay;
|
||||
|
@ -20,8 +21,8 @@ namespace AIParkingApplication
|
|||
public Statistic(string apiUrl)
|
||||
{
|
||||
InitializeComponent();
|
||||
Thread thrStatistics = new Thread(new ThreadStart(GetStatistic));
|
||||
client = new HttpClient { BaseAddress = new Uri(apiUrl), Timeout = TimeSpan.FromMilliseconds(5000) };
|
||||
thrStatistics = new Thread(new ThreadStart(GetStatistic));
|
||||
thrStatistics.IsBackground = true;
|
||||
thrStatistics.Start();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user