private async Task apriWebPage(EnumAmbiente ambiente, EnumWebPage webPage) { try { if (_isTapped) { return; } _isTapped = true; if (needLandscape(webPage)) { DependencyService.Get <IOrientation>().ReverseLandscape(); } else { DependencyService.Get <IOrientation>().Portrait(); } await Application.Current.MainPage.Navigation.PushModalAsync(new WebViewPage(getUrl(ambiente, webPage))); _isTapped = false; } catch (Exception ex) { _isTapped = false; await Application.Current.MainPage.DisplayAlert(AppResources.Attenzione, ex.Message, AppResources.Ok); } }
private string getUrl(EnumAmbiente ambiente, EnumWebPage webPage) { switch (webPage) { default: return("http://www.google.com"); } }
/// <summary> /// /// </summary> public Startup(IConfiguration configuration) { Configuration = configuration; UseAzureAD = Configuration.GetValue <bool>("UseAzureAD"); UseSwagger = Configuration.GetValue <bool>("UseSwagger"); UseInMemoryDataBase = Configuration.GetValue <bool>("UseInMemoryDataBase"); UseGenerateData = Configuration.GetValue <bool>("UseGenerateData"); UseAuthorize = Configuration.GetValue <bool>("UseAuthorize"); _ambiente = Configuration.GetValue <EnumAmbiente>("Ambiente"); }
public MenuViewModel(EnumAmbiente ambiente) { Titolo = getTitolo(ambiente); TestCommand = new Command(async() => { await apriWebPage(ambiente, EnumWebPage.Test); }); OnAppearingCommand = new Command(() => { DependencyService.Get <IOrientation>().Unspecified(); }); }
private string getTitolo(EnumAmbiente ambiente) { switch (ambiente) { case EnumAmbiente.PreProd: return(AppResources.PreProduzione); case EnumAmbiente.Prod: return(AppResources.Produzione); case EnumAmbiente.Soluzione1: return(AppResources.Soluzione1); default: return(AppResources.AmbienteNonDefinito); } }
public TIdentificacaoRps(EnumAmbiente ambiente) { FAmbiente = ambiente; }