예제 #1
0
        //*************************************************************************
        //  Constructor: CalculateGraphMetricsDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="CalculateGraphMetricsDialog" /> class with a default list of
        /// graph metric calculators.
        /// </summary>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph contents.
        /// </param>
        ///
        /// <param name="graphMetricUserSettings">
        /// User settings for calculating graph metrics.
        /// </param>
        //*************************************************************************

        public CalculateGraphMetricsDialog
        (
            Microsoft.Office.Interop.Excel.Workbook workbook,
            GraphMetricUserSettings graphMetricUserSettings
        )
            : this()
        {
            // Instantiate an object that saves and retrieves the position of this
            // dialog.  Note that the object automatically saves the settings when
            // the form closes.

            m_oCalculateGraphMetricsDialogUserSettings =
                new CalculateGraphMetricsDialogUserSettings(this);

            m_oWorkbook = workbook;
            m_oGraphMetricCalculators  = null;
            m_oGraphMetricUserSettings = graphMetricUserSettings;

            m_oGraphMetricCalculationManager = new GraphMetricCalculationManager();

            m_oGraphMetricCalculationManager.GraphMetricCalculationProgressChanged
                += new ProgressChangedEventHandler(
                       GraphMetricCalculationManager_GraphMetricCalculationProgressChanged);

            m_oGraphMetricCalculationManager.GraphMetricCalculationCompleted +=
                new RunWorkerCompletedEventHandler(
                    GraphMetricCalculationManager_GraphMetricCalculationCompleted);

            DoDataExchange(false);

            // Assume that calculations will not succeed.

            this.DialogResult = DialogResult.Cancel;

            AssertValid();
        }
        //*************************************************************************
        //  Constructor: CalculateGraphMetricsDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="CalculateGraphMetricsDialog" /> class with a default list of
        /// graph metric calculators.
        /// </summary>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph contents.
        /// </param>
        ///
        /// <param name="graphMetricUserSettings">
        /// User settings for calculating graph metrics.
        /// </param>
        //*************************************************************************
        public CalculateGraphMetricsDialog(
            Microsoft.Office.Interop.Excel.Workbook workbook,
            GraphMetricUserSettings graphMetricUserSettings
            )
            : this()
        {
            // Instantiate an object that saves and retrieves the position of this
            // dialog.  Note that the object automatically saves the settings when
            // the form closes.

            m_oCalculateGraphMetricsDialogUserSettings =
            new CalculateGraphMetricsDialogUserSettings(this);

            m_oWorkbook = workbook;
            m_oGraphMetricCalculators = null;
            m_oGraphMetricUserSettings = graphMetricUserSettings;

            m_oGraphMetricCalculationManager = new GraphMetricCalculationManager();

            m_oGraphMetricCalculationManager.GraphMetricCalculationProgressChanged
            += new ProgressChangedEventHandler(
            GraphMetricCalculationManager_GraphMetricCalculationProgressChanged);

            m_oGraphMetricCalculationManager.GraphMetricCalculationCompleted +=
            new RunWorkerCompletedEventHandler(
                GraphMetricCalculationManager_GraphMetricCalculationCompleted);

            DoDataExchange(false);

            // Assume that calculations will not succeed.

            this.DialogResult = DialogResult.Cancel;

            AssertValid();
        }