Пример #1
0
        internal void SetUtmLocation(String value)
        {
            String   myValue  = TambonHelper.ReplaceThaiNumerals(value.ToUpper()).Trim();
            GeoPoint geoPoint = null;
            UtmPoint utmPoint = null;

            try
            {
                utmPoint       = UtmPoint.ParseUtmString(myValue);
                geoPoint       = new GeoPoint(utmPoint, _currentGeoDatum);
                geoPoint.Datum = GeoDatum.DatumWGS84();
                SetLocationValue(geoPoint, utmPoint);
            }
            catch (ArgumentException)
            {
            }
        }
Пример #2
0
 private void edit_UTM_TextChanged(object sender, EventArgs e)
 {
     if (!_Changing)
     {
         String   value    = TambonHelper.ReplaceThaiNumerals(edt_UTM.Text.ToUpper()).Replace(",", "").Trim();
         GeoPoint geoPoint = null;
         UtmPoint utmPoint = null;
         try
         {
             _Changing      = true;
             utmPoint       = UtmPoint.ParseUtmString(value);
             geoPoint       = new GeoPoint(utmPoint, (GeoDatum)cbx_datum.SelectedItem);
             geoPoint.Datum = GeoDatum.DatumWGS84();
         }
         catch
         {
             // invalid string
             utmPoint = null;
             geoPoint = null;
         }
         SetValues(geoPoint, utmPoint, sender);
         _Changing = false;
     }
 }