Example #1
0
        //*************************************************************************
        //  Constructor: GraphImageUserSettingsDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see
        /// cref="GraphImageUserSettingsDialog" /> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="GraphImageUserSettingsDialog" /> class with a
        /// <see cref="GraphImageUserSettings" /> object and a NodeXLControlSize.
        /// </summary>
        ///
        /// <param name="graphImageUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="nodeXLControlSizePx">
        /// The size of the NodeXLControl, in pixels.
        /// </param>
        //*************************************************************************

        public GraphImageUserSettingsDialog
        (
            GraphImageUserSettings graphImageUserSettings,
            Size nodeXLControlSizePx
        )
            : this()
        {
            Debug.Assert(graphImageUserSettings != null);
            graphImageUserSettings.AssertValid();
            Debug.Assert(nodeXLControlSizePx.Width >= 0);
            Debug.Assert(nodeXLControlSizePx.Height >= 0);

            m_oGraphImageUserSettings = graphImageUserSettings;

            // Instantiate an object that saves and retrieves the user settings for
            // this dialog.  Note that the object automatically saves the settings
            // when the form closes.

            m_oGraphImageUserSettingsDialogUserSettings =
                new GraphImageUserSettingsDialogUserSettings(this);

            lblControlWidth.Text =
                nodeXLControlSizePx.Width.ToString(ExcelTemplateForm.Int32Format);

            lblControlHeight.Text =
                nodeXLControlSizePx.Height.ToString(ExcelTemplateForm.Int32Format);

            DoDataExchange(false);

            AssertValid();
        }
        //*************************************************************************
        //  Constructor: GraphImageUserSettingsDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see
        /// cref="GraphImageUserSettingsDialog" /> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="GraphImageUserSettingsDialog" /> class with a
        /// <see cref="GraphImageUserSettings" /> object and a NodeXLControlSize.
        /// </summary>
        ///
        /// <param name="graphImageUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="nodeXLControlSizePx">
        /// The size of the NodeXLControl, in pixels.
        /// </param>
        //*************************************************************************
        public GraphImageUserSettingsDialog(
            GraphImageUserSettings graphImageUserSettings,
            Size nodeXLControlSizePx
            )
            : this()
        {
            Debug.Assert(graphImageUserSettings != null);
            graphImageUserSettings.AssertValid();
            Debug.Assert(nodeXLControlSizePx.Width >= 0);
            Debug.Assert(nodeXLControlSizePx.Height >= 0);

            m_oGraphImageUserSettings = graphImageUserSettings;

            // Instantiate an object that saves and retrieves the user settings for
            // this dialog.  Note that the object automatically saves the settings
            // when the form closes.

            m_oGraphImageUserSettingsDialogUserSettings =
            new GraphImageUserSettingsDialogUserSettings(this);

            lblControlWidth.Text =
            nodeXLControlSizePx.Width.ToString(ExcelTemplateForm.Int32Format);

            lblControlHeight.Text =
            nodeXLControlSizePx.Height.ToString(ExcelTemplateForm.Int32Format);

            DoDataExchange(false);

            AssertValid();
        }