Ejemplo n.º 1
0
        public static GAPPSF.Core.Data.WaypointType GetWaypointType(string keyWord)
        {
            GAPPSF.Core.Data.WaypointType result = null;

            keyWord = keyWord.ToLower();
            result  = (from gt in Core.ApplicationData.Instance.WaypointTypes
                       where gt.Name.ToLower().Contains(keyWord)
                       select gt).FirstOrDefault();
            if (result == null)
            {
                //Groundspeak renamed waypoint types
                //be sure to be able to handle both
                if ("question to answer".Contains(keyWord))
                {
                    result = GetWaypointType(218);
                }
                else if ("stages of a multicache".Contains(keyWord))
                {
                    result = GetWaypointType(219);
                }
            }
            if (result == null)
            {
                //take special ID
                result = GetWaypointType(0);
            }
            return(result);
        }
Ejemplo n.º 2
0
 protected void addWaypointType(int id, string name)
 {
     Data.WaypointType attr = new Data.WaypointType();
     attr.ID   = id;
     attr.Name = name;
     WaypointTypes.Add(attr);
 }
Ejemplo n.º 3
0
        public static GAPPSF.Core.Data.WaypointType GetWaypointType(int typeId)
        {
            GAPPSF.Core.Data.WaypointType result = null;

            result = (from gt in Core.ApplicationData.Instance.WaypointTypes
                      where gt.ID == typeId
                      select gt).FirstOrDefault();
            if (result == null)
            {
                //take special ID
                result = (from gt in Core.ApplicationData.Instance.WaypointTypes
                          where gt.ID == 0
                          select gt).FirstOrDefault();
            }
            return(result);
        }