Example #1
0
        private void LoadPluginData2(string pluginType)
        {
            new Thread((ThreadStart)(delegate()
            {
                try
                {
                    labloading.Invoke((MethodInvoker) delegate() { labloading.Visible = true; });

                    List <PluginClass> plist = new List <PluginClass>();

                    string url = CommonHelper.plugin_serverurl + "/Controller.aspx?controller=efwplus_website@PluginController&method=getpluginlist_client&plugintype=" + pluginType;
                    HttpWebResponse response = HttpWebResponseUtility.CreateGetHttpResponse(url, null, null, null);
                    string ret = HttpWebResponseUtility.GetHttpData(response);
                    string data = (HttpWebResponseUtility.ToResult(ret) as Newtonsoft.Json.JavaScriptArray).ToArray()[0].ToString();
                    DataTable dt = HttpWebResponseUtility.ToDataTable(JavaScriptConvert.DeserializeObject(data));

                    gridweb.Invoke((MethodInvoker) delegate() { gridweb.DataSource = dt; });

                    DataGridViewLabelXColumn bcx = gridweb.Columns["ctitle"] as DataGridViewLabelXColumn;
                    if (bcx != null)
                    {
                        bcx.BeforeCellPaint += bcx_BeforeCellPaint;
                    }

                    labloading.Invoke((MethodInvoker) delegate() { labloading.Visible = false; });
                }
                catch (Exception err)
                {
                    //MessageBox.Show("请求数据失败!\n" + err.Message);
                    MessageBoxEx.Show("请求数据失败!\n" + err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            })).Start();
        }