本文整理汇总了C#中WebView.StopLoading方法的典型用法代码示例。如果您正苦于以下问题:C# WebView.StopLoading方法的具体用法?C# WebView.StopLoading怎么用?C# WebView.StopLoading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebView
的用法示例。
在下文中一共展示了WebView.StopLoading方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.WebViewBrowser);
web = FindViewById<WebView>(Resource.Id.Web);
web.Settings.JavaScriptEnabled = true;
web.LoadUrl("http://xamarin.com/");
web.SetWebViewClient(new MonkeyWebViewClient());
// allow zooming/panning
web.Settings.BuiltInZoomControls = true;
web.Settings.SetSupportZoom(true);
// loading with the page zoomed-out, so you can see the whole thing (like the default behaviour of the real browser)
web.Settings.LoadWithOverviewMode = true;
web.Settings.UseWideViewPort = true;
// scrollbar stuff
web.ScrollBarStyle = ScrollbarStyles.OutsideOverlay; // so there's no 'white line'
web.ScrollbarFadingEnabled = false;
BackButton = FindViewById<Button>(Resource.Id.BackButton);
ForwardButton = FindViewById<Button>(Resource.Id.ForwardButton);
GoButton = FindViewById<Button>(Resource.Id.GoButton);
StopButton = FindViewById<Button>(Resource.Id.StopButton);
UrlText = FindViewById<EditText>(Resource.Id.UrlText);
BackButton.Click += (s, e) => {
web.GoBack();
};
ForwardButton.Click += (s, e) => {
web.GoForward();
};
GoButton.Click += (s, e) => {
web.LoadUrl(UrlText.Text);
};
StopButton.Click += (s, e) => {
web.StopLoading();
};
}
示例2: ShouldOverrideUrlLoading
/// <summary>
///
/// </summary>
public override bool ShouldOverrideUrlLoading(WebView view, string url)
{
Uri uri = new Uri(url);
if (url.StartsWith(BrokerConstants.BrowserExtPrefix))
{
PlatformPlugin.Logger.Verbose(null, "It is browser launch request");
OpenLinkInBrowser(url, ((Activity)view.Context));
view.StopLoading();
((Activity)view.Context).Finish();
return true;
}
if (url.StartsWith(BrokerConstants.BrowserExtInstallPrefix))
{
PlatformPlugin.Logger.Verbose(null, "It is an azure authenticator install request");
view.StopLoading();
this.Finish(view, url);
return true;
}
if (url.StartsWith(BrokerConstants.PKeyAuthRedirect, StringComparison.CurrentCultureIgnoreCase))
{
string query = uri.Query;
if (query.StartsWith("?"))
{
query = query.Substring(1);
}
Dictionary<string, string> keyPair = EncodingHelper.ParseKeyValueList(query, '&', true, false, null);
string responseHeader = PlatformPlugin.DeviceAuthHelper.CreateDeviceAuthChallengeResponse(keyPair).Result;
Dictionary<string, string> pkeyAuthEmptyResponse = new Dictionary<string, string>();
pkeyAuthEmptyResponse[BrokerConstants.ChallangeResponseHeader] = responseHeader;
view.LoadUrl(keyPair["SubmitUrl"], pkeyAuthEmptyResponse);
return true;
}
if (url.StartsWith(callback, StringComparison.CurrentCultureIgnoreCase))
{
this.Finish(view, url);
return true;
}
if (!url.Equals("about:blank", StringComparison.CurrentCultureIgnoreCase) && !uri.Scheme.Equals("https", StringComparison.CurrentCultureIgnoreCase))
{
UriBuilder errorUri = new UriBuilder(callback);
errorUri.Query = string.Format("error={0}&error_description={1}",
MsalError.NonHttpsRedirectNotSupported, MsalErrorMessage.NonHttpsRedirectNotSupported);
this.Finish(view, errorUri.ToString());
return true;
}
return false;
}
开发者ID:AzureAD,项目名称:microsoft-authentication-library-for-dotnet,代码行数:58,代码来源:AuthenticationAgentActivity.cs