Skip to content

Instantly share code, notes, and snippets.

View tiagocrizanto's full-sized avatar

Tiago Crizanto tiagocrizanto

View GitHub Profile
// startup e configuração de autenticação
GlobalConfiguration.Configuration.UseSqlServerStorage(ConfigurationManager.ConnectionStrings["ConnectionsString"].ConnectionString);
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] { new HangfireSecurityFilter() }
});
app.UseHangfireServer();
// exemplo do filtro
public class HangfireSecurityFilter : IDashboardAuthorizationFilter
public partial class MainPage : ContentPage
{
private MainPage _mainPage;
public MainPage()
{
InitializeComponent();
_mainPage = this;
hwebview.Username = "username"; //usually active directory user
hwebview.Password = "password";
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ProxyWebView.Htttp; assembly=ProxyWebView"
x:Class="ProxyWebView.MainPage">
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<!--Webview genérica-->
<!--<WebView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="AliceBlue" x:Name="webview"/>-->
[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
namespace ProxyWebView.iOS
{
public class HybridWebViewRenderer : ViewRenderer<HybridWebView, WKWebView>
{
WKUserContentController userController;
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
namespace FcaBrain.Droid.Renderers
{
public class HybridWebViewRenderer : WebViewRenderer
{
private new HybridWebView Element { get { return (HybridWebView)base.Element; } }
public HybridWebViewRenderer(Android.Content.Context context) : base(context) { }
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.WebView> e)
public class HybridWebView : WebView
{
public HybridWebView()
{
}
public static readonly BindableProperty UsernameProperty =
BindableProperty.Create("UserName", typeof(string), typeof(HybridWebView), null, BindingMode.TwoWay);
public static readonly BindableProperty PasswordProperty =