Gets a vertex radius from the user.
If Form.ShowDialog() returns DialogResult.OK, read the property to get the vertex radius specified by the user.
Inheritance: ExcelTemplateForm
コード例 #1
0
        SetVisualAttribute
        (
            RunSetVisualAttributeCommandEventArgs e
        )
        {
            Debug.Assert(e != null);
            AssertValid();

            Microsoft.Office.Interop.Excel.Range oSelectedRange;

            if (e.VisualAttributeSet ||
                !m_oSheets1And2Helper.TryGetSelectedRange(out oSelectedRange))
            {
                return;
            }

            // See if the specified attribute is set by the helper class.

            m_oSheets1And2Helper.SetVisualAttribute(e, oSelectedRange,
                                                    VertexTableColumnNames.Color, CommonTableColumnNames.Alpha);

            if (e.VisualAttributeSet)
            {
                return;
            }

            if (e.VisualAttribute == VisualAttributes.VertexShape)
            {
                Debug.Assert(e.AttributeValue is VertexShape);

                ExcelTableUtil.SetVisibleSelectedTableColumnData(
                    this.Vertices.InnerObject, oSelectedRange,
                    VertexTableColumnNames.Shape,

                    (new VertexShapeConverter()).GraphToWorkbook(
                        (VertexShape)e.AttributeValue)
                    );

                e.VisualAttributeSet = true;
            }
            else if (e.VisualAttribute == VisualAttributes.VertexRadius)
            {
                VertexRadiusDialog oVertexRadiusDialog = new VertexRadiusDialog();

                if (oVertexRadiusDialog.ShowDialog() == DialogResult.OK)
                {
                    ExcelTableUtil.SetVisibleSelectedTableColumnData(
                        this.Vertices.InnerObject, oSelectedRange,
                        VertexTableColumnNames.Radius,
                        oVertexRadiusDialog.VertexRadius);

                    e.VisualAttributeSet = true;
                }
            }
            else if (e.VisualAttribute == VisualAttributes.VertexVisibility)
            {
                Debug.Assert(e.AttributeValue is VertexWorksheetReader.Visibility);

                ExcelTableUtil.SetVisibleSelectedTableColumnData(
                    this.Vertices.InnerObject, oSelectedRange,
                    CommonTableColumnNames.Visibility,

                    (new VertexVisibilityConverter()).GraphToWorkbook(
                        (VertexWorksheetReader.Visibility)e.AttributeValue)
                    );

                e.VisualAttributeSet = true;
            }
        }
コード例 #2
0
ファイル: Sheet2.cs プロジェクト: 2014-sed-team3/term-project
    SetVisualAttribute
    (
        RunSetVisualAttributeCommandEventArgs e
    )
    {
        Debug.Assert(e != null);
        AssertValid();

        Microsoft.Office.Interop.Excel.Range oSelectedRange;

        if ( e.VisualAttributeSet ||
            !m_oSheets1And2Helper.TryGetSelectedRange(out oSelectedRange) )
        {
            return;
        }

        // See if the specified attribute is set by the helper class.

        m_oSheets1And2Helper.SetVisualAttribute(e, oSelectedRange,
            VertexTableColumnNames.Color, CommonTableColumnNames.Alpha);

        if (e.VisualAttributeSet)
        {
            return;
        }

        if (e.VisualAttribute == VisualAttributes.VertexShape)
        {
            Debug.Assert(e.AttributeValue is VertexShape);

            ExcelTableUtil.SetVisibleSelectedTableColumnData(
                this.Vertices.InnerObject, oSelectedRange,
                VertexTableColumnNames.Shape,

                ( new VertexShapeConverter() ).GraphToWorkbook(
                    (VertexShape)e.AttributeValue)
                );

            e.VisualAttributeSet = true;
        }
        else if (e.VisualAttribute == VisualAttributes.VertexRadius)
        {
            VertexRadiusDialog oVertexRadiusDialog = new VertexRadiusDialog();

            if (oVertexRadiusDialog.ShowDialog() == DialogResult.OK)
            {
                ExcelTableUtil.SetVisibleSelectedTableColumnData(
                    this.Vertices.InnerObject, oSelectedRange,
                    VertexTableColumnNames.Radius,
                    oVertexRadiusDialog.VertexRadius);

                e.VisualAttributeSet = true;
            }
        }
        else if (e.VisualAttribute == VisualAttributes.VertexVisibility)
        {
            Debug.Assert(e.AttributeValue is VertexWorksheetReader.Visibility);

            ExcelTableUtil.SetVisibleSelectedTableColumnData(
                this.Vertices.InnerObject, oSelectedRange,
                CommonTableColumnNames.Visibility,

                ( new VertexVisibilityConverter() ).GraphToWorkbook(
                    (VertexWorksheetReader.Visibility)e.AttributeValue)
                );

            e.VisualAttributeSet = true;
        }
    }