コード例 #1
0
        private static void UpdateActiveRoutes()
        {
            var activeRoutesSummary = ActiveRoutes.GetActiveRoutes();

            // Add new routes from active route set
            foreach (var activeRouteSummary in activeRoutesSummary)
            {
                if (!activeRoutes.ContainsKey(activeRouteSummary.ID))
                {
                    LoadRoute(activeRouteSummary.ID);
                }
            }

            // Remove local memory routes not in active route set
            var localRouteIDs = activeRoutes.Keys.ToList();

            foreach (var routeID in localRouteIDs)
            {
                if (activeRoutesSummary.Find(rt => rt.ID == routeID) == null)
                {
                    activeRoutes.Remove(routeID);
                }
            }
        }
コード例 #2
0
 // Mapped as - GET: api/Routes/Active
 public List <RouteSummary> Get()
 {
     return(ActiveRoutes.GetActiveRoutes());
 }