コード例 #1
0
        //*************************************************************************
        //  Constructor: GeneralUserSettingsDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="GeneralUserSettingsDialog" /> class.
        /// </summary>
        ///
        /// <param name="generalUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph data.
        /// </param>
        //*************************************************************************

        public GeneralUserSettingsDialog
        (
            GeneralUserSettings generalUserSettings,
            Microsoft.Office.Interop.Excel.Workbook workbook
        )
        {
            Debug.Assert(generalUserSettings != null);
            Debug.Assert(workbook != null);
            generalUserSettings.AssertValid();

            m_oGeneralUserSettings = generalUserSettings;
            m_oWorkbook            = workbook;
            m_oAxisFont            = m_oGeneralUserSettings.AxisFont;
            m_oLabelUserSettings   = m_oGeneralUserSettings.LabelUserSettings;

            // 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_oGeneralUserSettingsDialogUserSettings =
                new GeneralUserSettingsDialogUserSettings(this);

            InitializeComponent();

            nudEdgeWidth.Minimum =
                (Decimal)EdgeWidthConverter.MinimumWidthWorkbook;

            nudEdgeWidth.Maximum =
                (Decimal)EdgeWidthConverter.MaximumWidthWorkbook;

            nudSelectedEdgeWidth.Minimum =
                (Decimal)EdgeWidthConverter.MinimumWidthWorkbook;

            nudSelectedEdgeWidth.Maximum =
                (Decimal)EdgeWidthConverter.MaximumWidthWorkbook;

            nudRelativeArrowSize.Minimum =
                (Decimal)EdgeDrawer.MinimumRelativeArrowSize;

            nudRelativeArrowSize.Maximum =
                (Decimal)EdgeDrawer.MaximumRelativeArrowSize;

            nudVertexRadius.Minimum = nudVertexImageSize.Minimum =
                (Decimal)VertexRadiusConverter.MinimumRadiusWorkbook;

            nudVertexRadius.Maximum = nudVertexImageSize.Maximum =
                (Decimal)VertexRadiusConverter.MaximumRadiusWorkbook;

            (new VertexShapeConverter()).PopulateComboBox(cbxVertexShape, false);

            nudVertexAlpha.Minimum = nudEdgeAlpha.Minimum =
                (Decimal)AlphaConverter.MinimumAlphaWorkbook;

            nudVertexAlpha.Maximum = nudEdgeAlpha.Maximum =
                (Decimal)AlphaConverter.MaximumAlphaWorkbook;

            DoDataExchange(false);

            AssertValid();
        }
コード例 #2
0
        //*************************************************************************
        //  Constructor: GeneralUserSettingsDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="GeneralUserSettingsDialog" /> class.
        /// </summary>
        ///
        /// <param name="generalUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph data.
        /// </param>
        //*************************************************************************
        public GeneralUserSettingsDialog(
            GeneralUserSettings generalUserSettings,
            Microsoft.Office.Interop.Excel.Workbook workbook
            )
        {
            Debug.Assert(generalUserSettings != null);
            Debug.Assert(workbook != null);
            generalUserSettings.AssertValid();

            m_oGeneralUserSettings = generalUserSettings;
            m_oWorkbook = workbook;
            m_oAxisFont = m_oGeneralUserSettings.AxisFont;
            m_oLabelUserSettings = m_oGeneralUserSettings.LabelUserSettings;

            // 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_oGeneralUserSettingsDialogUserSettings =
            new GeneralUserSettingsDialogUserSettings(this);

            InitializeComponent();

            nudEdgeWidth.Minimum =
            (Decimal)EdgeWidthConverter.MinimumWidthWorkbook;

            nudEdgeWidth.Maximum =
            (Decimal)EdgeWidthConverter.MaximumWidthWorkbook;

            nudSelectedEdgeWidth.Minimum =
            (Decimal)EdgeWidthConverter.MinimumWidthWorkbook;

            nudSelectedEdgeWidth.Maximum =
            (Decimal)EdgeWidthConverter.MaximumWidthWorkbook;

            nudRelativeArrowSize.Minimum =
            (Decimal)EdgeDrawer.MinimumRelativeArrowSize;

            nudRelativeArrowSize.Maximum =
            (Decimal)EdgeDrawer.MaximumRelativeArrowSize;

            nudVertexRadius.Minimum = nudVertexImageSize.Minimum =
            (Decimal)VertexRadiusConverter.MinimumRadiusWorkbook;

            nudVertexRadius.Maximum = nudVertexImageSize.Maximum =
            (Decimal)VertexRadiusConverter.MaximumRadiusWorkbook;

            ( new VertexShapeConverter() ).PopulateComboBox(cbxVertexShape, false);

            nudVertexAlpha.Minimum = nudEdgeAlpha.Minimum =
            (Decimal)AlphaConverter.MinimumAlphaWorkbook;

            nudVertexAlpha.Maximum = nudEdgeAlpha.Maximum =
            (Decimal)AlphaConverter.MaximumAlphaWorkbook;

            DoDataExchange(false);

            AssertValid();
        }