コード例 #1
0
        public void PlayTour(Tour tour)
        {
            //Mostrar la barra de tour
            this.actualTour = tour;
            this.Show();
            tourBar = new AsistimeTourBar()
            {
                Parent = this
            };
            tourBar.Location  = new System.Drawing.Point(0, 0);
            tourBar.StepCount = 0;
            this.Controls.Add(tourBar);
            tourBar.Show();
            this.asistimeAppBar.Hide();

            loadingForm = new LoadingForm();
            loadingForm.Show();

            //Instanciar el controller para el tour
            var tourController = new TourController();

            tour = tourController.GetTourAsync(tour._id).Result;

            // GET AUDIO
            var audioResult = true;

            createDirectory();
            for (int i = 0; i < tour.steps.Count; i++)
            {
                if (tour.steps[i].audio != null)
                {
                    audioResult = audioResult && tourController.GetAudio(tour._id, tour.steps[i]._id).Result;
                }
            }

            tourLoad  = tour;
            countLoad = 0;
            tourBar.TourInititated(tour);

            loadingForm.Close();

            //Reproducir el paso 0
            var firstStep = tour.steps[0];

            webBrowser.Navigate(firstStep.url);
            actualURL = "";


            //Mostrar mensaje de confirmación
            new PopupNotification("Inicio Tour", "Comienza el tour");
        }