Exemple #1
0
        static void RegenerateRows(
            ErrorsListView listView,
            List <ErrorMessage> errorMessages,
            TreeViewItem rootItem,
            List <TreeViewItem> rows)
        {
            ClearRows(rootItem, rows);

            if (errorMessages.Count == 0)
            {
                return;
            }

            for (int i = 0; i < errorMessages.Count; i++)
            {
                ErrorListViewItem errorListViewItem =
                    new ErrorListViewItem(i + 1, errorMessages[i]);

                rootItem.AddChild(errorListViewItem);
                rows.Add(errorListViewItem);
            }

            listView.SetSelection(new List <int> {
                1
            });
        }
Exemple #2
0
        static void ErrorListViewItemGUI(
            ErrorListViewItem item,
            RowGUIArgs args)
        {
            for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
            {
                Rect cellRect = args.GetCellRect(visibleColumnIdx);

                ErrorsListColumn column =
                    (ErrorsListColumn)args.GetColumn(visibleColumnIdx);

                ErrorListViewItemCellGUI(
                    cellRect, item, column, args.selected, args.focused);
            }
        }
Exemple #3
0
        static void ErrorListViewItemCellGUI(
            Rect rect,
            ErrorListViewItem item,
            ErrorsListColumn column,
            bool isSelected,
            bool isFocused)
        {
            ErrorMessage errorMessage = item.ErrorMessage;

            string label = column == ErrorsListColumn.Path ?
                           errorMessage.Path : errorMessage.Error;

            if (column == ErrorsListColumn.Path)
            {
                DrawTreeViewItem.ForLabel(
                    rect, label, isSelected, isFocused, false);
                return;
            }

            DrawTreeViewItem.ForSecondaryLabel(
                rect, label, isSelected, isFocused, false);
        }