//This is akin to ServiceConnected in Android Map2DOnline private static void buildings_LoadCompleted(object sender, LoadCompletedEventArgs e) { if (e.Error == null) { // Handling for a paged data feed. if (buildings.Continuation != null) { // Automatically load the next page. buildings.LoadNextPartialSetAsync(); } else { //The data is ready foreach (Building b in buildings) { CurrentBuilding = b; //TODO: Currently, LoadEdges just loops through the edges and does nothing LoadEdges(CurrentBuilding); break; } } } else { CurrentBuilding = null; } //Now notify the observers //we just let the observers know that something has happened. //They can then check if CurrentBuilding != null //TODO: MAYBE just replace this with WifiStatusChanged, where the Status is RADIOMAP_DOWNLOADED if (OnBuildingDownload != null) //any observers? OnBuildingDownload(null, null); }
public UiBing_Map2DEditLinks() { //NOTE: DER ER MASSER AF REDUNDANS MELLEM ONLINE OG OFFLINE FASEN InitializeComponent(); InitializeMenu(); InitializeMap(); InitializeUploadDialog(); _currentBuilding = LocationService.CurrentBuilding; mWebMapCommon = new Map2DEditLinks(); SetupEventHandlers(); //force map update mWebMapCommon.handleMapReady(); }
/// <summary> /// NOTE: This is a temporary solution to fill out edges' vertices. /// In the future do this already when we are setting up edges. /// </summary> /// <param name="building"></param> private static void LoadEdges(Building building) { foreach (Edge e in building.Edges) { Vertex origin = building.Vertices.FirstOrDefault(v => v.ID == e.vertexOrigin); Vertex destination = building.Vertices.FirstOrDefault(v => v.ID == e.vertexDestination); if (!e.Vertices.Contains(origin)) { e.Vertices.Add(origin); //TODO: Kender vertices deres edges? origin.Edges.Add(e); } if (!e.Vertices.Contains(destination)) { e.Vertices.Add(destination); destination.Edges.Add(e); } } }
private void Initialize() { _currentBuilding = LocationService.CurrentBuilding; //Update the map when changes occur. LocationService.OnBuildingDownload += new EventHandler(LocationService_OnBuildingDownload); }