private void CoordSystemForm_Shown(object sender, EventArgs e) { CadastralMapModel map = CadastralMapModel.Current; ISpatialSystem sys = map.SpatialSystem; systemNameLabel.Text = sys.Name; epsgNumberLabel.Text = sys.EpsgNumber.ToString(); // Display mean elevation and geoid separation in the current data entry units. EditingController ec = EditingController.Current; DistanceUnit eUnit = ec.EntryUnit; DistanceUnit meters = EditingController.GetUnits(DistanceUnitType.Meters); // The mean elevation & geoid separation fields are always editable (even // if the map contains stuff). The values are used to calculate the ground // area of polygons. Distance elev = new Distance(sys.MeanElevation.Meters, meters); meanElevationTextBox.Text = elev.Format(eUnit, true); Distance sep = new Distance(sys.GeoidSeparation.Meters, meters); geoidSeparationTextBox.Text = sep.Format(eUnit, true); }
/// <summary> /// Initializes a new instance of the <see cref="Distance"/> class /// using the data read from persistent storage. /// </summary> /// <param name="editDeserializer">The mechanism for reading back content.</param> internal Distance(EditDeserializer editDeserializer) { double distance = editDeserializer.ReadDouble(DataField.Value); DistanceUnitType unitType = (DistanceUnitType)editDeserializer.ReadByte(DataField.Unit); m_EnteredUnit = EditingController.GetUnits(unitType); m_ObservedMetric = m_EnteredUnit.ToMetric(distance); if (editDeserializer.IsNextField(DataField.Fixed)) { m_IsFixed = editDeserializer.ReadBool(DataField.Fixed); } else { m_IsFixed = false; } if (editDeserializer.IsNextField(DataField.Flipped)) { IsAnnotationFlipped = editDeserializer.ReadBool(DataField.Flipped); } else { IsAnnotationFlipped = false; } }
void ShowResults(DistanceUnitType dunit) { DistanceUnit unit = EditingController.GetUnits(dunit); lengthTextBox.Text = unit.Format(m_Length); totalEnteredTextBox.Text = unit.Format(m_Entered); lengthLeftTextBox.Text = unit.Format(m_Length - m_Entered); }
void ShowResults(DistanceUnitType type) { DistanceUnit unit = EditingController.GetUnits(type); if (unit == null) { return; } lengthLabel.Text = unit.Format(m_Length, false, -1); deltaNorthingLabel.Text = unit.Format(m_DeltaN, false, -1); deltaEastingLabel.Text = unit.Format(m_DeltaE, false, -1); }
void SetUnit(DistanceUnitType type) { m_Unit = EditingController.GetUnits(type); }
private void cRadioButton_CheckedChanged(object sender, EventArgs e) { m_Unit = EditingController.GetUnits(DistanceUnitType.Chains); SetNewDefault(); }