mirror of
https://github.com/vknet/vk.git
synced 2026-07-20 13:23:29 +00:00
32 lines
No EOL
598 B
C#
32 lines
No EOL
598 B
C#
using System.Reflection;
|
|
using System.Windows.Controls;
|
|
|
|
namespace VkNet.Wpf
|
|
{
|
|
public static class WebBrowserExtensions
|
|
{
|
|
public static void SetSilent(this WebBrowser wb)
|
|
{
|
|
var fiComWebBrowser = typeof(WebBrowser)
|
|
.GetField("_axIWebBrowser2",
|
|
BindingFlags.Instance|BindingFlags.NonPublic);
|
|
|
|
if (fiComWebBrowser == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
var objComWebBrowser = fiComWebBrowser.GetValue(wb);
|
|
|
|
objComWebBrowser?.GetType()
|
|
.InvokeMember("Silent",
|
|
BindingFlags.SetProperty,
|
|
null,
|
|
objComWebBrowser,
|
|
new object[]
|
|
{
|
|
true
|
|
});
|
|
}
|
|
}
|
|
} |