/// <summary> /// Constructor. /// </summary> public CalibrationComponentControl(CalibrationComponent component) :base(component) { _component = component; InitializeComponent(); this.AcceptButton = _ok; this.CancelButton = _cancel; _length.DecimalPlaces = _component.DecimalPlaces; _length.Increment = (decimal) _component.Increment; _length.Minimum = (decimal) _component.Minimum; BindingSource bindingSource = new BindingSource(); bindingSource.DataSource = _component; _length.DataBindings.Add("Value", bindingSource, "LengthInCm", true, DataSourceUpdateMode.OnPropertyChanged); _ok.Click += delegate { _component.Accept(); }; _cancel.Click += delegate { _component.Cancel(); }; }
/// <summary> /// Constructor. /// </summary> public CalibrationComponentControl(CalibrationComponent component) : base(component) { _component = component; InitializeComponent(); this.AcceptButton = _ok; this.CancelButton = _cancel; _length.DecimalPlaces = _component.DecimalPlaces; _length.Increment = (decimal)_component.Increment; _length.Minimum = (decimal)_component.Minimum; BindingSource bindingSource = new BindingSource(); bindingSource.DataSource = _component; _length.DataBindings.Add("Value", bindingSource, "LengthInCm", true, DataSourceUpdateMode.OnPropertyChanged); _ok.Click += delegate { _component.Accept(); }; _cancel.Click += delegate { _component.Cancel(); }; }
/// <summary> /// Called by the host to assign this view to a component. /// </summary> public void SetComponent(IApplicationComponent component) { _component = (CalibrationComponent)component; }