示例#1
0
        public void PickerSelectedIndexChanged(
            object sender
            , System.EventArgs e
            )
        {
            _view.ExibirLoad();
            Picker temp = (Picker)sender;

            ComandoDto comando = (ComandoDto)temp.SelectedItem;

            if (comando != null)
            {
                if (comando.IdObjeto != ComandoGlobal.IdObjeto)
                {
                    ComandoGlobal = new ComandoDto();
                    ComandoGlobal.Clone(comando);

                    if (ComandoGlobal.TipoAtuador == (Int32)EnumTipoAtuador.ComandoComParametro)
                    {
                        BuscaParametros(ComandoGlobal);
                    }
                    else
                    {
                        ServiceResult <List <ComandoParametroDto> > result
                            = new ServiceResult <List <ComandoParametroDto> >();

                        List <ComandoParametroDto> lst = new List <ComandoParametroDto>();
                        lst.Add(new ComandoParametroDto()
                        {
                            IdParametro     = 0,
                            Label           = AppResources.StatusOutput,
                            IdTipoParametro = (int)EnumTipoParametro.AtivacaoSaida,
                            Valor           = "1",
                            Dominio         = String.Format(
                                "0|{0};1|{1}"
                                , AppResources.Desativar
                                , AppResources.Ativar
                                ),
                            Ordem = 0
                        });

                        result.Data = lst;

                        BuscaParametros_Finish(result);
                    }
                }
                else
                {
                    _view.EscondeLoad();
                }
            }
            else
            {
                _view.EscondeLoad();
                ParameterBoxBindingContext = null;
            }
        }
示例#2
0
        public override void OnAppearing()
        {
            this.DefaultTemplateBuild();


            TxtSubTitulo = PosicaoUnidadeRastreada.IdentificacaoUnidadeRastreada;

            _view.ExibirLoad();
            ComandoGlobal = new ComandoDto();
            BuscarComando();
        }
示例#3
0
        private void BuscaParametros(
            ComandoDto paramComando
            )
        {
            ServiceResult <List <ComandoParametroDto> > result = new ServiceResult <List <ComandoParametroDto> >();

            try
            {
                _tokensourceAction = new CancellationTokenSource();
                Task.Run(async() =>
                {
                    try
                    {
                        result = await Model.ListParametros(
                            PosicaoUnidadeRastreada.IdRastreador
                            , paramComando.IdObjeto
                            , _tokensourceAction.Token
                            );
                    }
                    catch
                    {
                        result.IsValid      = false;
                        result.MessageError = "ErroInesperado";
                    }
                    finally
                    {
                        BuscaParametros_Finish(result);
                    }
                }, _tokensourceAction.Token);
            }
            catch
            {
                result.IsValid      = false;
                result.MessageError = "ErroInesperado";

                BuscaParametros_Finish(result);
            }
        }