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); } }
//************************************************************************* // Constructor: FlickrGraphDataProviderDialogBase() // /// <summary> /// Initializes a new instance of the <see /// cref="FlickrGraphDataProviderDialogBase" /> class. /// </summary> //************************************************************************* public FlickrGraphDataProviderDialogBase( HttpNetworkAnalyzerBase httpNetworkAnalyzer ) : base(httpNetworkAnalyzer) { // m_sApiKey AssertValid(); }
//************************************************************************* // 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(); }
//************************************************************************* // 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(); }
//************************************************************************* // 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(); }
SubscribeToProgressChangedEvent ( HttpNetworkAnalyzerBase oHttpNetworkAnalyzerBase ) { Debug.Assert(oHttpNetworkAnalyzerBase != null); oHttpNetworkAnalyzerBase.ProgressChanged += new ProgressChangedEventHandler( HttpNetworkAnalyzer_ProgressChanged); }
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); }
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); }