コード例 #1
0
        public RectangleBorderSettingPage(ElementBorder border)
        {
            InitializeComponent();
            RegiterLineType();
            RectangleBorder temp = border as RectangleBorder;

            if (null == _border)
            {
                _border = new RectangleBorder(null);
                _border.OwnerElement = border.OwnerElement;
                if (null != temp)
                {
                    _originalBorder = temp;
                    //边框属性的赋值
                    //RectangleBorder dispalyBorder = this.displayBorder.Border as RectangleBorder;
                    _border.HasLeftBorder = temp.HasLeftBorder;
                    displayBorder.HasLeft = _border.HasLeftBorder;
                    //this.LeftBorderCb.Checked = _border.HasLeftBorder;
                    _border.HasBottomBorder = temp.HasBottomBorder;
                    //this.BottomBorderCb.Checked = _border.HasBottomBorder;
                    displayBorder.HasBottom = _border.HasBottomBorder;
                    _border.HasRightBorder  = temp.HasRightBorder;
                    //this.RightBorderCb.Checked = _border.HasRightBorder;
                    displayBorder.HasRight = _border.HasRightBorder;
                    _border.HasTopBorder   = temp.HasTopBorder;
                    //this.TopBorderCb.Checked = _border.HasTopBorder;
                    displayBorder.HasTop = _border.HasTopBorder;
                    _border.MoveX        = temp.MoveX;
                    _border.MoveY        = temp.MoveY;
                    if (null != _border.OwnerElement)
                    {
                        ExternData ed    = new ExternData("HasLeftBorder", _border.HasLeftBorder);
                        int        index = ChecExistkExternDatas(ExternDatas, ed);
                        if (index > -1)
                        {
                            ExternDatas[index] = ed;
                        }
                        else
                        {
                            ExternDatas.Add(ed);
                        }
                        _border.OwnerElement.ExternDatas.Add(ed);

                        ed    = new ExternData("HasBottomBorder", _border.HasBottomBorder);
                        index = ChecExistkExternDatas(ExternDatas, ed);
                        if (index > -1)
                        {
                            ExternDatas[index] = ed;
                        }
                        else
                        {
                            ExternDatas.Add(ed);
                        }

                        ed    = new ExternData("HasRightBorder", _border.HasRightBorder);
                        index = ChecExistkExternDatas(ExternDatas, ed);
                        if (index > -1)
                        {
                            ExternDatas[index] = ed;
                        }
                        else
                        {
                            ExternDatas.Add(ed);
                        }

                        ed    = new ExternData("HasTopBorder", _border.HasTopBorder);
                        index = ChecExistkExternDatas(ExternDatas, ed);
                        if (index > -1)
                        {
                            ExternDatas[index] = ed;
                        }
                        else
                        {
                            ExternDatas.Add(ed);
                        }
                    }
                }
            }
            this.StyleName = _border.Name;
            if (null != border)
            {
                this.BorderWidthTb.Value        = Convert.ToDecimal(border.BorderWidth);
                this.displayBorder.BorderColor  = border.BorderColor;
                this.BorderColorLabel.BackColor = border.BorderColor;
                _border.BorderColor             = border.BorderColor;
                _border.BorderWidth             = border.BorderWidth;
                if (this.LineTypeCmb.Items.Count > 0)
                {
                    try
                    {
                        this.LineTypeCmb.SelectedValue = border.DashStyle;
                    }
                    catch
                    {
                    }
                }
            }
            this.displayBorder.Invalidate();
        }
コード例 #2
0
ファイル: PmsLabel.cs プロジェクト: trigrass2/myreport
        public PmsLabel(IElement element)
            : base()
        {
            PmsLabelWrapper label = element as PmsLabelWrapper;

            BackColor  = label.BackColor;
            StrFormate = label.StrFormate;
            BorderName = label.BorderName;
            if (null != label.ExternDatas && label.ExternDatas.Count > 0)
            {
                if (null == ExternDatas)
                {
                    ExternDatas = new List <ExternData>();
                }
                foreach (ExternData ed in label.ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            if (null != this.Border)
            {
                Border = label.Border.Clone() as ElementBorder;
                Border.OwnerElement = this;
            }
            ForeColor       = label.ForeColor;
            HasBottomBorder = label.HasBottomBorder;
            HasLeftBorder   = label.HasLeftBorder;
            HasRightBorder  = label.HasRightBorder;
            HasTopBorder    = label.HasTopBorder;
            HasBorder       = label.HasBorder;
            Height          = label.Height;
            Width           = label.Width;
            VerticalScale   = label.VerticalScale;
            HorizontalScale = label.HorizontalScale;
            Location        = label.Location;
            HasBorder       = label.HasBorder;
            Text            = label.Text;
            RealText        = label.RealText;
            if (null != label.SourceField)
            {
                SourceField = label.SourceField.Clone() as SourceField;
            }
            MoveX         = label.MoveX;
            MoveY         = label.MoveY;
            Name          = label.Name;
            TextAlign     = label.TextAlign;
            Expression    = label.Expression;
            EnableMapping = label.EnableMapping;
            MappingTable  = label.MappingTable;
            Font          = new Font(label.Font.FontFamily, label.Font.Size, label.Font.Style);
            Visible       = label.Visible;
            MESType       = label.MESType;
            if (null != ((IElement)label).ExtendObject)
            {
                ((IElement)this).ExtendObject = ((IElement)label).ExtendObject.Clone() as ExtendObject;
            }
        }
コード例 #3
0
 private void SetBorder()
 {
     if (null != _border)
     {
         //if (sender.Equals(this.LeftBorderCb))
         {
             _border.HasLeftBorder = displayBorder.HasLeft;
             // ((RectangleBorder)(this.displayBorder.Border)).HasLeftBorder = this.LeftBorderCb.Checked;
             ExternData ed    = new ExternData("HasLeftBorder", _border.HasLeftBorder);
             int        index = ChecExistkExternDatas(ExternDatas, ed);
             if (index > -1)
             {
                 ExternDatas[index] = ed;
             }
             else
             {
                 ExternDatas.Add(ed);
             }
         }
         //else if (sender.Equals(this.RightBorderCb))
         {
             _border.HasRightBorder = displayBorder.HasRight;
             //((RectangleBorder)(this.displayBorder.Border)).HasRightBorder = this.RightBorderCb.Checked;
             ExternData ed    = new ExternData("HasRightBorder", _border.HasRightBorder);
             int        index = ChecExistkExternDatas(ExternDatas, ed);
             if (index > -1)
             {
                 ExternDatas[index] = ed;
             }
             else
             {
                 ExternDatas.Add(ed);
             }
         }
         //else if (sender.Equals(this.TopBorderCb))
         {
             _border.HasTopBorder = displayBorder.HasTop;
             //((RectangleBorder)(this.displayBorder.Border)).HasTopBorder = this.TopBorderCb.Checked;
             ExternData ed    = new ExternData("HasTopBorder", _border.HasTopBorder);
             int        index = ChecExistkExternDatas(ExternDatas, ed);
             if (index > -1)
             {
                 ExternDatas[index] = ed;
             }
             else
             {
                 ExternDatas.Add(ed);
             }
         }
         //else
         {
             _border.HasBottomBorder = this.displayBorder.HasBottom;
             //((RectangleBorder)(this.displayBorder.Border)).HasBottomBorder = this.BottomBorderCb.Checked;
             ExternData ed    = new ExternData("HasBottomBorder", _border.HasBottomBorder);
             int        index = ChecExistkExternDatas(ExternDatas, ed);
             if (index > -1)
             {
                 ExternDatas[index] = ed;
             }
             else
             {
                 ExternDatas.Add(ed);
             }
         }
     }
 }