KnowledgeUserControl.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. using System.Windows.Forms;
  9. using static HTEXMark.QRCodeForm;
  10. namespace HTEXMark
  11. {
  12. public class KnowledgeUserControl : UserControl
  13. {
  14. public KnowledgeUserControl()
  15. {
  16. }
  17. public void InitializeTreeView(System.Windows.Forms.ListBox knowledgeListBox,List<Block> block)
  18. {
  19. foreach (var item in block)
  20. {
  21. // 将 TreeView 添加到 UserControl1 的 Controls 集合中
  22. if (item.points.Count()>0) {
  23. knowledgeListBox.Name=item.name;
  24. foreach (var point in item.points)
  25. {
  26. this.BeginInvoke(new Action(() => { knowledgeListBox.Items.Add(point); }));
  27. }
  28. }
  29. }
  30. }
  31. }
  32. }