예제 #1
0
        static void RepositoryListViewItemCellGUI(
            Rect rect,
            RepositoryListViewItem item,
            RepositoriesListColumn column,
            float rowHeight,
            bool isSelected,
            bool isFocused)
        {
            if (column == RepositoriesListColumn.Name)
            {
                DrawTreeViewItem.ForItemCell(
                    rect,
                    rowHeight,
                    0,
                    Images.GetImage(Images.Name.IconRepository),
                    null,
                    item.Repository.Name,
                    isSelected,
                    isFocused,
                    false);

                return;
            }

            DefaultGUI.Label(
                rect,
                item.Repository.Server,
                isSelected,
                isFocused);
        }
예제 #2
0
        static void RegenerateRows(
            RepositoriesListView listView,
            IList repositories,
            TreeViewItem rootItem,
            List <TreeViewItem> rows)
        {
            ClearRows(rootItem, rows);

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

            for (int i = 0; i < repositories.Count; i++)
            {
                RepositoryListViewItem repositoryListViewItem =
                    new RepositoryListViewItem(i + 1, (RepositoryInfo)repositories[i]);

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

            listView.SetSelection(new List <int> {
                1
            });
        }
예제 #3
0
        static void RepositoryListViewItemGUI(
            RepositoryListViewItem item,
            RowGUIArgs args,
            float rowHeight)
        {
            for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
            {
                Rect cellRect = args.GetCellRect(visibleColumnIdx);

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

                RepositoryListViewItemCellGUI(
                    cellRect,
                    item,
                    column,
                    rowHeight,
                    args.selected,
                    args.focused);
            }
        }