private async void ToggleRun() { IsRunning = !IsRunning; ToggleBtn.SetLabel(IsRunning ? "Stop" : "Run"); if (IsRunning) { await LeasesList.RefreshAll(); } }
private void UpdateLists(object sender, EventArgs args) { LeasesList.Clear(); ReservedList.Clear(); foreach (DhcpProba.Model.Dhcp.leaseElement e in _model.LeasesList) { LeasesList.Add("MAC:" + Convert.ToString(e.MAC, 16) + " Ip:" + e.IP.GetString() + " Lejarat:" + TimeSpan.FromSeconds(e.LejaratiIdo).ToString()); } foreach (DhcpProba.Model.Dhcp.resElement e in _model.ReservationList) { ReservedList.Add("MAC:" + Convert.ToString(e.MAC, 16) + " Ip:" + e.IP.GetString()); } }