Exemplo n.º 1
0
        //添加
        private void btnAdd_Click(object sender, EventArgs e)
        {
            EditWellInfoForm ef = new EditWellInfoForm(null, true, false, null);

            ef.ShowDialog();
            if (ef.DialogResult == DialogResult.OK)
            {
                List <WellInfo> list = wellInfoService.GetWellInfo_List(ef.GetTerminal_ID());
                string          json = JsonConvert.SerializeObject(list);
                WebBrower.webBrower.ExecuteScriptAsync("addMaker", json);
            }
            DataLoade(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新地图数据
        /// </summary>
        /// <param name="well_Info_ID"></param>
        public static void UpdateMap(string terminal_ID)
        {
            Thread.Sleep(500);
            List <WellInfo> list = wellInfoService.GetWellInfo_List(terminal_ID);
            string          json = JsonConvert.SerializeObject(list);

            WebBrower.webBrower.ExecuteScriptAsync("updateMarker", json);
        }
Exemplo n.º 3
0
 public void Search(IJavascriptCallback javascriptCallback)
 {
     if (inputvalue == "")
     {
         UMessageBox.Show("请输入内容!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     Task.Run(async() =>
     {
         using (javascriptCallback)
         {
             list = wellInfoService.GetWellInfo_List(inputvalue);
             json = JsonConvert.SerializeObject(list);
             await javascriptCallback.ExecuteAsync(json);
         }
     });
 }
Exemplo n.º 4
0
 private void btnAlarm_Click(object sender, EventArgs e)
 {
     if (dgvAlarm.SelectedRows.Count == 0)
     {
         UMessageBox.Show("请选择数据!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     terminal_ID = dgvAlarm.CurrentRow.Cells[1].Value.ToString();
     list        = wellInfoService.GetWellInfo_List(terminal_ID);
     json        = JsonConvert.SerializeObject(list);
     WebBrower.webBrower.ExecuteScriptAsync("searchData", json);
 }
Exemplo n.º 5
0
 public static void Reload()
 {
     if (webBrower.IsBrowserInitialized)
     {
         Task.Run(() =>
         {
             wellInfoService = new WellInfoService();
             list            = wellInfoService.GetWellInfo_List(null);
             json            = JsonConvert.SerializeObject(list);
             webBrower.ExecuteScriptAsync("Refresh", json);
         });
     }
 }
Exemplo n.º 6
0
        public void Init()
        {
            //指定全局设置和命令行参数
            CefSettings settings = new CefSettings();

            //语言
            settings.Locale             = "zh-CN";
            settings.AcceptLanguageList = "zh-CN";
            settings.LocalesDirPath     = @"webbrowerlib\locales\";
            //日志输出
            settings.LogFile               = @"log\LogData.txt";
            settings.LogSeverity           = LogSeverity.Error;
            settings.CachePath             = "cache";
            settings.BrowserSubprocessPath = @"webbrowerlib\CefSharp.BrowserSubprocess.exe";
            if (!Cef.IsInitialized)
            {
                Cef.Initialize(settings, true, false);
            }
            webBrower = new ChromiumWebBrowser("http://rendering/");
            webBrower.LoadHtml(Resources.Loading, "http://rendering/");
            webBrower.RegisterJsObject("jsObj", new JsEvent(), false);
            BrowserSettings browserSettings = new BrowserSettings();

            browserSettings.DefaultEncoding = "UTF-8";
            browserSettings.WebGl           = CefState.Enabled;
            webBrower.BrowserSettings       = browserSettings;
            //禁用右击菜单
            webBrower.MenuHandler     = new MenuHandler();
            webBrower.JsDialogHandler = new JsDialogHandler();

            Task.Run(() => {
                wellInfoService    = new WellInfoService();
                StringBuilder html = new StringBuilder();
                string location    = ReadWriteXml.ReadXml("DefaultLocation");
                list = wellInfoService.GetWellInfo_List(null);
                json = JsonConvert.SerializeObject(list);
                html.AppendFormat(Resources.mapHeader, json, location);
                html.Append(Resources.mapContent);
                webBrower.LoadHtml(html.ToString(), "http://rendering/");
            });
        }