• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CLRProfiler.Vertex类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CLRProfiler.Vertex的典型用法代码示例。如果您正苦于以下问题:C# Vertex类的具体用法?C# Vertex怎么用?C# Vertex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Vertex类属于CLRProfiler命名空间,在下文中一共展示了Vertex类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Graph

 internal Graph(object graphSource)
 {
     this.graphSource = graphSource;
     vertices = new Dictionary<string, Vertex>();
     topVertex = FindOrCreateVertex("<root>", null, null);
     bottomVertex = FindOrCreateVertex("<bottom>", null, null);
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:7,代码来源:Graph.cs


示例2: BuildAllocationTrace

        internal void BuildAllocationTrace(Graph graph, int stackTraceIndex, int typeIndex, ulong size, Vertex[] typeVertex, Vertex[] funcVertex, ref Vertex[] vertexStack, FilterForm filterForm)
        {
            int stackPtr = BuildVertexStack(stackTraceIndex, funcVertex, ref vertexStack, 2);

            Vertex toVertex = graph.TopVertex;
            Vertex fromVertex;
            Edge edge;
            if ((typeVertex[typeIndex].interestLevel & InterestLevel.Interesting) == InterestLevel.Interesting
                && ReadNewLog.InterestingCallStack(vertexStack, stackPtr, filterForm))
            {
                vertexStack[stackPtr] = typeVertex[typeIndex];
                stackPtr++;
                stackPtr = ReadNewLog.FilterVertices(vertexStack, stackPtr);
                stackPtr = Vertex.SqueezeOutRepetitions(vertexStack, stackPtr);
                for (int i = 0; i < stackPtr; i++)
                {
                    fromVertex = toVertex;
                    toVertex = vertexStack[i];
                    edge = graph.FindOrCreateEdge(fromVertex, toVertex);
                    edge.AddWeight(size);
                }
                fromVertex = toVertex;
                toVertex = graph.BottomVertex;
                edge = graph.FindOrCreateEdge(fromVertex, toVertex);
                edge.AddWeight(size);
            }
        }
开发者ID:engincancan,项目名称:utilities,代码行数:27,代码来源:ReadNewLog.cs


示例3: FindOrCreateVertex

 internal Vertex FindOrCreateVertex(string name, string signature, string module)
 {
     string nameSignatureModule = NameSignatureModule(name, signature, module);
     Vertex vertex;
     if (!vertices.TryGetValue(nameSignatureModule, out vertex))
     {
         vertex = new Vertex(name, signature, module, this);
         vertices[nameSignatureModule] = vertex;
     }
     return vertex;
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:11,代码来源:Graph.cs


示例4: SelectedVertexCount

		public int SelectedVertexCount(out Vertex selectedVertex)
		{
			int selectedCount = 0;
			selectedVertex = null;
			foreach (Vertex v in graph.vertices.Values)
			{
				if (v.selected)
				{
					selectedCount++;
					selectedVertex = v;
				}
			}
			return selectedCount;
		}
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:14,代码来源:GraphBase.cs


示例5: BuildVertexStack

        internal int BuildVertexStack(int stackTraceIndex, Vertex[] funcVertex, ref Vertex[] vertexStack, int skipCount)
        {
            int[] stackTrace = readNewLog.stacktraceTable.IndexToStacktrace(stackTraceIndex);
                
            while (vertexStack.Length < stackTrace.Length + 3)
            {
                vertexStack = new Vertex[vertexStack.Length*2];
            }

            for (int i = skipCount; i < stackTrace.Length; i++)
            {
                vertexStack[i-skipCount] = funcVertex[stackTrace[i]];
            }

            return stackTrace.Length - skipCount;
        }
开发者ID:engincancan,项目名称:utilities,代码行数:16,代码来源:ReadNewLog.cs


示例6: EnsureVertexCapacity

 static void EnsureVertexCapacity(int id, ref Vertex[] vertexArray)
 {
     Debug.Assert(id >= 0);
     if (id < vertexArray.Length)
         return;
     int newLength = vertexArray.Length*2;
     if (newLength <= id)
         newLength = id + 1;
     Vertex[] newVertexArray = new Vertex[newLength];
     Array.Copy(vertexArray, 0, newVertexArray, 0, vertexArray.Length);
     vertexArray = newVertexArray;
 }
开发者ID:engincancan,项目名称:utilities,代码行数:12,代码来源:ReadNewLog.cs


示例7: AddTypeVertex

 internal void AddTypeVertex(int typeId, string typeName, Graph graph, ref Vertex[] typeVertex, FilterForm filterForm)
 {
     EnsureVertexCapacity(typeId, ref typeVertex);
     typeVertex[typeId] = graph.FindOrCreateVertex(typeName, null, null);
     typeVertex[typeId].interestLevel = filterForm.InterestLevelOfTypeName(typeName, null, finalizableTypes.ContainsKey(typeId));
 }
开发者ID:engincancan,项目名称:utilities,代码行数:6,代码来源:ReadNewLog.cs


示例8: Score

 private double Score(Vertex v)
 {
     return v.weight*(Diversity(v.incomingEdges) + Diversity(v.outgoingEdges));
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:4,代码来源:GraphViewForm.cs


示例9: BuildTypeVertices

 internal void BuildTypeVertices(Graph graph, ref Vertex[] typeVertex, FilterForm filterForm)
 {
     for (int i = 0; i < readNewLog.typeName.Length; i++)
     {
         string typeName = readNewLog.typeName[i];
         if (typeName == null)
             typeName = string.Format("???? type {0}", i);
         readNewLog.AddTypeVertex(i, typeName, graph, ref typeVertex, filterForm);
     }
 }
开发者ID:engincancan,项目名称:utilities,代码行数:10,代码来源:ReadNewLog.cs


示例10: FilterVertices

        internal static int FilterVertices(Vertex[] vertexStack, int stackPtr)
        {
            bool display = false;
            for (int i = 0; i < stackPtr; i++)
            {
                Vertex vertex = vertexStack[i];
                switch (vertex.interestLevel & InterestLevel.InterestingChildren)
                {
                    case    InterestLevel.Ignore:
                        if (display)
                            vertex.interestLevel |= InterestLevel.Display;
                        break;

                    case    InterestLevel.InterestingChildren:
                        display = true;
                        break;

                    default:
                        display = false;
                        break;
                }
            }
            display = false;
            for (int i = stackPtr-1; i >= 0; i--)
            {
                Vertex vertex = vertexStack[i];
                switch (vertex.interestLevel & InterestLevel.InterestingParents)
                {
                    case    InterestLevel.Ignore:
                        if (display)
                            vertex.interestLevel |= InterestLevel.Display;
                        break;

                    case    InterestLevel.InterestingParents:
                        display = true;
                        break;

                    default:
                        display = false;
                        break;
                }
            }
            int newStackPtr = 0;
            for (int i = 0; i < stackPtr; i++)
            {
                Vertex vertex = vertexStack[i];
                if ((vertex.interestLevel & (InterestLevel.Display|InterestLevel.Interesting)) != InterestLevel.Ignore)
                {
                    vertexStack[newStackPtr++] = vertex;
                    vertex.interestLevel &= ~InterestLevel.Display;
                }
            }
            return newStackPtr;
        }
开发者ID:engincancan,项目名称:utilities,代码行数:54,代码来源:ReadNewLog.cs


示例11: BuildHandleAllocationGraph

        internal Graph BuildHandleAllocationGraph(FilterForm filterForm)
        {
            Vertex[] funcVertex = new Vertex[1];
            Vertex[] vertexStack = new Vertex[1];

            Graph graph = new Graph(this);
            graph.graphType = Graph.GraphType.HandleAllocationGraph;

            BuildFuncVertices(graph, ref funcVertex, filterForm);

            for (int i = 0; i < typeSizeStacktraceToCount.Length; i++)
            {
                if (typeSizeStacktraceToCount[i] > 0)
                {
                    int[] stacktrace = readNewLog.stacktraceTable.IndexToStacktrace(i);

                    uint count = (uint)typeSizeStacktraceToCount[i];

                    BuildHandleAllocationTrace(graph, i, count, funcVertex, ref vertexStack, filterForm);
                }
            }

            foreach (Vertex v in graph.vertices.Values)
                v.active = true;
            graph.BottomVertex.active = false;

            return graph;
        }
开发者ID:engincancan,项目名称:utilities,代码行数:28,代码来源:ReadNewLog.cs


示例12: BuildModVertices

 void BuildModVertices(Graph graph, ref Vertex[] modVertex, FilterForm filterForm)
 {
     for (int i = 0; i < readNewLog.modBasicName.Length; i++)
     {
         string basicName = readNewLog.modBasicName[i];
         string fullName = readNewLog.modFullName[i];
         if (basicName != null && fullName != null)
         {
             readNewLog.AddFunctionVertex(i, basicName, fullName, graph, ref modVertex, filterForm);
             modVertex[i].basicName = basicName;
             modVertex[i].basicSignature = fullName;
         }
     }
 }
开发者ID:engincancan,项目名称:utilities,代码行数:14,代码来源:ReadNewLog.cs


示例13: BuildFuncVertices

 internal void BuildFuncVertices(Graph graph, ref Vertex[] funcVertex, FilterForm filterForm)
 {
     for (int i = 0; i < readNewLog.funcName.Length; i++)
     {
         string name = readNewLog.funcName[i];
         string signature = readNewLog.funcSignature[i];
         if (name == null)
             name = string.Format("???? function {0}", i);
         if (signature == null)
             signature = "( ???????? )";
         readNewLog.AddFunctionVertex(i, name, signature, graph, ref funcVertex, filterForm);
     }
 }
开发者ID:engincancan,项目名称:utilities,代码行数:13,代码来源:ReadNewLog.cs


示例14: BuildCallTrace

        internal void BuildCallTrace(Graph graph, int stackTraceIndex, Vertex[] funcVertex, ref Vertex[] vertexStack, int count, FilterForm filterForm)
        {
            int stackPtr = BuildVertexStack(stackTraceIndex, funcVertex, ref vertexStack, 0);

            Vertex toVertex = graph.TopVertex;
            Vertex fromVertex;
            Edge edge;
            if (ReadNewLog.InterestingCallStack(vertexStack, stackPtr, filterForm))
            {
                stackPtr = ReadNewLog.FilterVertices(vertexStack, stackPtr);
                stackPtr = Vertex.SqueezeOutRepetitions(vertexStack, stackPtr);
                for (int i = 0; i < stackPtr; i++)
                {
                    fromVertex = toVertex;
                    toVertex = vertexStack[i];
                    edge = graph.FindOrCreateEdge(fromVertex, toVertex);
                    edge.AddWeight((uint)count);
                }
            }
        }
开发者ID:engincancan,项目名称:utilities,代码行数:20,代码来源:ReadNewLog.cs


示例15: PaintVertex

        void PaintVertex(Vertex v, Graphics g, Brush penBrush, Pen pen)
        {
            Rectangle r = v.rectangle;
            v.selectionRectangle = r;
            g.DrawRectangle(pen, r);
            if (v.selected)
            {
                using (SolidBrush selectBrush = new SolidBrush(Color.Aqua))
                    g.FillRectangle(selectBrush, r);
            }

            RectangleF stringRect;
            int lineCount = 2;
            if (v.signature != null)
                lineCount = 3;
            if (r.Height > fontHeight*lineCount)
                stringRect = new RectangleF(r.X,r.Y,r.Width,fontHeight);
            else
            {
                stringRect = new RectangleF(r.X,r.Y+r.Height+3,r.Width,fontHeight);
                // for these very narrow rectangle, start the selection rectangle 5 pixels above
                // the actual rectangle, so people can hit it more easily. Even though they could click
                // on the text below, which not everybody tries...
                const int vTolerance = 5;
                v.selectionRectangle = new Rectangle(r.X, r.Y - vTolerance, r.Width, vTolerance + r.Height + 3 + fontHeight*lineCount);
            }

            if (v.weightHistory != null)
            {
                int alpha = 200;
                int previousHeight = r.Height;
                for (int i = 0; i < v.weightHistory.Length; i++)
                {
                    alpha = alpha*2/3;
                    ulong weight = v.weightHistory[i];
                    int height = (int)((float)r.Height/v.weight*weight);
                    if (height < previousHeight)
                    {
                        Color color = Color.FromArgb(alpha, Color.Red);
                        using (Brush brush = new SolidBrush(color))
                        {
                            g.FillRectangle(brush, r.X, r.Y+height, r.Width, previousHeight - height);
                        }
                    }
                    else
                    {
                        Color color = Color.FromArgb(alpha, Color.Green);
                        using (Brush brush = new SolidBrush(color))
                        {
                            g.FillRectangle(brush, r.X, r.Y+previousHeight, r.Width, height - previousHeight);
                        }
                    }
                    previousHeight = height;
                }
            }

            g.DrawString(v.basicName, font, penBrush, stringRect);
            stringRect.Y += fontHeight;
            if (v.signature != null)
            {
                g.DrawString(v.basicSignature, font, penBrush, stringRect);
                stringRect.Y += fontHeight;
                int width = (int)g.MeasureString(v.basicSignature, font).Width;
                if (stringRect.Width < width)
                    v.signatureCurtated = true;
            }

            g.DrawString(v.weightString, font, penBrush, stringRect);
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:69,代码来源:GraphViewForm.cs


示例16: ZoomVertex

 private void ZoomVertex(Vertex v, string titlePrefix)
 {
     toolTip.Active = false;
     Graph g;
     if (graph.graphSource is Graph)
     {
         Graph orgGraph = (Graph)graph.graphSource;
         g = new Graph(orgGraph);
         v = orgGraph.FindOrCreateVertex(v.name, v.signature, v.moduleName);
     }
     else
         g = new Graph(graph);
     g.allocatedAfterTickIndex = graph.allocatedAfterTickIndex;
     g.allocatedBeforeTickIndex = graph.allocatedBeforeTickIndex;
     Vertex vn = CloneVertex(g, v);
     vn.count = v.count;
     if (v.incomingEdges.Count == 0)
     {
         if (v != graph.TopVertex)
             g.FindOrCreateEdge(g.TopVertex, vn).AddWeight(v.weight);
     }
     else
     {
         foreach (Edge e in v.incomingEdges.Values)
         {
             Vertex vin = CloneVertex(g, e.FromVertex);
             g.FindOrCreateEdge(vin, vn).AddWeight(e.weight);
             if (vin != g.TopVertex)
                 g.FindOrCreateEdge(g.TopVertex, vin).AddWeight(e.weight);
         }
     }
     if (v.outgoingEdges.Count == 0)
     {
         if (v != graph.BottomVertex)
             g.FindOrCreateEdge(vn, g.BottomVertex).AddWeight(v.weight);
     }
     else
     {
         foreach (Edge e in v.outgoingEdges.Values)
         {
             Vertex von = CloneVertex(g, e.ToVertex);
             g.FindOrCreateEdge(vn, von).AddWeight(e.weight);
             if (von != g.BottomVertex)
                 g.FindOrCreateEdge(von, g.BottomVertex).AddWeight(e.weight);
         }
     }
     g.BottomVertex.active = false;
     g.graphType = graph.graphType;
     g.typeGraphOptions = graph.typeGraphOptions;
     if (titlePrefix == null)
         titlePrefix = "Zoom to: ";
     string title = titlePrefix + v.name + " " + (v.signature != null? v.signature : "");
     GraphViewForm graphViewForm = new GraphViewForm(g, title);
     graphViewForm.Visible = true;
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:55,代码来源:GraphViewForm.cs


示例17: CloneVertex

 private Vertex CloneVertex(Graph g, Vertex v)
 {
     Vertex vn = g.FindOrCreateVertex(v.name, v.signature, v.moduleName);
     vn.basicName = v.basicName;
     vn.basicSignature = v.basicSignature;
     vn.active = true;
     return vn;
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:8,代码来源:GraphViewForm.cs


示例18: AddFunctionVertex

 internal void AddFunctionVertex(int funcId, string functionName, string signature, Graph graph, ref Vertex[] funcVertex, FilterForm filterForm)
 {
     EnsureVertexCapacity(funcId, ref funcVertex);
     int moduleId = funcModule[funcId];
     string moduleName = null;
     if (moduleId >= 0)
         moduleName = modBasicName[moduleId];
     funcVertex[funcId] = graph.FindOrCreateVertex(functionName, signature, moduleName);
     funcVertex[funcId].interestLevel = filterForm.InterestLevelOfMethodName(functionName, signature);
 }
开发者ID:engincancan,项目名称:utilities,代码行数:10,代码来源:ReadNewLog.cs


示例19: BuildHandleAllocationTrace

        internal void BuildHandleAllocationTrace(Graph graph, int stackTraceIndex, uint count, Vertex[] funcVertex, ref Vertex[] vertexStack, FilterForm filterForm)
        {
            int stackPtr = BuildVertexStack(stackTraceIndex, funcVertex, ref vertexStack, 0);

            Vertex handleVertex = graph.FindOrCreateVertex("Handle", null, null);
            handleVertex.interestLevel = InterestLevel.Interesting;

            Vertex toVertex = graph.TopVertex;
            Vertex fromVertex;
            Edge edge;
            if (ReadNewLog.InterestingCallStack(vertexStack, stackPtr, filterForm))
            {
                vertexStack[stackPtr] = handleVertex;
                stackPtr++;
                stackPtr = ReadNewLog.FilterVertices(vertexStack, stackPtr);
                stackPtr = Vertex.SqueezeOutRepetitions(vertexStack, stackPtr);
                for (int i = 0; i < stackPtr; i++)
                {
                    fromVertex = toVertex;
                    toVertex = vertexStack[i];
                    edge = graph.FindOrCreateEdge(fromVertex, toVertex);
                    edge.AddWeight(count);
                }
                fromVertex = toVertex;
                toVertex = graph.BottomVertex;
                edge = graph.FindOrCreateEdge(fromVertex, toVertex);
                edge.AddWeight(count);
            }
        }
开发者ID:engincancan,项目名称:utilities,代码行数:29,代码来源:ReadNewLog.cs


示例20: BuildAssemblyVertices

 internal int BuildAssemblyVertices(Graph graph, ref Vertex[] typeVertex, FilterForm filterForm)
 {
     int count = 0;
     foreach(string c in readNewLog.assemblies.Keys)
     {
         readNewLog.AddTypeVertex(count++, c, graph, ref typeVertex, filterForm);
     }
     return count;
 }
开发者ID:engincancan,项目名称:utilities,代码行数:9,代码来源:ReadNewLog.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CMModel.DBManager类代码示例发布时间:2022-05-24
下一篇:
C# CLFramework.PacketWriter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap