public void finalizarRotacao()
        {
            //Interlocked.Exchange(ref _cancellation, new CancellationTokenSource()).Cancel();
            var regraServico = ServicoFactory.create();

            if (regraServico is BannerServicoBLL)
            {
                ((BannerServicoBLL)regraServico).BannerAtual = null;
            }
            System.Diagnostics.Debug.WriteLine("Banner: Finalizando rotação...");
        }
Exemple #2
0
        /*
         * private async Task produtoAoCarregar(object sender, ProdutoListaEventArgs args)
         * {
         *  var regraProduto = ProdutoFactory.create();
         *  var produtos = new List<ProdutoInfo>();
         *  int i = 0;
         *  foreach (var produto in await regraProduto.listar(15)) {
         *      produtos.Add(produto);
         *      i++;
         *      if (i >= 10) {
         *          break;
         *      }
         *  }
         *  args.Produtos = produtos;
         *  return;
         * }
         */

        private static async void verificarSeguimento()
        {
            var seguimentoPage = await LojaUtils.gerarTelaInicial();

            //NavigationPage.SetHasNavigationBar(seguimentoPage, false);
            seguimentoPage.Appearing += (sender, e) => {
                PermissaoUtils.pedirPermissao();
                var regraServico = ServicoFactory.create();
                regraServico.inicializar();
            };
            App.Current.MainPage = gerarRootPage(seguimentoPage);

            /*
             * App.Current.MainPage = new IconNavigationPage(seguimentoPage)
             * {
             *  BarBackgroundColor = Estilo.Current.BarBackgroundColor,
             *  BarTextColor = Estilo.Current.BarTitleColor
             * };
             */
        }
        public void inicializarRotacao()
        {
            System.Diagnostics.Debug.WriteLine("Banner: Iniciando rotação...");
            var regraServico = ServicoFactory.create();

            if (regraServico is BannerServicoBLL)
            {
                ((BannerServicoBLL)regraServico).BannerAtual = this;
            }

            /**
             * //CancellationTokenSource cancelamento = _cancellation;
             * Device.StartTimer(TimeSpan.FromSeconds(3), () => {
             *  if (_cancellation.IsCancellationRequested) {
             *      return false;
             *  }
             *  if (ItemsSource == null || ItemsSource.GetCount() == 0) {
             *      return false;
             *  }
             *  var posicaoAtual = this.Position;
             *  posicaoAtual++;
             *  if (posicaoAtual >= ItemsSource.GetCount()) {
             *      posicaoAtual = 0;
             *  }
             *  Device.BeginInvokeOnMainThread(() => {
             *      this.Position = posicaoAtual;
             *      System.Diagnostics.Debug.WriteLine(
             *          string.Format(
             *              "Banner: {0}, Posição {1}",
             *              DateTime.Now.ToString("HH:mm:ss"),
             *              posicaoAtual
             *          )
             *      );
             *  });
             *  return true;
             * });
             */
        }