Gets an edge width from the user.
If Form.ShowDialog() returns DialogResult.OK, read the property to get the edge width specified by the user.
Inheritance: ExcelTemplateForm
Ejemplo n.º 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,
                                                    EdgeTableColumnNames.Color, CommonTableColumnNames.Alpha);

            if (e.VisualAttributeSet)
            {
                return;
            }

            if (e.VisualAttribute == VisualAttributes.EdgeWidth)
            {
                EdgeWidthDialog oEdgeWidthDialog = new EdgeWidthDialog();

                if (oEdgeWidthDialog.ShowDialog() == DialogResult.OK)
                {
                    ExcelTableUtil.SetVisibleSelectedTableColumnData(
                        this.Edges.InnerObject, oSelectedRange,
                        EdgeTableColumnNames.Width, oEdgeWidthDialog.EdgeWidth);

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

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

                    (new EdgeVisibilityConverter()).GraphToWorkbook(
                        (EdgeWorksheetReader.Visibility)e.AttributeValue)
                    );

                e.VisualAttributeSet = true;
            }
        }
Ejemplo n.º 2
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,
            EdgeTableColumnNames.Color, CommonTableColumnNames.Alpha);

        if (e.VisualAttributeSet)
        {
            return;
        }

        if (e.VisualAttribute == VisualAttributes.EdgeWidth)
        {
            EdgeWidthDialog oEdgeWidthDialog = new EdgeWidthDialog();

            if (oEdgeWidthDialog.ShowDialog() == DialogResult.OK)
            {
                ExcelTableUtil.SetVisibleSelectedTableColumnData(
                    this.Edges.InnerObject, oSelectedRange,
                    EdgeTableColumnNames.Width, oEdgeWidthDialog.EdgeWidth);

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

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

                ( new EdgeVisibilityConverter() ).GraphToWorkbook(
                    (EdgeWorksheetReader.Visibility)e.AttributeValue)
                );

            e.VisualAttributeSet = true;
        }
    }