protected override void SetTunedStyleItem(CStyleItem newOwn) { CMarginStyleItem item = (CMarginStyleItem)newOwn; this.MarginSize = item.MarginSize; this.BorderStyle = item.BorderStyle; this.SetMarginColor(item.GetMarginColor()); this.TopMost = item.TopMost; }
protected override void SetStyleToForm(object style) { CMarginStyleItem item = (CMarginStyleItem)style; this.InitializeComponent(); this.imgBackground = new Bitmap(this.picPreview.Width, this.picPreview.Height, PixelFormat.Format24bppRgb); using (Graphics graphics = Graphics.FromImage(this.imgBackground)) { graphics.CopyFromScreen(new Point(0, 0), new Point(0, 0), this.imgBackground.Size); } this.imgScrap = SETUNA.Resources.Image.SampleImage; this.picSample = new PictureBox(); this.picSample.Image = this.imgScrap; this.picSample.Size = this.imgScrap.Size; this.frmPrev = new Form(); this.frmPrev.TopLevel = false; this.frmPrev.Parent = this.picPreview; this.frmPrev.Text = "sample"; this.frmPrev.Controls.Add(this.picSample); this.ResizeSample(); this.frmPrev.Show(); this.numMargin.Value = item.MarginSize; this.pictureBox1.BackColor = item.GetMarginColor(); this.chkTopMost.Checked = item.TopMost; switch (item.BorderStyle) { case 0: this.rdo3D.Checked = true; break; case 1: this.rdoSolid.Checked = true; break; case 2: this.rdoWindow.Checked = true; break; default: throw new Exception(); } this.Text = item.GetDisplayName(); this.rdoWindow_CheckedChanged(null, null); this.frmPrev.Paint += new PaintEventHandler(this.Sample_Paint); }