private void SelectTables_SelectedIndexChanged(object sender, EventArgs e) { SelectedItemService service = new SelectedItemService(connectionString, providerName); switch (SelectTables.SelectedItem) { case "Покупатели": TextObject.Clear(); service.GetSellers(TextObject); break; case "Продавцы": TextObject.Clear(); service.GetCustomers(TextObject); break; case "Продажи": TextObject.Clear(); service.GetSales(TextObject); break; } }
public new virtual void Clear() { if (FirstNode != null) { TextObject first = FirstNode; while (first?.DLeft != null) { first = first.DLeft; } while (first != null) { TextObject next = first.DRight; first.Destroy(); first.Clear(); first = next; } } if (DrawPointer != null) { TextObject first = DrawPointer; while (first?.DLeft != null) { first = first.DLeft; } while (first != null) { TextObject next = first.DRight; first.Destroy(); first.Clear(); first = next; } } FirstNode = this; FirstNode.DLeft = null; FirstNode.DRight = null; DrawPointer = null; }