Ejemplo n.º 1
0
        /// <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();
        	                 	};
        }
Ejemplo n.º 2
0
        /// <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;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Called by the host to assign this view to a component.
 /// </summary>
 public void SetComponent(IApplicationComponent component)
 {
     _component = (CalibrationComponent)component;
 }