Exemple #1
0
        /// <summary>
        /// Cancell button click handler
        /// </summary>
        //private void OnCancelClick(object sender, RoutedEventArgs e)
        //{
        //    this.Close();
        //}

        /// <summary>
        /// OK button click handler
        /// </summary>
        private void OnOkClick(object sender, RoutedEventArgs e)
        {
            try
            {
                //### Set last selected border width
                ComboBoxShapeInfo comboBoxShapeInfo = this.m_comboBorderWidth.SelectedItem as ComboBoxShapeInfo;
                if (null != comboBoxShapeInfo)
                {
                    double dLeft   = comboBoxShapeInfo.LineWidth;
                    double dTop    = comboBoxShapeInfo.LineWidth;
                    double dRight  = comboBoxShapeInfo.LineWidth;
                    double dBottom = comboBoxShapeInfo.LineWidth;

                    if (this.IsNoBorder)
                    {
                        dLeft = dTop = dRight = dBottom = 0.0;
                    }
                    else if (this.IsBoxBorder)
                    {
                    }

                    this.TableBorderThickness = new Thickness(dLeft, dTop, dRight, dBottom);
                }

                //### Set last selected border color
                int iSelIndex = this.m_comboBorderColor.SelectedIndex;
                this.TableBorderBrush = new SolidColorBrush(mst_colorArray[-1 == iSelIndex ? 0 : iSelIndex]);

                if (null != this.Table)
                {
                    this.Table.BorderBrush     = this.TableBorderBrush;
                    this.Table.BorderThickness = this.TableBorderThickness;
                    this.Table.Tag             = this.TableType;

                    foreach (TableRowGroup rowGroup in this.Table.RowGroups)
                    {
                        foreach (TableRow row in rowGroup.Rows)
                        {
                            foreach (TableCell cell in row.Cells)
                            {
                                cell.BorderBrush     = this.TableBorderBrush;
                                cell.BorderThickness = this.TableBorderThickness;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception: " + ex);
                Debug.Assert(false, "Exception: " + ex);
            }

            //    this.DialogResult = true;
            //    this.Close();
        }
Exemple #2
0
        private void AddComboBorderWidth(double dLineWidth)
        {
            ComboBoxShapeInfo comboBoxShapeInfo = new ComboBoxShapeInfo(String.Format("{0} ", dLineWidth), dLineWidth);

            this.m_comboBorderWidth.Items.Add(comboBoxShapeInfo);
        }