/// <summary> /// Constructor /// </summary> public LocationEditorComponentControl(LocationEditorComponent component) : base(component) { InitializeComponent(); _component = component; _id.DataBindings.Add("Value", _component, "Id", true, DataSourceUpdateMode.OnPropertyChanged); _name.DataBindings.Add("Value", _component, "Name", true, DataSourceUpdateMode.OnPropertyChanged); _description.DataBindings.Add("Value", _component, "Description", true, DataSourceUpdateMode.OnPropertyChanged); _facility.DataSource = _component.FacilityChoices; _facility.DataBindings.Add("Value", _component, "Facility", true, DataSourceUpdateMode.OnPropertyChanged); _facility.Format += delegate(object sender, ListControlConvertEventArgs e) { e.Value = _component.FormatFacility(e.ListItem); }; _building.DataBindings.Add("Value", _component, "Building", true, DataSourceUpdateMode.OnPropertyChanged); _floor.DataBindings.Add("Value", _component, "Floor", true, DataSourceUpdateMode.OnPropertyChanged); _pointOfCare.DataBindings.Add("Value", _component, "PointOfCare", true, DataSourceUpdateMode.OnPropertyChanged); _acceptButton.DataBindings.Add("Enabled", _component, "AcceptEnabled", true, DataSourceUpdateMode.OnPropertyChanged); }
public void SetComponent(IApplicationComponent component) { _component = (LocationEditorComponent)component; }