Smrf.NodeXL.ExcelTemplate.CollapsedGroupAttributeAdder.AddEdgeWidthAttributesToDConnectorMotif C# (CSharp) Method

AddEdgeWidthAttributesToDConnectorMotif() private static method

private static AddEdgeWidthAttributesToDConnectorMotif ( ExcelTemplateGroupInfo oGroup, System.Boolean bEdgeWidthColumnAutoFilled, AutoFillNumericRangeColumnResults oEdgeWidthResults, NumericRangeColumnAutoFillUserSettings oEdgeWidthDetails, Object>.Dictionary oEdgeWidthSourceDictionary, ReadWorkbookContext oReadWorkbookContext, CollapsedGroupAttributes oCollapsedGroupAttributes, Int32 iAnchorVertices ) : void
oGroup ExcelTemplateGroupInfo
bEdgeWidthColumnAutoFilled System.Boolean
oEdgeWidthResults AutoFillNumericRangeColumnResults
oEdgeWidthDetails NumericRangeColumnAutoFillUserSettings
oEdgeWidthSourceDictionary Object>.Dictionary
oReadWorkbookContext ReadWorkbookContext
oCollapsedGroupAttributes Smrf.NodeXL.Core.CollapsedGroupAttributes
iAnchorVertices System.Int32
return void
    AddEdgeWidthAttributesToDConnectorMotif
    (
        ExcelTemplateGroupInfo oGroup,
        Boolean bEdgeWidthColumnAutoFilled,
        AutoFillNumericRangeColumnResults oEdgeWidthResults,
        NumericRangeColumnAutoFillUserSettings oEdgeWidthDetails,
        Dictionary<Int32, Object> oEdgeWidthSourceDictionary,
        ReadWorkbookContext oReadWorkbookContext,
        CollapsedGroupAttributes oCollapsedGroupAttributes,
        Int32 iAnchorVertices
    )
    {
        Debug.Assert(oGroup != null);
        Debug.Assert(oEdgeWidthResults != null);
        Debug.Assert(oReadWorkbookContext != null);
        Debug.Assert(oCollapsedGroupAttributes != null);
        Debug.Assert(iAnchorVertices >= 0);

        // If the edge width column was autofilled, get the average width for
        // the edges incident to the two-connector motif's first anchor, then
        // its second anchor.  Otherwise, don't do anything.

        if (!bEdgeWidthColumnAutoFilled)
        {
            return;
        }

        for (Int32 iAnchorVertexIndex = 0;
            iAnchorVertexIndex < iAnchorVertices;
            iAnchorVertexIndex++)
        {
            Double dAverageEdgeWidth;

            if ( TableColumnMapper.TryMapAverageNumber(

                    GetRowIDsToAverageForEdges(oGroup,
                        oCollapsedGroupAttributes, iAnchorVertexIndex),

                    oEdgeWidthSourceDictionary,
                    oEdgeWidthResults.SourceCalculationNumber1,
                    oEdgeWidthResults.SourceCalculationNumber2,
                    oEdgeWidthResults.DestinationNumber1,
                    oEdgeWidthResults.DestinationNumber2,
                    oEdgeWidthDetails.UseLogs,
                    out dAverageEdgeWidth
                    )
                )
            {
                oCollapsedGroupAttributes.Add(

                    CollapsedGroupAttributeKeys.GetAnchorVertexEdgeWidthKey(
                        iAnchorVertexIndex),

                    dAverageEdgeWidth
                    );
            }
        }
    }