Exemplo n.º 1
0
        private void CellGUI(Rect cellRect, TreeViewItem item, int column, ref RowGUIArgs args)
        {
            ExecuteResultTreeItem resultItem    = item as ExecuteResultTreeItem;
            NodeExceptionItem     exceptionItem = item as NodeExceptionItem;

            ExecuteGraphResult r = null;
            NodeException      e = null;

            if (resultItem != null)
            {
                r = resultItem.Result;
            }
            else
            {
                r = exceptionItem.Result;
                e = exceptionItem.Exception;
            }

            switch (column)
            {
            case 0://Collapse/Expand
            {
                DefaultGUI.Label(cellRect, string.Empty, args.selected, args.focused);
            }
            break;

            case 1://Status
            {
                var rect = cellRect;
                if (e != null)
                {
                    rect.x += 8f;
                }
                DefaultGUI.Label(rect, (r.IsAnyIssueFound) ? "Fail" : "Success", args.selected, args.focused);
            }
            break;

            case 2://Graph
            {
                var graphName = Path.GetFileNameWithoutExtension(r.GraphAssetPath);
                DefaultGUI.Label(cellRect, graphName, args.selected, args.focused);
            }
            break;

            case 3://Platform
                DefaultGUI.Label(cellRect, BuildTargetUtility.TargetToHumaneString(r.Target), args.selected, args.focused);
                break;

            case 4://Description
                if (e != null)
                {
                    DefaultGUI.Label(cellRect, e.Reason, args.selected, args.focused);
                }
                else
                {
                    DefaultGUI.Label(cellRect, string.Empty, args.selected, args.focused);
                }
                break;
            }
        }
Exemplo n.º 2
0
        protected override TreeViewItem BuildRoot()
        {
            m_lastTimestamp = m_controller.LastBuildTimestamp;

            var root = new ExecuteResultTreeItem();

            foreach (var r in m_controller.CurrentResult)
            {
                var resultItem = new ExecuteResultTreeItem(r);
                root.AddChild(resultItem);

                if (r.IsAnyIssueFound)
                {
                    foreach (var e in r.Issues)
                    {
                        resultItem.AddChild(new NodeExceptionItem(r, e));
                    }
                }
            }

            return(root);
        }