public void Clone(ControlHints src) { this.MinimumHeight = src.MinimumHeight; this.MaximumHeight = src.MaximumHeight; this.MinimumWidth = src.MinimumWidth; this.MaximumWidth = src.MaximumWidth; this.MinimumFontSize = src.MinimumFontSize; this.DefaultFontFamily = src.DefaultFontFamily; }
public void Clone(ControlHints src) { this.MinimumHeight = src.MinimumHeight; this.MaximumHeight = src.MaximumHeight; this.MinimumWidth = src.MinimumWidth; this.MaximumWidth = src.MaximumWidth; this.MinimumFontSize = src.MinimumFontSize; this.DefaultFontFamily = src.DefaultFontFamily; }
public void SetAllControlHints(ControlHints setter) { var settings = new ControlHints[] { this.ButtonHints, this.LabelHints, this.TextBoxHints, this.DateTimePickerHints, this.ComboBoxHints, this.CheckBoxHints }; foreach (var s in settings) { s.Clone(setter); } }
public void Test_SetAllControlHints_SetsAllControlHints() { //---------------Set up test pack------------------- var template = new ControlHints() { MaximumHeight = RandomValueGen.GetRandomInt(100, 150), MinimumHeight = RandomValueGen.GetRandomInt(50, 100), MinimumWidth = RandomValueGen.GetRandomInt(50, 100), MaximumWidth = RandomValueGen.GetRandomInt(100, 150), DefaultFontFamily = new FontFamily("Wingdings"), MinimumFontSize = (float)RandomValueGen.GetRandomDecimal(10, 20) }; GlobalUIRegistry.UIStyleHints = new UIStyleHints(); GlobalUIRegistry.UIStyleHints.SetAllControlHints(template); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- //---------------Test Result ----------------------- var test = new ControlHints[] { GlobalUIRegistry.UIStyleHints.ButtonHints, GlobalUIRegistry.UIStyleHints.LabelHints, GlobalUIRegistry.UIStyleHints.TextBoxHints, GlobalUIRegistry.UIStyleHints.DateTimePickerHints, GlobalUIRegistry.UIStyleHints.ComboBoxHints, GlobalUIRegistry.UIStyleHints.CheckBoxHints }; foreach (var t in test) { Assert.That(t.Equals(template)); } }
public void SetAllControlHints(ControlHints setter) { var settings = new ControlHints[] { this.ButtonHints, this.LabelHints, this.TextBoxHints, this.DateTimePickerHints, this.ComboBoxHints, this.CheckBoxHints }; foreach (var s in settings) { s.Clone(setter); } }