/// <summary> /// Request the user consent. /// 사용자 동의 메소드 /// </summary> public async void RequestUserConsent() { // Create the MapService for the HERE provider // s_maps 초기화 s_maps = new MapService("HERE", HERE_KEY); // Request the user consent // The user consent popup will be displayed if the value is false // 값이 false일 경우 사용자 동의 팝업이 표시됩니다. await s_maps.RequestUserConsent(); // Check the user's choice in the user consent popup // 사용자 동의 팝업에서 사용자의 선택을 체크합니다. // 사용자가 동의 하지 않으면 s_maps를 Dispose하고 앱 종료. if (s_maps.UserConsented != true) { // Dispose the s_maps s_maps.Dispose(); s_maps = null; // Close this app Exit(); } else // 사용자가 동의하면 { // Create a base UI // 기본 UI 나오게 Initialize(); } }
/// <summary> /// Request the user consent. /// </summary> public async void RequestUserConsent() { // Create the MapService for the HERE provider s_maps = new MapService("HERE", HERE_KEY); // Request the user consent // The user consent popup will be displayed if the value is false await s_maps.RequestUserConsent(); // Check the user's choice in the user consent popup if (s_maps.UserConsented != true) { // Dispose the s_maps s_maps.Dispose(); s_maps = null; // Close this app Exit(); } else { // Create a base UI Initialize(); } }
/// <summary> /// Remove the used resource and Close the Map. /// </summary> public void CloseApp() { // Remove the used resource ClearData(); if (win != null) { // Unrealize the Window object win.Unrealize(); win = null; } // check the s_mapview if (s_mapview != null) { // Dispose the MapView s_mapview.Dispose(); s_mapview = null; } // check the s_maps if (s_maps != null) { // Dispose the MapService s_maps.Dispose(); s_maps = null; } Exit(); }
public void Update() { if (mapServices.Count != 0 && !IsDone) { MapService service = mapServices.First(); if (service.OnTheDoor) { service.OnTheDoor = false; configFiles.Dequeue(); if (configFiles.Count == 0) { IsDone = true; return; } MapService secondService = new MapService(characterService, configFiles.Peek(), loader, stub, controller, device); mapServices.AddLast(secondService); mapServices.RemoveFirst(); service.Dispose(); Level++; } if (characterService.Character.IsAlive) { mapServices.First().Update(); } else if (!characterService.Character.IsAlive && controller[SharpDX.DirectInput.Key.R]) { characterService.Character.IsAlive = true; characterService.Character.SetDefault(); characterService.Character.Health = Character.HEALTH; mapServices.RemoveFirst(); mapServices.AddLast(new MapService(characterService, configFiles.Peek(), loader, stub, controller, device)); } } }
public void Dispose() { while (mapServices.Count != 0) { MapService service = mapServices.First(); mapServices.RemoveFirst(); service.Dispose(); } }
/// <summary> /// Remove the used resource and close the app. /// </summary> public void CloseApp() { // Remove the used resource ClearData(); // check the viewCtxPopup if (viewCtxPopup != null) { // Dismiss the ContextPopup object viewCtxPopup.Dismiss(); viewCtxPopup = null; } // check the categoryCtxPopup if (categoryCtxPopup != null) { // Dismiss the ContextPopup object categoryCtxPopup.Dismiss(); categoryCtxPopup = null; } // check the s_mapview if (s_mapview != null) { // Dispose the MapView s_mapview.Dispose(); s_mapview = null; } // check the s_maps if (s_maps != null) { // Dispose the MapService s_maps.Dispose(); s_maps = null; } // check the window if (window != null) { // Unrealize the Window object window.Unrealize(); window = null; } Exit(); }
protected override async void OnElementChanged(ElementChangedEventArgs <MapComponent> e) { if (e.OldElement is object && Control != null) { Control.Resized -= OnMapViewResized; } if (e.NewElement is object) { if (Control is null) { var mapService = new MapService(Config.ProviderName, Config.AuthenticationToken); bool consentGiven = await mapService.RequestUserConsent(); if (consentGiven) { var control = new MapView(Forms.NativeParent, mapService) { MapType = MapTypes.Normal, ScaleBarEnabled = false, MinimumZoomLevel = Config.MinimumMapZoom, MaximumZoomLevel = Config.MaximumMapZoom, ZoomLevel = Config.InitialMapZoom, }; SetNativeControl(control); } mapService?.Dispose(); } if (Control != null) { Control.Resized += OnMapViewResized; } Element.Map = Control; Element.InvokeMapInitialized(); } base.OnElementChanged(e); }
/// <summary> /// Remove the used resource and terminate this application. /// </summary> public void CloseApp() { // Remove the used data ClearData(); // Remove all the map object from the map view if (s_mapview != null) { s_mapview.LongPressed -= MapViewLongPressed; s_mapview.Dispose(); s_mapview = null; } // Remove all the map object from the map view if (s_maps != null) { s_maps.Dispose(); s_mapview = null; } Exit(); }