//Handle the route button clicked event private void RouteButton_Clicked(object sender, EventArgs e) { double Latitude = Current.SelectedItem.Latitude + ((Current.CU.Latitude - Current.SelectedItem.Latitude) / 2); //Variable that stores the latitude point between the selectedItem it's latitude and the user it's latitude position double Longitude = Current.SelectedItem.Longitude + ((Current.CU.Longitude - Current.SelectedItem.Longitude) / 2); //Variable that stores the longitude point between the selectedItem it's longitude and the user it's longitude position double Zoom = 14; //zoom range: 2 - 21 Task.Run(() => { Device.BeginInvokeOnMainThread(async() => { await Finder.TranslateTo(0, 587.5, 200); Position FullRoutePosition = new Position(Latitude, Longitude); await Current.CustomMap.AnimateCamera(CameraUpdateFactory.NewPositionZoom(FullRoutePosition, Zoom), TimeSpan.FromSeconds(2.5)); //Animate the camera of the map to the FullRoute position of the user with a calculated zoom level and in a timespan of 2.5 seconds Thread.Sleep(2500); //Thread will stop for 2.5 seconds Current.UpdateCamera = true; //Allow camera updates Position LocationUser = new Position(Current.CU.Latitude, Current.CU.Longitude); await Current.CustomMap.AnimateCamera(CameraUpdateFactory.NewPositionZoom(LocationUser, 17.5), TimeSpan.FromSeconds(2.5)); //Animate the camera of the map to the position of the user with a zoom of 17.5 and in a timespan of 2.5 seconds await SubContent.FadeTo(0, 125); //Makes the SubContent of the current page fade out in 125 ms await Finder.TranslateTo(0, 400, 200); Current.FV.Children[0] = new DirectionsView(); //Changes the value of the grid FV to the new DirectionsView page }); }); }
public async Task <bool> Run(SubContent <TMensagem> mensagem) { bool result = false; IWampClientConnectionMonitor monitor = this._channel.RealmProxy.Monitor; if (string.IsNullOrEmpty(mensagem.NomeFila)) { throw new Exception("Informe um tópico!!"); } monitor.ConnectionBroken += OnClose; monitor.ConnectionError += OnError; IWampRealmServiceProvider services = this._channel.RealmProxy.Services; ISubject <TMensagem> helloSubject = services.GetSubject <TMensagem>(mensagem.NomeFila); IDisposable subscription = helloSubject.Subscribe <TMensagem>(x => { mensagem.MessageListener(x); }); result = true; return(result); }
//Handle the info button clicked event private async void InfoButton_Clicked(object sender, EventArgs e) { await SubContent.FadeTo(0, 125); //Makes the SubContent of the current page fade out in 125 ms await Finder.TranslateTo(0, 64, 200); Current.FV.Children[0] = new InfoView(); //Changes the value of the grid FV to the new InfoView page }
public bool ContainsText(string query) { // if the query is empty, return true if (string.IsNullOrEmpty(query) || string.IsNullOrWhiteSpace(query)) { return(true); } // if the query is not empty test return ((!string.IsNullOrEmpty(Markdown) && Markdown.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0) || SubContent.Any(s => s.ContainsText(query))); }
IEnumerator DisplayLoadingScreen(int level) { if (blackScreen != null) { blackScreen.SetActive(true); } if (textNumber != null) { textNumber.SetActive(true); } if (shadow != null) { shadow.SetActive(true); } if (loadCircle != null) { loadCircle.SetActive(true); } if (textArea != null) { textArea.SetActive(true); } SubContent subC = GeneralFinder.informativeManager.c_getRandomSubContent(); if (subC != null) { if (screenImage != null && subC.image != null) { screenImage.sprite = subC.image; //Debug.Log ("immagini sub content"); if (textArea != null) { Text t = textArea.GetComponent <Text>(); t.text = subC.infoText.text; } } } else { if (screenImage != null && images[randomNum] != null) { screenImage.sprite = images[randomNum]; if (textArea != null) { textArea.SetActive(false); } //Debug.Log ("immagini"); } } for (int i = 0; i < canvasToDisable.Length; i++) { if (canvasToDisable[i] != null) { canvasToDisable[i].SetActive(false); } } async = Application.LoadLevelAsync(level); async.allowSceneActivation = false; //Debug.Log ("cerco di avviare il livello " + level); while (loadProgressFloat < 0.85f) { loadProgressFloat = async.progress; loadProgress = (int)(loadProgressFloat * 100); //Debug.Log (loadProgress); if (textUI != null) { textUI.text = loadProgress.ToString(); } //barTransform.localScale = new Vector3(loadProgressFloat, 1.0f, 1.0f); yield return(null); } yield return(new WaitForSeconds(extraLoadTime)); loadProgressFloat = 1.0f; loadProgress = 100; if (textUI != null) { textUI.text = loadProgress.ToString(); } loadEnded = true; loadCircle.SetActive(false); textNumber.SetActive(false); pressButton.SetActive(true); while (!async.isDone) { yield return(null); } //attendi utente che preme continua }