Ejemplo n.º 1
0
        /// <summary><para>Die statische Methode prüft, ob die Koordinaten des übergebenen <see cref="BaseSystem"/>-Objekts
        /// in also in Deutschland liegen. Das Gauss-Krüger Koordinatensystem ist nur für Deutschland definiert.</para></summary>
        /// <param name="system">Ein gültiges Objekt einer von <see cref="BaseSystem"/> abgeleiteten Klasse.</param>
        /// <returns>True, wenn die Koordinaten in Deutschland liegen, sonst False.</returns>
        public static bool ValidRange(BaseSystem system)
        {
            bool result = false;

            try
            {
                Geographic geo = null;
                if (system == null)
                {
                    return(false);
                }
                else if (system.GetType() == typeof(Geographic))
                {
                    geo = (Geographic)system;
                }
                else if (system.GetType() == typeof(UTM))
                {
                    geo = (Geographic)(UTM)system;
                }
                else if (system.GetType() == typeof(MGRS))
                {
                    geo = (Geographic)(MGRS)system;
                }
                else if (system.GetType() == typeof(GaussKrueger))
                {
                    return(true);
                }
                if (geo == null)
                {
                    return(false);
                }

                if ((geo.Longitude < 5.0) || (geo.Longitude > 16.0) || (geo.Latitude < 46.0) || (geo.Latitude > 56.0))
                {
                    result = false;
                }
                else
                {
                    result = true;
                }
            }
            catch (Exception) { }
            return(result);
        }
Ejemplo n.º 2
0
 public void RemoveSystem(BaseSystem system)
 {
     if (Systems.Contains(system))
     {
         Systems.Remove(system);
     }
     else
     {
         System.Diagnostics.Debug.WriteLine($"System of type {system.GetType()} not registered.");
     }
 }
Ejemplo n.º 3
0
 public void RegisterSystem(BaseSystem system)
 {
     if (Systems.Contains(system))
     {
         System.Diagnostics.Debug.WriteLine($"System of type {system.GetType()} already registered.");
     }
     else
     {
         Systems.Add(system);
     }
 }