예제 #1
0
        //*************************************************************************
        //  Constructor: GraphMetricsDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class with a GraphMetricUserSettings object.
        /// </summary>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph contents.
        /// </param>
        ///
        /// <param name="graphMetricUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the dialog is being used.
        /// </param>
        //*************************************************************************

        public GraphMetricsDialog
        (
            Microsoft.Office.Interop.Excel.Workbook workbook,
            GraphMetricUserSettings graphMetricUserSettings,
            DialogMode mode
        )
            : this()
        {
            Debug.Assert(workbook != null);
            Debug.Assert(graphMetricUserSettings != null);

            m_oWorkbook = workbook;
            m_oGraphMetricUserSettings = graphMetricUserSettings;
            m_eMode = mode;

            if (m_eMode == DialogMode.EditOnly)
            {
                this.Text += " Options";
                btnOK.Text = "OK";
            }

            // 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_oGraphMetricsDialogUserSettings =
                new GraphMetricsDialogUserSettings(this);

            DoDataExchange(false);

            AssertValid();
        }
예제 #2
0
        //*************************************************************************
        //  Constructor: GraphMetricsDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class with a GraphMetricUserSettings object.
        /// </summary>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph contents.
        /// </param>
        ///
        /// <param name="graphMetricUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the dialog is being used.
        /// </param>
        //*************************************************************************
        public GraphMetricsDialog(
            Microsoft.Office.Interop.Excel.Workbook workbook,
            GraphMetricUserSettings graphMetricUserSettings,
            DialogMode mode
            )
            : this()
        {
            Debug.Assert(workbook != null);
            Debug.Assert(graphMetricUserSettings != null);

            m_oWorkbook = workbook;
            m_oGraphMetricUserSettings = graphMetricUserSettings;
            m_eMode = mode;

            if (m_eMode == DialogMode.EditOnly)
            {
            this.Text += " Options";
            btnOK.Text = "OK";
            }

            // 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_oGraphMetricsDialogUserSettings =
            new GraphMetricsDialogUserSettings(this);

            DoDataExchange(false);

            AssertValid();
        }