Exemplo n.º 1
0
        WriteGraphMetricsToWorkbook
        (
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            GraphMetricColumn [] aoGraphMetricColumns
        )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(aoGraphMetricColumns != null);

            GraphMetricWriter oGraphMetricWriter = new GraphMetricWriter();

            oGraphMetricWriter.WriteGraphMetricColumnsToWorkbook(
                aoGraphMetricColumns, oWorkbook);

            oGraphMetricWriter.ActivateRelevantWorksheet(aoGraphMetricColumns,
                                                         oWorkbook);
        }
Exemplo n.º 2
0
        WriteGraphMetricColumnsToWorkbook
        (
            GraphMetricColumn [] aoGraphMetricColumns
        )
        {
            Debug.Assert(aoGraphMetricColumns != null);
            AssertValid();

            Microsoft.Office.Interop.Excel.Application oApplication =
                m_oWorkbook.Application;

            GraphMetricWriter oGraphMetricWriter = new GraphMetricWriter();

            oApplication.ScreenUpdating = false;

            try
            {
                oGraphMetricWriter.WriteGraphMetricColumnsToWorkbook(
                    aoGraphMetricColumns, m_oWorkbook);

                // Let the user know that graph metrics have been calculated.

                oGraphMetricWriter.ActivateRelevantWorksheet(
                    aoGraphMetricColumns, m_oWorkbook);
            }
            catch (Exception oException)
            {
                oApplication.ScreenUpdating = true;

                ErrorUtil.OnException(oException);

                this.Close();
                return;
            }

            oApplication.ScreenUpdating = true;
        }
        //*************************************************************************
        //  Method: WriteGraphMetricColumnsToWorkbook()
        //
        /// <summary>
        /// Writes an array of GraphMetricColumn objects to the workbook.
        /// </summary>
        ///
        /// <param name="aoGraphMetricColumns">
        /// An array of GraphMetricColumn objects, one for each column of metrics
        /// that were calculated.
        /// </param>
        //*************************************************************************
        protected void WriteGraphMetricColumnsToWorkbook(
            GraphMetricColumn [] aoGraphMetricColumns
            )
        {
            Debug.Assert(aoGraphMetricColumns != null);
            AssertValid();

            Microsoft.Office.Interop.Excel.Application oApplication =
            m_oWorkbook.Application;

            GraphMetricWriter oGraphMetricWriter = new GraphMetricWriter();

            oApplication.ScreenUpdating = false;

            try
            {
            oGraphMetricWriter.WriteGraphMetricColumnsToWorkbook(
                aoGraphMetricColumns, m_oWorkbook);

            // Let the user know that graph metrics have been calculated.

            oGraphMetricWriter.ActivateRelevantWorksheet(
                aoGraphMetricColumns, m_oWorkbook);
            }
            catch (Exception oException)
            {
            oApplication.ScreenUpdating = true;

            ErrorUtil.OnException(oException);

            this.Close();
            return;
            }

            oApplication.ScreenUpdating = true;
        }