//*************************************************************************
    //  Constructor: GraphImageUserSettingsDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="GraphImageUserSettingsDialog" /> class.
    /// </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
    )
    {
        Debug.Assert(graphImageUserSettings != null);
        graphImageUserSettings.AssertValid();
        Debug.Assert(nodeXLControlSizePx.Width >= 0);
        Debug.Assert(nodeXLControlSizePx.Height >= 0);

        InitializeComponent();

        m_oGraphImageUserSettings = graphImageUserSettings;
        m_oNodeXLControlSizePx = nodeXLControlSizePx;
        m_bCalculatingHeightOrWidth = false;

        // 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);

        m_oHeaderFooterFont = m_oGraphImageUserSettings.HeaderFooterFont;

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

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

        DoDataExchange(false);

        AssertValid();
    }
예제 #2
0
        //*************************************************************************
        //  Constructor: GraphImageUserSettingsDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="GraphImageUserSettingsDialog" /> class.
        /// </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
        )
        {
            Debug.Assert(graphImageUserSettings != null);
            graphImageUserSettings.AssertValid();
            Debug.Assert(nodeXLControlSizePx.Width >= 0);
            Debug.Assert(nodeXLControlSizePx.Height >= 0);

            InitializeComponent();

            m_oGraphImageUserSettings   = graphImageUserSettings;
            m_oNodeXLControlSizePx      = nodeXLControlSizePx;
            m_bCalculatingHeightOrWidth = false;

            // 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);

            m_oHeaderFooterFont = m_oGraphImageUserSettings.HeaderFooterFont;

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

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

            DoDataExchange(false);

            AssertValid();
        }