本文整理汇总了C#中IRequestCallback.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# IRequestCallback.Dispose方法的具体用法?C# IRequestCallback.Dispose怎么用?C# IRequestCallback.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRequestCallback
的用法示例。
在下文中一共展示了IRequestCallback.Dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
{
try
{
//To allow certificate
//callback.Continue(true);
//return true;
return false;
}
finally
{
callback.Dispose();
}
}
示例2:
CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback)
{
try
{
//Note to Redirect simply set the request Url
//if (request.Url.StartsWith("https://www.google.com", StringComparison.OrdinalIgnoreCase))
//{
// request.Url = "https://github.com/";
//}
//Callback in async fashion
//callback.Continue(true);
//return CefReturnValue.ContinueAsync;
}
finally
{
callback.Dispose();
}
return CefReturnValue.Continue;
}
示例3:
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
{
callback.Dispose();
return false;
}
示例4: OnQuotaRequest
public bool OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize, IRequestCallback callback) {
if (!callback.IsDisposed) {
callback.Dispose();
}
return true;
}
示例5: OnBeforeResourceLoad
public CefReturnValue OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback) {
if (RequestsFiltering.ShouldBeBlocked(request.Url)) {
if (!callback.IsDisposed) {
callback.Dispose();
}
return CefReturnValue.Cancel;
}
var headers = request.Headers;
headers[@"User-Agent"] = UserAgent;
request.Headers = headers;
return CefReturnValue.Continue;
}
示例6: OnCertificateError
public bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) {
if (!callback.IsDisposed) {
callback.Dispose();
}
Logging.Warning(requestUrl);
return false;
}