Beispiel #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            foreach (var item in PlugManager.GetPlugs())
            {
                item.Load(this);
            }

            //初始化浏览器
            var rooturl = ConfigurationManager.AppSettings.Get("Root");

            if (!rooturl.EndsWith("/"))
            {
                rooturl += "/";
            }

            this.webBrowser1.Navigate(rooturl);
        }
Beispiel #2
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                if (webBrowser1.Document != null)
                {
                    var obj = webBrowser1.Document.InvokeScript("onCloseApp");
                    if (obj != null && obj is bool)
                    {
                        e.Cancel = (bool)obj;
                    }
                }
            }
            catch
            {
            }

            PlugManager.Clear();
        }