Example #1
0
        //*************************************************************************
        //  Method: OnShowGraphMetricsClick()
        //
        /// <summary>
        /// Handles the Click event on the btnShowGraphMetrics button.
        /// </summary>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the GraphMetricsDialog is being used.
        /// </param>
        ///
        /// <remarks>
        /// This method can be called from outside the class to simulate a button
        /// click.
        /// </remarks>
        //*************************************************************************
        public void OnShowGraphMetricsClick(
            GraphMetricsDialog.DialogMode mode
            )
        {
            AssertValid();

            this.ThisWorkbook.ShowGraphMetrics(mode);
        }
Example #2
0
        //*************************************************************************
        //  Method: ShowGraphMetrics()
        //
        /// <summary>
        /// Shows the dialog that lists available graph metrics and calculates them
        /// if requested by the user.
        /// </summary>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the GraphMetricsDialog is being used.
        /// </param>
        //*************************************************************************
        public void ShowGraphMetrics(
            GraphMetricsDialog.DialogMode mode
            )
        {
            AssertValid();

            if ( !this.ExcelApplicationIsReady(true) )
            {
            return;
            }

            // Create the object that might be edited by the dialog.

            GraphMetricUserSettings oGraphMetricUserSettings =
            new GraphMetricUserSettings();

            GraphMetricsDialog oGraphMetricsDialog = new GraphMetricsDialog(
            this.InnerObject, oGraphMetricUserSettings, mode);

            if (oGraphMetricsDialog.ShowDialog() == DialogResult.OK)
            {
            // Save the edited object.

            oGraphMetricUserSettings.Save();
            }
        }