mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Discord Plugin Source
Added discord plugin source to github
This commit is contained in:
parent
4a163627b8
commit
6f671a9d57
50 changed files with 3673 additions and 0 deletions
32
Plugins/Discord/source/Plugin.Discord/Lib/BrowserBehavior.cs
Normal file
32
Plugins/Discord/source/Plugin.Discord/Lib/BrowserBehavior.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ServerManagerTool.Plugin.Discord
|
||||
{
|
||||
public static class BrowserBehavior
|
||||
{
|
||||
public static readonly DependencyProperty HtmlProperty = DependencyProperty.RegisterAttached("Html", typeof(string), typeof(BrowserBehavior), new FrameworkPropertyMetadata(OnHtmlChanged));
|
||||
|
||||
[AttachedPropertyBrowsableForType(typeof(WebBrowser))]
|
||||
public static string GetHtml(WebBrowser d)
|
||||
{
|
||||
return (string)d.GetValue(HtmlProperty);
|
||||
}
|
||||
|
||||
public static void SetHtml(WebBrowser d, string value)
|
||||
{
|
||||
d.SetValue(HtmlProperty, value);
|
||||
}
|
||||
|
||||
static void OnHtmlChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.NewValue == null)
|
||||
return;
|
||||
|
||||
if (d is WebBrowser wb)
|
||||
{
|
||||
wb.NavigateToString(e.NewValue as string);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue