コード例 #1
0
        public void GenerateAsset(GeneratorCriteria criteria)
        {
            if (criteria.Project.SelectedValue != null)
            {
                var file     = new FileLibrary();
                var filePath = file.GetFilePath(criteria);
                var fileName = file.DetermineName(criteria.ViewType, criteria.Arguments) + criteria.Extension;

                if (!string.IsNullOrEmpty(criteria.FolderPath))
                {
                    filePath += criteria.FolderPath + "\\" + criteria.Arguments.VerticleName + "\\";
                    file.CreateDirectory(filePath);
                }

                var fullPath = file.GetFullPath(filePath, fileName);

                WriteFile(file, fileName, fullPath, criteria);
            }
        }