コード例 #1
0
        OnGetNetworkException
        (
            DateTime oStartTime,
            Exception oException,
            String sNetworkConfigurationFilePath,
            String sNetworkFileFolderPath,
            HttpNetworkAnalyzerBase oHttpNetworkAnalyzerBase
        )
        {
            Debug.Assert(oException != null);
            Debug.Assert(!String.IsNullOrEmpty(sNetworkConfigurationFilePath));
            Debug.Assert(!String.IsNullOrEmpty(sNetworkFileFolderPath));
            Debug.Assert(oHttpNetworkAnalyzerBase != null);

            if (oException is PartialNetworkException)
            {
                return(OnGetNetworkPartialNetworkException(
                           oStartTime, (PartialNetworkException)oException,
                           sNetworkConfigurationFilePath, sNetworkFileFolderPath,
                           oHttpNetworkAnalyzerBase));
            }
            else
            {
                // (This call exits the program.)

                OnGetNetworkOtherException(oStartTime, oException,
                                           sNetworkConfigurationFilePath, sNetworkFileFolderPath,
                                           oHttpNetworkAnalyzerBase);

                // Make the compiler happy.

                return(null);
            }
        }
コード例 #2
0
        //*************************************************************************
        //  Constructor: FlickrGraphDataProviderDialogBase()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="FlickrGraphDataProviderDialogBase" /> class.
        /// </summary>
        //*************************************************************************
        public FlickrGraphDataProviderDialogBase(
            HttpNetworkAnalyzerBase httpNetworkAnalyzer
            )
            : base(httpNetworkAnalyzer)
        {
            // m_sApiKey

            AssertValid();
        }
コード例 #3
0
        //*************************************************************************
        //  Constructor: TwitterGraphDataProviderDialogBase()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="TwitterGraphDataProviderDialogBase" /> class.
        /// </summary>
        ///
        /// <param name="httpNetworkAnalyzer">
        /// Object that does most of the work.
        /// </param>
        //*************************************************************************
        public TwitterGraphDataProviderDialogBase(
            HttpNetworkAnalyzerBase httpNetworkAnalyzer
            )
            : base(httpNetworkAnalyzer)
        {
            m_oTwitterAuthorizationManager = null;

            // AssertValid();
        }
    //*************************************************************************
    //  Constructor: YouTubeGraphDataProviderDialogBase()
    //
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="YouTubeGraphDataProviderDialogBase" /> class.
    /// </summary>
    ///
    /// <param name="httpNetworkAnalyzer">
    /// Object that does most of the work.
    /// </param>
    //*************************************************************************

    public YouTubeGraphDataProviderDialogBase
    (
        HttpNetworkAnalyzerBase httpNetworkAnalyzer
    )
    : base (httpNetworkAnalyzer)
    {
        // (Do nothing else.)

        AssertValid();
    }
コード例 #5
0
        //*************************************************************************
        //  Constructor: TwitterGraphDataProviderDialogBase()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="TwitterGraphDataProviderDialogBase" /> class.
        /// </summary>
        ///
        /// <param name="httpNetworkAnalyzer">
        /// Object that does most of the work.
        /// </param>
        //*************************************************************************

        public TwitterGraphDataProviderDialogBase
        (
            HttpNetworkAnalyzerBase httpNetworkAnalyzer
        )
            : base(httpNetworkAnalyzer)
        {
            m_oTwitterAuthorizationManager = null;

            // AssertValid();
        }
コード例 #6
0
        //*************************************************************************
        //  Constructor: YouTubeGraphDataProviderDialogBase()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="YouTubeGraphDataProviderDialogBase" /> class.
        /// </summary>
        ///
        /// <param name="httpNetworkAnalyzer">
        /// Object that does most of the work.
        /// </param>
        //*************************************************************************

        public YouTubeGraphDataProviderDialogBase
        (
            HttpNetworkAnalyzerBase httpNetworkAnalyzer
        )
            : base(httpNetworkAnalyzer)
        {
            // (Do nothing else.)

            AssertValid();
        }
コード例 #7
0
        //*************************************************************************
        //  Constructor: FlickrGraphDataProviderDialogBase()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="FlickrGraphDataProviderDialogBase" /> class.
        /// </summary>
        //*************************************************************************

        public FlickrGraphDataProviderDialogBase
        (
            HttpNetworkAnalyzerBase httpNetworkAnalyzer
        )
            : base(httpNetworkAnalyzer)
        {
            // m_sApiKey

            AssertValid();
        }
        //*************************************************************************
        //  Constructor: FacebookGraphDataProviderDialogBase()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="FacebookGraphDataProviderDialogBase" /> class.
        /// </summary>
        //*************************************************************************

        public FacebookGraphDataProviderDialogBase
        (
            HttpNetworkAnalyzerBase httpNetworkAnalyzer
        )
            : base(httpNetworkAnalyzer)
        {
            

            AssertValid();
        }
コード例 #9
0
        SubscribeToProgressChangedEvent
        (
            HttpNetworkAnalyzerBase oHttpNetworkAnalyzerBase
        )
        {
            Debug.Assert(oHttpNetworkAnalyzerBase != null);

            oHttpNetworkAnalyzerBase.ProgressChanged +=
                new ProgressChangedEventHandler(
                    HttpNetworkAnalyzer_ProgressChanged);
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: yesbb12/NetMap
        OnGetNetworkPartialNetworkException
        (
            DateTime oStartTime,
            PartialNetworkException oPartialNetworkException,
            String sNetworkConfigurationFilePath,
            String sNetworkFileFolderPath,
            HttpNetworkAnalyzerBase oHttpNetworkAnalyzerBase
        )
        {
            Debug.Assert(oPartialNetworkException != null);
            Debug.Assert(!String.IsNullOrEmpty(sNetworkConfigurationFilePath));
            Debug.Assert(!String.IsNullOrEmpty(sNetworkFileFolderPath));
            Debug.Assert(oHttpNetworkAnalyzerBase != null);

            // Write a text file to let the user know that a partial network was
            // obtained.
            //
            // Sample file path:
            //
            // C:\PartialNetwork_NetworkConfiguration_2010-06-01_02-00-00.txt

            String sFilePath = FileUtil.GetOutputFilePath(oStartTime,
                                                          sNetworkConfigurationFilePath, sNetworkFileFolderPath,
                                                          "PartialNetworkInfo_", "txt");

            using (StreamWriter oStreamWriter = new StreamWriter(sFilePath))
            {
                Debug.Assert(oHttpNetworkAnalyzerBase != null);

                oStreamWriter.WriteLine(oPartialNetworkException.ToMessage(
                                            oHttpNetworkAnalyzerBase.ExceptionToMessage(
                                                oPartialNetworkException.RequestStatistics.
                                                LastUnexpectedException)
                                            ));
            }

            return(oPartialNetworkException.PartialNetwork);
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: yesbb12/NetMap
        OnGetNetworkOtherException
        (
            DateTime oStartTime,
            Exception oException,
            String sNetworkConfigurationFilePath,
            String sNetworkFileFolderPath,
            HttpNetworkAnalyzerBase oHttpNetworkAnalyzerBase
        )
        {
            Debug.Assert(oException != null);
            Debug.Assert(!String.IsNullOrEmpty(sNetworkConfigurationFilePath));
            Debug.Assert(!String.IsNullOrEmpty(sNetworkFileFolderPath));
            Debug.Assert(oHttpNetworkAnalyzerBase != null);

            // Sample error file path:
            //
            // C:\Error_NetworkConfiguration_2010-06-01_02-00-00.txt

            String sErrorFilePath = FileUtil.GetOutputFilePath(oStartTime,
                                                               sNetworkConfigurationFilePath, sNetworkFileFolderPath,
                                                               "Error_", "txt");

            String sErrorMessage =
                "The network couldn't be obtained.  Details:"
                + "\r\n\r\n"
                + oHttpNetworkAnalyzerBase.ExceptionToMessage(oException)
            ;

            using (StreamWriter oStreamWriter = new StreamWriter(sErrorFilePath))
            {
                Debug.Assert(oHttpNetworkAnalyzerBase != null);

                oStreamWriter.WriteLine(sErrorMessage);
            }

            Exit(ExitCode.CouldNotGetNetwork, sErrorMessage);
        }