Simply3DScan
ConfigurationControl.Limits.cs
Go to the documentation of this file.
1 using System;
2 using SharedObjects;
3 
4 namespace Simple3DScan.UI
5 {
6  partial class ConfigurationControl
7  {
11  [LogException]
12  private void InitLimitValues()
13  {
14  this.numericPercentFromTop.Value = (int)this.configuration.VisibleLimit.PercentFromTop;
15  this.numericPercentFromTop.ValueChanged += this.NumericPercentFromTopOnValueChanged;
16  this.colorUIControl.SelectedColor = this.configuration.VisibleLimit.Color;
17  this.colorUIControl.ColorSelected += this.ColorUiControlOnColorSelected;
18  }
19 
25  [Log]
26  [LogException]
27  private void NumericPercentFromTopOnValueChanged(object sender, EventArgs eventArgs)
28  {
29  this.configuration.VisibleLimit.PercentFromTop = (double)this.numericPercentFromTop.Value;
30  }
31 
38  [Log]
39  [LogException]
40  private void ColorUiControlOnColorSelected(object sender, EventArgs eventArgs)
41  {
42  this.configuration.VisibleLimit.Color = this.colorUIControl.SelectedColor;
43  }
44 
45  [Log]
46  [LogException]
47  private void buttonLoadLimitDefaults_Click(object sender, EventArgs e)
48  {
49  this.DetachLimitEvents();
50  this.configuration.VisibleLimit = Configuration.Config.CreateDefaultVisibleLimits();
51  this.InitLimitValues();
52  }
53 
54  private void DetachLimitEvents()
55  {
56  this.numericPercentFromTop.ValueChanged -= this.NumericPercentFromTopOnValueChanged;
57  this.colorUIControl.ColorSelected -= this.ColorUiControlOnColorSelected;
58  }
59  }
60 }
static Line CreateDefaultVisibleLimits()
Creates the default visible limits.
Definition: Config.cs:160
Class for accessing the configuration.
Definition: Config.cs:12