static void RegenerateRows( ListViewItemIds <object> listViewItemIds, List <object> objectInfos, TreeViewItem rootItem, List <TreeViewItem> rows) { ClearRows(rootItem, rows); if (objectInfos.Count == 0) { return; } foreach (object objectInfo in objectInfos) { int objectId; if (!listViewItemIds.TryGetInfoItemId(objectInfo, out objectId)) { objectId = listViewItemIds.AddInfoItem(objectInfo); } ChangesetListViewItem changesetListViewItem = new ChangesetListViewItem(objectId, objectInfo); rootItem.AddChild(changesetListViewItem); rows.Add(changesetListViewItem); } }
static void ChangesetsListViewItemGUI( ViewQueryResult queryResult, float rowHeight, ChangesetListViewItem item, RowGUIArgs args, bool isBoldText, Action avatarLoadedAction) { for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++) { Rect cellRect = args.GetCellRect(visibleColumnIdx); if (visibleColumnIdx == 0) { cellRect.x += UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT; cellRect.width -= UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT; } ChangesetsListColumn column = (ChangesetsListColumn)args.GetColumn(visibleColumnIdx); ChangesetsListViewItemCellGUI( cellRect, rowHeight, queryResult, item, column, avatarLoadedAction, args.selected, args.focused, isBoldText); } }
static void ChangesetsListViewItemCellGUI( Rect rect, float rowHeight, ViewQueryResult queryResult, ChangesetListViewItem item, ChangesetsListColumn column, Action avatarLoadedAction, bool isSelected, bool isFocused, bool isBoldText) { string columnText = RepObjectInfoView.GetColumnText( queryResult.GetRepositorySpec(item.ObjectInfo), queryResult.GetRepObjectInfo(item.ObjectInfo), ChangesetsListHeaderState.GetColumnName(column)); if (column == ChangesetsListColumn.CreatedBy) { DrawTreeViewItem.ForItemCell( rect, rowHeight, -1, GetAvatar.ForEmail(columnText, avatarLoadedAction), null, columnText, isSelected, isFocused, isBoldText, false); return; } if (column == ChangesetsListColumn.Branch || column == ChangesetsListColumn.Repository || column == ChangesetsListColumn.Guid) { DrawTreeViewItem.ForSecondaryLabel( rect, columnText, isSelected, isFocused, isBoldText); return; } DrawTreeViewItem.ForLabel( rect, columnText, isSelected, isFocused, isBoldText); }
protected override void RowGUI(RowGUIArgs args) { if (args.item is ChangesetListViewItem) { ChangesetListViewItem changesetListViewItem = (ChangesetListViewItem)args.item; ChangesetInfo changesetInfo = (ChangesetInfo)changesetListViewItem.ObjectInfo; ChangesetsListViewItemGUI( mQueryResult, rowHeight, changesetListViewItem, args, changesetInfo.ChangesetId == mLoadedChangesetId, Repaint); return; } base.RowGUI(args); }