public void AddCallToListView(ListView listview) { if (listview.InvokeRequired) { listview.Invoke(new Action <ListView>(AddCallToListView), listview); } else { if (Calls.Count > 1) { listview.Items.RemoveAt(0); } listview.Items.Insert(0, new ListViewItem(new[] { Name, Number, CallDirection.ToString(), lastCallTime.ToString(), $"{lastCallDuration.Minutes.ToString()}:{lastCallDuration.Seconds.ToString()}", Calls.Count.ToString() })); } }
public void AddCallToListView(ListView listview) { if (listview.InvokeRequired) { listview.Invoke(new Action <ListView>(AddCallToListView), listview); } else { listview.Items.Insert(0, new ListViewItem(new[] { ContactName, ContactNumber, CallDirection.ToString(), CallTime.ToString(), $"{CallDuration.Minutes.ToString()}:{CallDuration.Seconds.ToString()}" })); } }