コード例 #1
0
 public _4screen.CSB.DataAccess.Business.StyleSettings GetStyleSettings()
 {
     _4screen.CSB.DataAccess.Business.StyleSettings settings = new _4screen.CSB.DataAccess.Business.StyleSettings();
     if (this.RcpText.SelectedColor != Color.Empty)
     {
         settings.TextColor = this.RcpText.SelectedColor.ToHex();
     }
     if (this.RcpLink.SelectedColor != Color.Empty)
     {
         settings.LinkColor = this.RcpLink.SelectedColor.ToHex();
     }
     if (this.RcpBackground.SelectedColor != Color.Empty)
     {
         settings.BackgroundColor = this.RcpBackground.SelectedColor.ToHex();
     }
     if (!string.IsNullOrEmpty(this.TxtBackground.Text))
     {
         settings.BackgroundImage = this.TxtBackground.Text;
     }
     settings.BackgroundImageActive = this.CbBackground.Checked;
     settings.VerticalRepetition    = this.CbVertical.Checked;
     settings.HorizontalRepetition  = this.CbHorizontal.Checked;
     if (this.RcpText.SelectedColor != Color.Empty)
     {
         settings.TextColor   = Common.Extensions.ToHex(this.RcpText.SelectedColor);
         settings.BorderType  = this.RcbBorder.SelectedValue;
         settings.BorderWidth = (int)this.RntbBorder.Value.Value;
     }
     return(settings);
 }
コード例 #2
0
 public void SetStyleSettings(_4screen.CSB.DataAccess.Business.StyleSettings settings)
 {
     if (!string.IsNullOrEmpty(settings.TextColor))
     {
         this.RcpText.SelectedColor = settings.TextColor.ToColor();
     }
     if (!string.IsNullOrEmpty(settings.LinkColor))
     {
         this.RcpLink.SelectedColor = settings.LinkColor.ToColor();
     }
     if (!string.IsNullOrEmpty(settings.BackgroundColor))
     {
         this.RcpBackground.SelectedColor = settings.BackgroundColor.ToColor();
     }
     if (!string.IsNullOrEmpty(settings.BackgroundImage))
     {
         this.TxtBackground.Text = settings.BackgroundImage;
     }
     this.CbBackground.Checked = settings.BackgroundImageActive;
     this.CbVertical.Checked   = settings.VerticalRepetition;
     this.CbHorizontal.Checked = settings.HorizontalRepetition;
     if (!string.IsNullOrEmpty(settings.BorderColor))
     {
         this.RcpBorder.SelectedColor = settings.BorderColor.ToColor();
     }
     this.RcbBorder.SelectedValue = settings.BorderType;
     if (settings.BorderWidth > 0)
     {
         this.RntbBorder.Value = settings.BorderWidth;
     }
 }