コード例 #1
0
    protected override IList <TreeViewItem> BuildRows(TreeViewItem root)
    {
        _treeViewItems.Clear();

        bool   inSearch    = !string.IsNullOrEmpty(searchString);
        string matchStr    = inSearch ? searchString.ToLower() : "";
        var    showingList = AdvancedConsole.Instance._showingEntries;

        for (var i = 0; i < showingList.Count; i++)
        {
            var logEntry = showingList[i];

            bool visible = true;
            if (inSearch)
            {
                visible = logEntry.Output.ToLower().Contains(matchStr);
            }

            if (visible)
            {
                ConsoleLogTreeItem item = new ConsoleLogTreeItem(logEntry.IntId, 0, logEntry);
                item.icon = logEntry.Icon;
                _treeViewItems.Add(item);
            }
        }

        // We still need to setup the child parent information for the rows since this
        // information is used by the TreeView internal logic (navigation, dragging etc)
        SetupParentsAndChildrenFromDepths(root, _treeViewItems);

        return(_treeViewItems);
    }
コード例 #2
0
    public void AddLogData(LogEntry entry)
    {
        ConsoleLogTreeItem item = new ConsoleLogTreeItem(entry.IntId, 0, entry);

        item.icon = entry.Icon;
        _rootTreeItem.AddChild(item);
    }