Exemple #1
0
        public void DisplayGallery(List <GalleryImage> images)
        {
            int offsetLeft = 10,
                offsetTop  = 5;

            int left = offsetLeft,
                top = (int)TakePicture.Frame.Height + 5,
                imgHeight = 50, imgWidth = 50,
                frameWidth = (int)View.Frame.Width;


            Task.Run(() =>
            {
                foreach (var img in images)
                {
                    var uiImg = UIImage.LoadFromData(NSData.FromUrl(new NSUrl(img.url)));

                    if (left + imgWidth + offsetLeft > frameWidth)
                    {
                        left = offsetLeft;
                        top += imgHeight + offsetTop;
                    }

                    InvokeOnMainThread(() =>
                    {
                        UIButton btn = new UIButton(new CGRect(left, top, imgWidth, imgHeight));
                        btn.SetImage(uiImg, UIControlState.Normal);
                        btn.TouchUpInside += ((object sender, EventArgs e) =>
                        {
                            var imgToDisplay = ((UIButton)sender).ImageView.Image;

                            var btnImg = UIButton.FromType(UIButtonType.Custom);
                            btnImg.BackgroundColor = UIColor.Black;
                            btnImg.Frame = new CGRect(0, 0, View.Frame.Width, View.Frame.Height);
                            btnImg.SetImage(imgToDisplay, UIControlState.Normal);

                            btnImg.TouchUpInside += ((object sender2, EventArgs e2) => {
                                NavigationController.DismissModalViewController(true);
                            });

                            UIViewController ctrl = new UIViewController();
                            ctrl.View.Add(btnImg);

                            NavigationController.PresentModalViewController(ctrl, true);
                        });

                        GalleryView.AddSubview(btn);
                    });

                    left += imgWidth + offsetLeft;
                }

                InvokeOnMainThread(() => {
                    _spinner.Hide();
                });
            });
        }
Exemple #2
0
    public void Info()
    {
        _showInfo = true;

        spinner.Hide();

        MontlyButton.GetComponent <ButtonHover> ().selected = false;
        TotalButton.GetComponent <ButtonHover>().selected   = false;
        RewardsButton.GetComponent <ButtonHover>().selected = true;

        MonthlyContentPanel.parent.gameObject.SetActive(false);
        TotalContentPanel.parent.gameObject.SetActive(false);
        RewardsContentPanel.parent.gameObject.SetActive(true);
    }
        private void CargarTitulo(Guid _Tituloid)
        {
            UcFiltrosLibros.Spinner.Show();

            int pageTotal = 0;

            var    codigoProveedor     = UcFiltrosLibros.CodigoProveedor;
            var    codigoLibroCompleto = Uow.Titulos.Obtener(t => t.Id == _Tituloid).Cod;;//UcFiltrosLibros.CodigoLibroCompleto;
            var    isbn           = UcFiltrosLibros.ISBN;
            var    nombreTitulo   = UcFiltrosLibros.NombreTitulo;
            var    proveedorId    = UcFiltrosLibros.ProveedorId;
            var    temaId         = UcFiltrosLibros.TemaId;
            var    autorNombre    = UcFiltrosLibros.AutorNombre;
            var    editorialId    = UcFiltrosLibros.EditorialId;
            var    conStock       = UcFiltrosLibros.ConStock;
            var    sucursalId     = this.Context.SucursalActual.Id;
            var    conOchoDeMarzo = UcFiltrosLibros.OchoDeMarzo;
            string codigoBarra    = UcFiltrosLibros.CodigoBarra;
            var    activos        = UcFiltrosLibros.Activos;

            var titulos = _tituloNegocio.Listado(SortColumn, SortDirection, codigoProveedor, codigoLibroCompleto, isbn,
                                                 codigoBarra, nombreTitulo, proveedorId, temaId,
                                                 autorNombre, editorialId, conStock, sucursalId, conOchoDeMarzo, activos,
                                                 TitulosPager.CurrentPage,
                                                 TitulosPager.PageSize,
                                                 out pageTotal);

            GridTitulos.DataSource = titulos;

            TitulosPager.UpdateState(pageTotal);

            Spinner.Hide();
        }
Exemple #4
0
 private void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     Spinner.Hide();
     LockComponents(false);
     if (Singleton.Usuario.IsLogged)
     {
         this.Close();
     }
 }
 private void OnProceed(object sender, RoutedEventArgs e)
 {
     Spinner.Show();
     using (new WaitCursor())
     {
         currentView.RunAnalysis();
         DisplayWorkspaceDetails?.Invoke(this, new EventArgs());
         WorkspaceProvider.AutoSaveProject(ProjectDetails);
     }
     Spinner.Hide();
     Close();
 }
        protected override async Task <HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        {
            _spinner.Show();

            if (await _storageService.ContainKeyAsync("User"))
            {
                var userInfo = await _storageService.GetItemAsync <LoginResponse>("User");

                var token = userInfo.Token;
                request.Headers.Add("Authorization", "Bearer " + token);
            }
            else
            {
                _spinner.Hide();
                return(new HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized));
            }

            var response = await base.SendAsync(request, cancellationToken);

            _spinner.Hide();
            return(response);
        }
Exemple #7
0
        /// <summary>
        /// This occurs on asynchronous basis
        /// </summary>
        /// <param name="Q"></param>
        /// <param name="A"></param>
        private void AsyncResultChanged(string Q, string A)
        {
            this.Dispatcher.Invoke(() =>
            {
                if (A.StartsWith("SUDO:") == false)
                {
                    //Play results audio
                    AudioHandler.Results();

                    //Hide the spinner
                    Spinner.Hide();

                    //Hide the hypothesis
                    var da = new DoubleAnimation(0, TimeSpan.FromMilliseconds(500));
                    Hypothesis.BeginAnimation(OpacityProperty, da);

                    ResultSheet.Visibility = Visibility.Visible;
                    var sa = FindResource("ResultsAnimation") as Storyboard;
                    sa.Begin();

                    //Speak the answer
                    OpenSpeak.Speak(A);

                    q_label.Content = "\"" + Q + "\"";
                    a_label.Text    = A;
                }
                else
                {
                    //Play results audio
                    AudioHandler.Results();

                    //Hide the spinner
                    Spinner.Hide();

                    //Hide the hypothesis
                    var da = new DoubleAnimation(0, TimeSpan.FromMilliseconds(500));
                    Hypothesis.BeginAnimation(OpacityProperty, da);

                    ResultSheet.Visibility = Visibility.Visible;
                    var sa = FindResource("ResultsAnimation") as Storyboard;
                    sa.Begin();

                    //Speak the answer
                    OpenSpeak.Speak(A.Replace("SUDO:", ""));

                    q_label.Content = "\"" + Q + "\"";
                    a_label.Text    = "Here's what I've got";
                }
            });
        }
Exemple #8
0
        /// <summary>
        /// Occurs when the result has come back to MainWindow
        /// </summary>
        /// <param name="Q">The Question / Query asked by the user</param>
        /// <param name="A">The result for it</param>
        private void HandleResult(string Q, string A)
        {
            //Hide the spinner
            Spinner.Hide();

            //Hide the hypothesis
            var da = new DoubleAnimation(0, TimeSpan.FromMilliseconds(500));

            Hypothesis.BeginAnimation(OpacityProperty, da);

            ResultSheet.Visibility = Visibility.Visible;
            var sa = FindResource("ResultsAnimation") as Storyboard;

            sa.Begin();

            q_label.Content = "\"" + Q + "\"";
            a_label.Text    = A;
        }
        public override async Task <int> RefrescarListado()
        {
            UcFiltrosLibros.Spinner.Show();

            int pageTotal = 0;

            var codigoProveedor     = UcFiltrosLibros.CodigoProveedor;
            var codigoLibroCompleto = UcFiltrosLibros.CodigoLibroCompleto;
            var isbn           = UcFiltrosLibros.ISBN;
            var nombreTitulo   = UcFiltrosLibros.NombreTitulo;
            var proveedorId    = UcFiltrosLibros.ProveedorId;
            var temaId         = UcFiltrosLibros.TemaId;
            var autorNombre    = UcFiltrosLibros.AutorNombre;
            var editorialId    = UcFiltrosLibros.EditorialId;
            var conStock       = UcFiltrosLibros.ConStock;
            var sucursalId     = this.Context.SucursalActual.Id;
            var conOchoDeMarzo = UcFiltrosLibros.OchoDeMarzo;
            var codigoBarra    = UcFiltrosLibros.CodigoBarra;
            var activos        = UcFiltrosLibros.Activos;

            var titulos =
                await
                Task.Run(
                    () =>

                    _tituloNegocio.Listado(SortColumn, SortDirection, codigoProveedor, codigoLibroCompleto, isbn,
                                           codigoBarra, nombreTitulo, proveedorId, temaId,
                                           autorNombre, editorialId, conStock, sucursalId, conOchoDeMarzo,
                                           activos,
                                           TitulosPager.CurrentPage,
                                           TitulosPager.PageSize,
                                           out pageTotal));

            GridTitulos.DataSource = titulos;

            TitulosPager.UpdateState(pageTotal);

            Spinner.Hide();

            BtnSeleccionar.Enabled = pageTotal != 0;

            return(pageTotal);
        }
Exemple #10
0
        async void OnSubmitHandle()
        {
            LoadSpinner.Show();
            try
            {
                Model.Email = Subject;
                Model.Text  = Text;
                await HttpService.Post <CallAdminApiModel, MessageApiModel>(ApiUrls.CallToAdmin, Model);

                Toast.ShowSuccess("Повідомлення успішно відправлено!");
                NavigationManager.NavigateTo("/index");
            }
            catch (Exception ex)
            {
                ErrorMessage = ex.Message;
                Toast.ShowError("Помилка. Повідомлення не відправлено!");
                Console.WriteLine("Error Message: " + ErrorMessage);
            }
            finally
            {
                LoadSpinner.Hide();
            }
        }
Exemple #11
0
 private void LoginForm_Load(object sender, EventArgs e)
 {
     Spinner.Hide();
     this.BringToFront();
     txtUsuario.Select();
 }
Exemple #12
0
 // hide everything
 void Start()
 {
     Spinner.Hide();
     StatusText.text = "";
 }