예제 #1
0
        /// <summary>
        /// 获取控件信息
        /// </summary>
        /// <returns></returns>
        public List <ControlType> GetControlInfoList()
        {
            List <ControlType> reval = new List <ControlType>();
            //获取best平台控件目录
            var typeDirList = FileSugar.GetDirectories(PubUiEngineGet.GetUiEngineControlsDir);

            if (typeDirList.IsValuable())
            {
                foreach (var item in typeDirList)
                {
                    reval.Add(GetControlType(item));
                }
            }
            return(reval);
        }
예제 #2
0
        private List <ControlItem> GetControlList(string itemsPath, string webTypeDir)
        {
            var reval           = new List <ControlItem>();
            var controlsDirList = FileSugar.GetDirectories(itemsPath);

            if (controlsDirList.IsValuable())
            {
                foreach (var item in controlsDirList)
                {
                    ControlItem   control = new ControlItem();
                    DirectoryInfo di      = new DirectoryInfo(item);
                    control.key  = di.Name;
                    control.icon = FileSugar.MergeUrl(webTypeDir, "items", control.key, "icon.png");
                    string configPath    = FileSugar.MergeUrl(itemsPath, control.key, "config.json");
                    string code          = FileSugar.FileToString(configPath);
                    var    controlConfig = code.JsonToModel <ControlConfig>();
                    control.controlConfig = controlConfig;
                    reval.Add(control);
                }
            }
            return(reval);
        }