AddTweetDateRangeToNetworkDescription
    (
        XmlDocument graphMLXmlDocument,
        NetworkDescriber networkDescriber
    )
    {
        Debug.Assert(graphMLXmlDocument != null);
        Debug.Assert(networkDescriber != null);

        XmlNamespaceManager oXmlNamespaceManager = new XmlNamespaceManager(
            graphMLXmlDocument.NameTable);

        oXmlNamespaceManager.AddNamespace("g",
            GraphMLXmlDocument.GraphMLNamespaceUri);

        DateTime oMinimumRelationshipDateUtc = DateTime.MaxValue;
        DateTime oMaximumRelationshipDateUtc = DateTime.MinValue;

        // Loop through the graph's edges.

        foreach ( XmlNode oEdgeXmlNode in
            graphMLXmlDocument.DocumentElement.SelectNodes(
                "g:graph/g:edge", oXmlNamespaceManager) )
        {
            // Get the value of the edge's "relationship" GraphML-Attribute.

            String sRelationship;

            if ( !TryGetEdgeGraphMLAttributeValue(oEdgeXmlNode,
                NodeXLGraphMLUtil.EdgeRelationshipID, oXmlNamespaceManager,
                out sRelationship) )
            {
                continue;
            }

            switch (sRelationship)
            {
                case TwitterGraphMLUtil.RepliesToRelationship:
                case TwitterGraphMLUtil.MentionsRelationship:
                case TwitterGraphMLUtil.NonRepliesToNonMentionsRelationship:

                    // Get the value of the edge's "relationship date"
                    // GraphML-Attribute.

                    String sRelationshipDateUtc;

                    if ( !TryGetEdgeGraphMLAttributeValue(oEdgeXmlNode,
                        TwitterGraphMLUtil.EdgeRelationshipDateUtcID,
                        oXmlNamespaceManager, out sRelationshipDateUtc) )
                    {
                        break;
                    }

                    DateTime oRelationshipDateUtc;

                    try
                    {
                        // Note that the relationship date may be in an
                        // unrecognized format.

                        oRelationshipDateUtc =
                            DateTimeUtil2.FromCultureInvariantString(
                                sRelationshipDateUtc);
                    }
                    catch (FormatException)
                    {
                        break;
                    }

                    if (oRelationshipDateUtc < oMinimumRelationshipDateUtc)
                    {
                        oMinimumRelationshipDateUtc = oRelationshipDateUtc;
                    }

                    if (oRelationshipDateUtc > oMaximumRelationshipDateUtc)
                    {
                        oMaximumRelationshipDateUtc = oRelationshipDateUtc;
                    }

                    break;

                default:

                    break;
            }
        }

        if (oMinimumRelationshipDateUtc != DateTime.MaxValue)
        {
            networkDescriber.AddSentence(
                "The tweets in the network were tweeted over the {0} period"
                + " from {1} to {2}."
                ,
                networkDescriber.FormatDuration(oMinimumRelationshipDateUtc, 
                    oMaximumRelationshipDateUtc),

                networkDescriber.FormatEventTime(oMinimumRelationshipDateUtc),
                networkDescriber.FormatEventTime(oMaximumRelationshipDateUtc)
                );
        }
    }
        AddTweetDateRangeToNetworkDescription
        (
            XmlDocument graphMLXmlDocument,
            NetworkDescriber networkDescriber
        )
        {
            Debug.Assert(graphMLXmlDocument != null);
            Debug.Assert(networkDescriber != null);

            XmlNamespaceManager oXmlNamespaceManager = new XmlNamespaceManager(
                graphMLXmlDocument.NameTable);

            oXmlNamespaceManager.AddNamespace("g",
                                              GraphMLXmlDocument.GraphMLNamespaceUri);

            DateTime oMinimumRelationshipDateUtc = DateTime.MaxValue;
            DateTime oMaximumRelationshipDateUtc = DateTime.MinValue;

            // Loop through the graph's edges.

            foreach (XmlNode oEdgeXmlNode in
                     graphMLXmlDocument.DocumentElement.SelectNodes(
                         "g:graph/g:edge", oXmlNamespaceManager))
            {
                // Get the value of the edge's "relationship" GraphML-Attribute.

                String sRelationship;

                if (!TryGetEdgeGraphMLAttributeValue(oEdgeXmlNode,
                                                     NodeXLGraphMLUtil.EdgeRelationshipID, oXmlNamespaceManager,
                                                     out sRelationship))
                {
                    continue;
                }

                switch (sRelationship)
                {
                case TwitterGraphMLUtil.RepliesToRelationship:
                case TwitterGraphMLUtil.MentionsRelationship:
                case TwitterGraphMLUtil.NonRepliesToNonMentionsRelationship:

                    // Get the value of the edge's "relationship date"
                    // GraphML-Attribute.

                    String sRelationshipDateUtc;

                    if (!TryGetEdgeGraphMLAttributeValue(oEdgeXmlNode,
                                                         TwitterGraphMLUtil.EdgeRelationshipDateUtcID,
                                                         oXmlNamespaceManager, out sRelationshipDateUtc))
                    {
                        break;
                    }

                    DateTime oRelationshipDateUtc;

                    try
                    {
                        // Note that the relationship date may be in an
                        // unrecognized format.

                        oRelationshipDateUtc =
                            DateTimeUtil2.FromCultureInvariantString(
                                sRelationshipDateUtc);
                    }
                    catch (FormatException)
                    {
                        break;
                    }

                    if (oRelationshipDateUtc < oMinimumRelationshipDateUtc)
                    {
                        oMinimumRelationshipDateUtc = oRelationshipDateUtc;
                    }

                    if (oRelationshipDateUtc > oMaximumRelationshipDateUtc)
                    {
                        oMaximumRelationshipDateUtc = oRelationshipDateUtc;
                    }

                    break;

                default:

                    break;
                }
            }

            if (oMinimumRelationshipDateUtc != DateTime.MaxValue)
            {
                networkDescriber.AddSentence(
                    "The tweets in the network were tweeted over the {0} period"
                    + " from {1} to {2}."
                    ,
                    networkDescriber.FormatDuration(oMinimumRelationshipDateUtc,
                                                    oMaximumRelationshipDateUtc),

                    networkDescriber.FormatEventTime(oMinimumRelationshipDateUtc),
                    networkDescriber.FormatEventTime(oMaximumRelationshipDateUtc)
                    );
            }
        }