同步操作将从 wxd_tony1984/DevelopAssistant 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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();}}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。