Fetch the repository succeeded.
This action will force synchronization from wxd_tony1984/DevelopAssistant, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Kyozy.Wke;
namespace ICSharpCode.WinFormsUI.Controls
{
public partial class DocoFormatControl : TextBoxBase
{
private IntPtr ControlHandle = IntPtr.Zero;
private Color borderColor = SystemColors.ControlDark;
Kyozy.Wke.WebView webView = new Kyozy.Wke.WebView();
public DocoFormatControl()
{
InitializeComponent();
InitializeControl();
}
public override string Text
{
get
{
GetContent();
return text;
}
set
{
text = value;
}
}
public void InitializeControl()
{
Kyozy.Wke.WebView.Init();
//this.webBrowser1.Url = new System.Uri(Application.StartupPath + "\\kindeditor\\index.html", System.UriKind.Absolute);
//this.webBrowser1.ObjectForScripting = this;
webView.Bind(this.WebBrowserView, false);
webView.OnDocumentReady += new EventHandler<DocumentReadyEventArgs>(OnDocumentReady);
webView.OnLoadingFinish += new EventHandler<LoadingFinishEventArgs>(OnLoadingFinish);
WebViewLoadFile("\\kindeditor\\index.html");
//JS.BindFunction("GetContent", new wkeJSNativeFunction(GetContent), 0);
}
public void GetContent()
{
var intptr = webView.WebViewHandle;
if (intptr == IntPtr.Zero)
return;
this.text = JS.ToStr(IntPtr.Zero, webView.RunJS("getContent();"));
}
public void OnDocumentReady(object sender, DocumentReadyEventArgs args)
{
//
}
public void OnLoadingFinish(object sender, LoadingFinishEventArgs args)
{
if (!string.IsNullOrEmpty(text))
{
var value = text.Replace('\n', ' ');
webView.RunJS("setContent('" + value + "');");
}
}
public void WebViewLoadFile(string Path)
{
string address = Application.StartupPath + Path;
webView.LoadFile(address);
}
protected override void OnCreateControl()
{
base.OnCreateControl();
if (webView.WebViewHandle == IntPtr.Zero)
{
webView.Bind(this.WebBrowserView, false);
WebViewLoadFile("\\kindeditor\\index.html");
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle,
borderColor, 1, ButtonBorderStyle.Solid, //左边
borderColor, 1, ButtonBorderStyle.Solid, //上边
borderColor, 1, ButtonBorderStyle.Solid, //右边
borderColor, 1, ButtonBorderStyle.Solid);//底边
}
public override void ReleaseDispose()
{
webView.UnBind();
base.ReleaseDispose();
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。