Ejemplo n.º 1
0
        //*************************************************************************
        //  Constructor: PartialNetworkDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see
        /// cref="PartialNetworkDialog" /> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="PartialNetworkDialog" /> class with a <see
        /// cref="PartialNetworkException" />.
        /// </summary>
        ///
        /// <param name="partialNetworkException">
        /// The <see cref="PartialNetworkException" /> that was thrown.
        /// </param>
        ///
        /// <param name="lastUnexpectedExceptionMessage">
        /// The most recent unexpected exception (after retries) that occurred
        /// while getting the network, converted to a message.
        /// </param>
        //*************************************************************************
        public PartialNetworkDialog(
            PartialNetworkException partialNetworkException,
            String lastUnexpectedExceptionMessage
            )
            : this()
        {
            m_oPartialNetworkException = partialNetworkException;
            m_sLastUnexpectedExceptionMessage = lastUnexpectedExceptionMessage;

            AssertValid();
        }
Ejemplo n.º 2
0
        //*************************************************************************
        //  Constructor: PartialNetworkDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see
        /// cref="PartialNetworkDialog" /> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="PartialNetworkDialog" /> class with a <see
        /// cref="PartialNetworkException" />.
        /// </summary>
        ///
        /// <param name="partialNetworkException">
        /// The <see cref="PartialNetworkException" /> that was thrown.
        /// </param>
        ///
        /// <param name="lastUnexpectedExceptionMessage">
        /// The most recent unexpected exception (after retries) that occurred
        /// while getting the network, converted to a message.
        /// </param>
        //*************************************************************************

        public PartialNetworkDialog
        (
            PartialNetworkException partialNetworkException,
            String lastUnexpectedExceptionMessage
        )
            : this()
        {
            m_oPartialNetworkException        = partialNetworkException;
            m_sLastUnexpectedExceptionMessage = lastUnexpectedExceptionMessage;

            AssertValid();
        }
Ejemplo n.º 3
0
        OnAnalysisException
        (
            Exception oException
        )
        {
            Debug.Assert(oException != null);
            AssertValid();

            if (oException is PartialNetworkException)
            {
                // Ask the user whether he wants to import the partial network.

                PartialNetworkException oPartialNetworkException =
                    (PartialNetworkException)oException;

                PartialNetworkDialog oPartialNetworkDialog =

                    new PartialNetworkDialog(oPartialNetworkException,

                                             m_oHttpNetworkAnalyzer.ExceptionToMessage(
                                                 oPartialNetworkException.RequestStatistics.
                                                 LastUnexpectedException)
                                             );

                if (oPartialNetworkDialog.ShowDialog() == DialogResult.Yes)
                {
                    OnAnalysisSuccess(oPartialNetworkException.PartialNetwork);
                }
            }
            else
            {
                this.ShowWarning(
                    "The network couldn't be obtained.  Details:"
                    + "\r\n\r\n"
                    + m_oHttpNetworkAnalyzer.ExceptionToMessage(oException)
                    );
            }
        }