Esempio n. 1
0
        protected IList <ScriptFileModel> GetDirScript()
        {
            var items = new List <ScriptFileModel>();
            var dir   = new DirectoryInfo(path);

            //添加文件夹
            foreach (var item in dir.GetDirectories())
            {
                var model = new ScriptFileModel
                {
                    Name  = item.Name,
                    Path  = item.FullName,
                    IsDir = true
                };

                items.Add(model);
            }

            return(items);
        }
Esempio n. 2
0
        protected IList <ScriptFileModel> GetFileScript()
        {
            var items = new List <ScriptFileModel>();
            var dir   = new DirectoryInfo(path);

            //添加文件夹
            foreach (var item in dir.GetFiles().Where(x => x.Extension == ".lua" || x.Extension == ".luac"))
            {
                var model = new ScriptFileModel
                {
                    Name  = item.Name,
                    Path  = item.FullName,
                    IsDir = false
                };

                items.Add(model);
            }

            return(items);
        }