Smrf.NodeXL.ExcelTemplate.ReciprocatedVertexPairRatioCalculator2.CreateGraphMetricColumn C# (CSharp) Method

CreateGraphMetricColumn() protected method

protected CreateGraphMetricColumn ( IGraph oGraph, Dictionary oReciprocatedVertexPairRatios ) : GraphMetricColumn
oGraph IGraph
oReciprocatedVertexPairRatios Dictionary
return GraphMetricColumn
    CreateGraphMetricColumn
    (
        IGraph oGraph,
        Dictionary< Int32, Nullable<Double> > oReciprocatedVertexPairRatios
    )
    {
        Debug.Assert(oGraph != null);
        AssertValid();

        List<GraphMetricValueWithID> oReciprocatedVertexPairRatioValues =
            new List<GraphMetricValueWithID>();

        foreach (IVertex oVertex in oGraph.Vertices)
        {
            // Try to get the row ID stored in the worksheet.

            Int32 iRowID;

            if ( TryGetRowID(oVertex, out iRowID) )
            {
                oReciprocatedVertexPairRatioValues.Add(

                    new GraphMetricValueWithID(iRowID, 
                        NullableToGraphMetricValue(
                            oReciprocatedVertexPairRatios[oVertex.ID] )
                        ) );
            }
        }

        return ( new GraphMetricColumnWithID( WorksheetNames.Vertices,
            TableNames.Vertices,
            VertexTableColumnNames.ReciprocatedVertexPairRatio,
            ExcelTableUtil.AutoColumnWidth, null,
            CellStyleNames.GraphMetricGood,
            oReciprocatedVertexPairRatioValues.ToArray()
            ) );
    }