Smrf.NodeXL.Visualization.Wpf.EdgeDrawer.DrawStraightEdge C# (CSharp) Method

DrawStraightEdge() protected method

protected DrawStraightEdge ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext, System.Windows.Media.DrawingContext oDrawingContext, Point oEdgeEndpoint1, Point oEdgeEndpoint2, System.Boolean bDrawAsSelected, System.Boolean bDrawArrow, System.Windows.Media.Pen oPen, Color oColor, Double dWidth, VisibilityKeyValue eVisibility, String sLabel ) : void
oEdge IEdge
oGraphDrawingContext GraphDrawingContext
oDrawingContext System.Windows.Media.DrawingContext
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
bDrawAsSelected System.Boolean
bDrawArrow System.Boolean
oPen System.Windows.Media.Pen
oColor Color
dWidth Double
eVisibility VisibilityKeyValue
sLabel String
return void
    DrawStraightEdge
    (
        IEdge oEdge,
        GraphDrawingContext oGraphDrawingContext,
        DrawingContext oDrawingContext,
        Point oEdgeEndpoint1,
        Point oEdgeEndpoint2,
        Boolean bDrawAsSelected,
        Boolean bDrawArrow,
        Pen oPen,
        Color oColor,
        Double dWidth,
        VisibilityKeyValue eVisibility,
        String sLabel
    )
    {
        Debug.Assert(oEdge != null);
        Debug.Assert(oGraphDrawingContext != null);
        Debug.Assert(oDrawingContext != null);
        Debug.Assert(oPen != null);
        AssertValid();

        if (bDrawArrow)
        {
            // Draw the arrow and set the second endpoint to the center of the
            // flat end of the arrow.

            Double dArrowAngle = WpfGraphicsUtil.GetAngleBetweenPointsRadians(
                oEdgeEndpoint1, oEdgeEndpoint2);

            oEdgeEndpoint2 = DrawArrow(oDrawingContext, oEdgeEndpoint2,
                dArrowAngle, oColor, dWidth);
        }

        oDrawingContext.DrawLine(oPen, oEdgeEndpoint1, oEdgeEndpoint2);

        if ( !String.IsNullOrEmpty(sLabel) )
        {
            DrawLabel(oEdge, oDrawingContext, oGraphDrawingContext,
                bDrawAsSelected, oColor, eVisibility, oEdgeEndpoint1,
                oEdgeEndpoint2, null, new Point(), sLabel);
        }
    }