public ReadOnlyDeviceState NewWithLocation(ILocation location) { var result = CopyFrom(this); result.Location = location.Copy(); return(result); }
private void btnEditLocation_Click(object sender, EventArgs e) { if (this.ddlLocations.SelectedIndex < 0 || !(this.ddlLocations.SelectedItem is ILocation)) { return; } ILocation selectedItem = (ILocation)this.ddlLocations.SelectedItem; LocationSettings locationSettings = new LocationSettings(); locationSettings.SelectedLocation = new Location(selectedItem); if (locationSettings.ShowDialog() != DialogResult.OK) { return; } selectedItem.Copy((ILocation)locationSettings.SelectedLocation); this.ResetLocationList(); }
public ReadOnlyDeviceState NewWithLocation(ILocation location) { var result = CopyFrom(this); result.Location = location.Copy(); return result; }