public void CopyIntoTest() { IRulerInfo source = new RulerInfo { Width = 500, Height = 80, Opacity = 0.90, ShowToolTip = true, IsLocked = true, IsVertical = true, TopMost = true }; IRulerInfo target = new RulerInfo { Width = 400, Height = 75, Opacity = 0.60, ShowToolTip = true, IsLocked = false, IsVertical = false, TopMost = true }; RulerInfo.CopyInto(source, target); var properties = Helper.GetPublicPropertiesFromInterface(typeof(IRulerInfo)); foreach (PropertyInfo pi in properties) { Assert.AreEqual(pi.GetValue(source), pi.GetValue(target)); } }
public static RulerInfo GetDefaultRulerInfo() { RulerInfo rulerInfo = new RulerInfo { Width = 400, Height = 75, Opacity = 0.60, ShowToolTip = true, IsLocked = false, IsVertical = false, TopMost = true }; return(rulerInfo); }
private void Init(RulerInfo rulerInfo) { this.SetStyle(ControlStyles.ResizeRedraw, true); this.UpdateStyles(); ResourceManager resources = new ResourceManager(typeof(MainForm)); this.Icon = ((Icon)(resources.GetObject("$this.Icon"))); this.SetUpMenu(); this.Text = "Ruler"; this.BackColor = Color.White; rulerInfo.CopyInto(this); this.FormBorderStyle = FormBorderStyle.None; this.ContextMenu = _menu; this.Font = new Font("Tahoma", 10); this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); }
public static RulerInfo CovertToRulerInfo(string[] args) { string width = args[0]; string height = args[1]; string isVertical = args[2]; string opacity = args[3]; string showToolTip = args[4]; string isLocked = args[5]; string topMost = args[6]; RulerInfo rulerInfo = new RulerInfo { Width = int.Parse(width), Height = int.Parse(height), IsVertical = bool.Parse(isVertical), Opacity = double.Parse(opacity), ShowToolTip = bool.Parse(showToolTip), IsLocked = bool.Parse(isLocked), TopMost = bool.Parse(topMost) }; return(rulerInfo); }
private void Init(RulerInfo rulerInfo) { this.SetStyle(ControlStyles.ResizeRedraw, true); this.UpdateStyles(); ResourceManager resources = new ResourceManager(typeof(MainForm)); this.Icon = ((Icon)(resources.GetObject("$this.Icon"))); this.SetUpMenu(); this.Text = "Ruler"; this.BackColor = Color.White; rulerInfo.CopyInto(this); this.FormBorderStyle = FormBorderStyle.None; this.ContextMenu = _menu; this.Font = new Font("Tahoma", 10); this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); MouseDoubleClick += (sender, args) => { IsVertical = !IsVertical; }; _toolTipMenuItem.Checked = true; this._toolTip.AutoPopDelay = 9999; }
public MainForm(RulerInfo rulerInfo) { this.Init(rulerInfo); }
private RulerInfo GetRulerInfo() { RulerInfo rulerInfo = new RulerInfo(); this.CopyInto(rulerInfo); return rulerInfo; }
public void GetDefaultRulerInfoTest() { Assert.AreNotEqual(null, RulerInfo.GetDefaultRulerInfo()); }