LayoutControls.UserSettings.LabelUserSettings.AssertValid C# (CSharp) Method

AssertValid() private method

private AssertValid ( ) : void
return void
    AssertValid()
    {
        Debug.Assert(m_oFont != null);
        // m_oVertexLabelFillColor
        // m_eVertexLabelPosition
        Debug.Assert(m_iVertexLabelMaximumLength >= 0);
        // m_bVertexLabelWrapText
        Debug.Assert(m_dVertexLabelWrapMaxTextWidth > 0);
        // m_oEdgeLabelTextColor
        Debug.Assert(m_iEdgeLabelMaximumLength >= 0);
        // m_oGroupLabelTextColor
        // m_eGroupLabelPosition

        Debug.Assert(m_fGroupLabelTextAlpha >=
            AlphaConverter.MinimumAlphaWorkbook);

        Debug.Assert(m_fGroupLabelTextAlpha <=
            AlphaConverter.MaximumAlphaWorkbook);
    }

Usage Example

    //*************************************************************************
    //  Constructor: LabelUserSettingsDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="LabelUserSettingsDialog" /> class.
    /// </summary>
    ///
    /// <param name="labelUserSettings">
    /// The object being edited.
    /// </param>
    //*************************************************************************

    public LabelUserSettingsDialog
    (
        LabelUserSettings labelUserSettings
    )
    {
        Debug.Assert(labelUserSettings != null);
        labelUserSettings.AssertValid();

        m_oLabelUserSettings = labelUserSettings;
        m_oFont = m_oLabelUserSettings.Font;

        // 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_oLabelUserSettingsDialogUserSettings =
            new LabelUserSettingsDialogUserSettings(this);

        InitializeComponent();

        usrVertexLabelMaximumLength.AccessKey = 'c';
        usrEdgeLabelMaximumLength.AccessKey = 'T';
        cbxVertexLabelPosition.Populate();

        nudGroupLabelTextAlpha.Minimum =
            (Decimal)AlphaConverter.MinimumAlphaWorkbook;

        nudGroupLabelTextAlpha.Maximum =
            (Decimal)AlphaConverter.MaximumAlphaWorkbook;

        cbxGroupLabelPosition.Populate();

        DoDataExchange(false);

        AssertValid();
    }