Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public void Populate(Library library, bool clear)
 {
     if (clear) {
         Clear();
     }
     listView1.Columns.AddRange(GetColumnHeaders(library));
     listView1.GridLines = true;
     listView1.Items.AddRange(GetItems(library));
 }