Analyzer.GroupMetricCalculator.TryCalculateGraphMetricsForOneGroup C# (CSharp) Method

TryCalculateGraphMetricsForOneGroup() protected method

protected TryCalculateGraphMetricsForOneGroup ( GroupInfo oGroupInfo, OverallMetrics &oOverallMetrics ) : System.Boolean
oGroupInfo Smrf.NodeXL.Core.GroupInfo
oOverallMetrics OverallMetrics
return System.Boolean
    protected Boolean TryCalculateGraphMetricsForOneGroup
        (GroupInfo oGroupInfo, out OverallMetrics oOverallMetrics)
    {
        Debug.Assert(oGroupInfo != null);
        Debug.Assert(oGroupInfo.Vertices != null);
        Debug.Assert(oGroupInfo.Vertices.Count > 0);
        
        

        oOverallMetrics = null;

        ICollection<IVertex> oVertices = oGroupInfo.Vertices;

        // Create a new graph from the vertices in the group and the edges that
        // connect them.

        IGraph oNewGraph = SubgraphCalculator.GetSubgraphAsNewGraph(oVertices);

        // Calculate the overall metrics for the new graph using the
        // OverallMetricCalculator class in the Algorithms namespace, which
        // knows nothing about Excel.

        return ( (new OverallMetricCalculator() ).
            TryCalculateGraphMetrics(oNewGraph,
                null,
                out oOverallMetrics) );
    }