Beispiel #1
0
        /// <summary>
        /// Format edge event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void FormatEdge(Object sender, FormatEdgeEventArgs args)
        {
            NamedEdge e = (NamedEdge)args.Edge;

            args.EdgeFormatter.Label.Value = ((NamedEdge)args.Edge).Name;

            // setting the vertex name
            if (CurrentEdgePath != null)
            {
                if (CurrentEdgePath.Contains(e))
                {
                    args.EdgeFormatter.Label.Value = String.Format("{0} ({1})",
                                                                   e.Name,
                                                                   m_CurrentEdgePath.IndexOf(e)
                                                                   );
                    args.EdgeFormatter.Style           = GraphvizEdgeStyle.Bold;
                    args.EdgeFormatter.Label.FontColor = Color.DarkGreen;
                    args.EdgeFormatter.StrokeColor     = Color.DarkGreen;
                }
                else
                {
                    args.EdgeFormatter.Label.FontColor = Color.Gray;
                    args.EdgeFormatter.StrokeColor     = Color.Gray;
                    args.EdgeFormatter.Style           = GraphvizEdgeStyle.Unspecified;
                }
            }
        }