示例#1
0
        /// <summary>
        /// 创建窗体
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        public string CreateBrowserWindow(string setting)
        {
            if (string.IsNullOrEmpty(setting))
            {
                return("参数错误!");
            }
            string        result        = string.Empty;
            WindowSetting windowSetting = Global.GetWindowSetting(setting);

            setting = JsonConvert.SerializeObject(windowSetting);
            frmScBrowser newWindow = new frmScBrowser(setting);

            if (windowSetting.Modeless)
            {
                newWindow.LoadUrl(windowSetting.Url, windowSetting.Viewmodel);
                newWindow.Visible = false;
                if (newWindow.ShowDialog(this) == DialogResult.OK)
                {
                    result = newWindow.sReturnData;
                }
                newWindow.Dispose();
            }
            else
            {
                newWindow.LoadUrl(windowSetting.Url, windowSetting.Viewmodel);
                newWindow.Show();
                Global.formList.Add(newWindow);
            }
            return(result);
        }
示例#2
0
 void frmScBrowser_NewWindow3(ref object ppDisp, ref bool Cancel, uint dwFlags, string bstrUrlContext, string bstrUrl)
 {
     if (!bstrUrl.Contains("/index.jsp"))
     {
         Global.sysConfig.WindowConfig.Url       = bstrUrl;
         Global.sysConfig.WindowConfig.Viewmodel = sViewModel;
         CreateBrowserWindow(Global.sysConfig.GetSetting());
         frmScBrowser frm = Global.formList[Global.formList.Count - 1];
         ppDisp = frm.scweb.ActiveXInstance;
         Cancel = true;
     }
     else
     {
         this.scweb.Navigate(bstrUrl);
         Cancel = true;
     }
 }