当前位置: 首页>>代码示例>>C#>>正文


C# TreelistView.SetData方法代码示例

本文整理汇总了C#中TreelistView.SetData方法的典型用法代码示例。如果您正苦于以下问题:C# TreelistView.SetData方法的具体用法?C# TreelistView.SetData怎么用?C# TreelistView.SetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreelistView的用法示例。


在下文中一共展示了TreelistView.SetData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddDrawcall

        private TreelistView.Node AddDrawcall(TreelistView.Node existing, FetchDrawcall drawcall, TreelistView.Node root)
        {
            if (m_Core.Config.EventBrowser_HideEmpty)
            {
                if ((drawcall.children == null || drawcall.children.Length == 0) && (drawcall.flags & DrawcallFlags.PushMarker) != 0)
                    return null;
            }

            UInt32 eventNum = drawcall.eventID;
            double duration = drawcall.duration;
            TreelistView.Node drawNode = MakeNode(eventNum, drawcall.drawcallID, drawcall.name, duration);

            if (existing != null)
            {
                existing.SetData(drawNode.GetData());
                drawNode = existing;
            }
            else
            {
                root.Nodes.Add(drawNode);
            }

            DeferredEvent def = new DeferredEvent();
            def.frameID = m_Core.CurFrame;
            def.eventID = eventNum;

            if (drawcall.context != m_Core.FrameInfo[m_Core.CurFrame].immContextId)
            {
                def.defCtx = drawcall.context;
                def.lastDefEv = drawcall.eventID;

                FetchDrawcall parent = drawcall.parent;
                while(!parent.name.Contains("ExecuteCommand"))
                    parent = parent.parent;

                def.eventID = parent.eventID-1;

                def.firstDefEv = parent.children[0].eventID;
                if(parent.children[0].events.Length > 0)
                    def.firstDefEv = parent.children[0].events[0].eventID;
            }

            drawNode.Tag = def;

            if (drawcall.children != null && drawcall.children.Length > 0)
            {
                for (int i = 0; i < drawcall.children.Length; i++)
                {
                    TreelistView.Node d = drawNode.Nodes.Count > i ? drawNode.Nodes[i] : null;

                    AddDrawcall(d, drawcall.children[i], drawNode);

                    if (i > 0 && (drawcall.children[i-1].flags & DrawcallFlags.SetMarker) > 0)
                    {
                        drawNode.Nodes[drawNode.Nodes.Count - 2].Tag = drawNode.Nodes.LastNode.Tag;
                    }

                    if ((double)drawNode.Nodes[i]["Duration"] > 0.0)
                        drawNode["Duration"] = Math.Max(0.0, (double)drawNode["Duration"]) + (double)drawNode.Nodes[i]["Duration"];
                }

                drawNode.Tag = drawNode.Nodes.LastNode.Tag;
            }

            return drawNode;
        }
开发者ID:n1nj4n,项目名称:renderdoc,代码行数:66,代码来源:EventBrowser.cs


注:本文中的TreelistView.SetData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。