Exemple #1
0
        private void StartLoadNodeImage(TreeNode node, ServiceItem item)
        {
            Thread t = new Thread(() =>
            {
                try
                {
                    HsApply remoteInvoke    = new HsApply(GlobalConfig.getUrlHead(), "GET_BYTES");
                    remoteInvoke.ReturnType = 1;
                    remoteInvoke.InvokeType = InvType.GET;

                    HsParam param1 = new HsParam("Name", item.ImageName, DataType.String, InvType.GET);
                    HsParam param2 = new HsParam("Type", "0", DataType.String, InvType.GET);

                    remoteInvoke.addParam(param1);
                    remoteInvoke.addParam(param2);


                    HsResultData resultData = remoteInvoke.excuteCommand();

                    SrvTreeView.Invoke(new EventHandler(delegate
                    {
                        if (resultData.ResultString == null)
                        {
                        }
                        else
                        {
                            try
                            {
                                byte[] byteDatas = Convert.FromBase64String(resultData.ResultString.ToString());
                                Image img        = ImageHelper.BytesToImage(byteDatas);
                                if (img != null)
                                {
                                    lock (_lockObj)
                                    {
                                        ImgList.Images.Add(img);
                                        node.ImageIndex         = ImgList.Images.Count - 1;
                                        node.SelectedImageIndex = node.ImageIndex;
                                    }
                                }
                            }
                            catch
                            {
                            }
                        }
                    }));
                }
                catch (Exception ex)
                {
                }
            });

            t.Start();
        }
Exemple #2
0
        public static ServiceItem getMenu(string pCmd)
        {
            for (int index = 0; index < SystemMenus.Count; index++)
            {
                ServiceItem item = SystemMenus[index];

                if (item.CmdString == pCmd)
                {
                    return(item);
                }
            }

            return(null);
        }
Exemple #3
0
        public static List <ServiceItem> loadSystemFuncTree()
        {
            List <ServiceItem> rtnMenus = new List <ServiceItem>();

            try
            {
                HsApply applyLogin = new HsApply(GlobalConfig.getUrlHead(), "FETCH_MENUS");
                applyLogin.InvokeType = InvType.GET;

                HsParam param1 = new HsParam("Account", "root", DataType.String, InvType.GET);

                applyLogin.addParam(param1);
                //applyLogin.addParam(param2);


                HsResultData resultDat = applyLogin.excuteCommand();

                if (resultDat.ErrorId == 200)
                {
                    JArray rtnRolesArray = (JArray)resultDat.ResultString;

                    for (int index = 0; index < rtnRolesArray.Count; index++)
                    {
                        ServiceItem oneRole = ServiceItem.parseFromString(rtnRolesArray[index].ToString());

                        rtnMenus.Add(oneRole);
                    }
                }

                rtnMenus.Sort();
                GlobalConfig.SystemMenus = rtnMenus;
                return(rtnMenus);
            }
            catch (Exception ex)
            {
            }

            GlobalConfig.SystemMenus = rtnMenus;
            return(rtnMenus);
        }
Exemple #4
0
 private void loadNewItem(ServiceItem item)
 {
     main_workSpace.loadData(item);
 }
Exemple #5
0
 private void updateUrl(ServiceItem item)
 {
 }