예제 #1
0
        public void LoadTable(IDataTable <T> table)
        {
            datatable = table;

            headers.Clear();
            FieldInfo[] fields = table.GetStructType().GetFields();
            foreach (FieldInfo info in fields)
            {
                DataTableHeader h = new DataTableHeader(info.Name);
                h.Clicked   += OnHeaderClicked;
                h.Repainted += OnRepaint;
                h.Resized   += OnResized;
                headers.Add(h);
            }
            keyHeader            = new DataTableHeader("Key", 80f);
            keyHeader.Repainted += OnRepaint;
            keyHeader.Resized   += OnResized;
            keyHeader.Clicked   += OnHeaderClicked;

            rows.Clear();
            table.ForEachEntries((string key, T value) =>
            {
                DataTableRow r = new DataTableRow(headers.Count, value, key);
                r.Clicked     += OnRowClicked;
                rows.Add(r);
            });
            OnSearchUpdated();
            RefreshRowSizes();
            Repaint();
        }
예제 #2
0
        public void LoadTable(IDataTable <T> table)
        {
            datatable = table;

            headers.Clear();
            headers.Add(CreateHeader("Type"));
            headers.Add(CreateHeader("Name"));
            headers.Add(CreateHeader("Path"));
            keyHeader = CreateHeader("Key", 80f);

            rows.Clear();
            table.ForEachEntries((string key, T value) =>
            {
                rows.Add(CreateRow(key, value));
            });
            OnSearchUpdated();
            RefreshRowSizes();
            Repaint();
        }