private ColumnHeader[] GetColumnHeaders(Library library)
 {
     List<ColumnHeader> ch = new List<ColumnHeader>();
     foreach (Column c in library.GetColumns())
     {
         ColumnHeader newCol = new ColumnHeader();
         newCol.Text = c.name;
         newCol.Tag = c.type;
         newCol.Width = c.width;
         ch.Add(newCol);
     }
     return ch.ToArray();
 }
 private ListViewItem[] GetItems(Library library)
 {
     List<ListViewItem> lv = new List<ListViewItem>();
     foreach (LibraryEntry entry in library.entries)
     {
         lv.Add(new ListViewItem(entry.Items()));
     }
     return lv.ToArray();
 }
 public void Populate(Library library, bool clear)
 {
     if (clear) {
         Clear();
     }
     listView1.Columns.AddRange(GetColumnHeaders(library));
     listView1.GridLines = true;
     listView1.Items.AddRange(GetItems(library));
 }