Exemple #1
0
        public map(List<string> msg)
        {
            if (msg.Count <= 1)
            {
                gMapType = G_MAP.G_Unknown;
            }
            else
            {
                for (int i = 1; i < msg.Count; i++ )
                    uMsg += msg[i]+" ";

                gMapType = CheckInputType();
            }
        }
Exemple #2
0
        public map(List <string> msg)
        {
            if (msg.Count <= 1)
            {
                gMapType = G_MAP.G_Unknown;
            }
            else
            {
                for (int i = 1; i < msg.Count; i++)
                {
                    uMsg += msg[i] + " ";
                }

                gMapType = CheckInputType();
            }
        }
Exemple #3
0
        /// <summary>
        /// Smart check the input type
        /// </summary>
        /// <returns></returns>
        private G_MAP CheckInputType()
        {
            G_MAP type = G_MAP.G_Unknown;

            /*
             * Rules:
             * Coordinates must be separated by ',' and
             * */
            string tmpMsg = uMsg.Replace('+', '0').Replace('-', '0').Replace(' ', '0').Replace(',', '0').Replace('.', '0');

            if (Regex.IsMatch(tmpMsg, @"^[0-9]+$"))
            {
                type = G_MAP.G_GetAddress;
            }
            else
            {
                type = G_MAP.G_GetCoordinates;
            }
            return(type);
        }