Esempio n. 1
0
        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();
        }
Esempio n. 3
0
        public ReadOnlyDeviceState NewWithLocation(ILocation location)
        {
            var result = CopyFrom(this);
            result.Location = location.Copy();

            return result;
        }