public TplFile(string _projectPath, string _fileName) { this.fileDirectory = Path.Combine(_projectPath, Configs.Key_DefaultConfigsTplDictionary); this.fileName = _fileName; string filePath = Path.Combine(this.fileDirectory, this.fileName); this.fileContent = File.ReadAllText(filePath); this.replaceSign = TplFile.TakeReplaceSignAndNodeName(this.fileContent); }
internal static List <TplFile> GetTplFiles(string _projectPath) { List <TplFile> tplFiles = new List <TplFile>(); string tplPath = Path.Combine(_projectPath, Configs.Key_DefaultConfigsTplDictionary); string[] tplFilesPath = Directory.GetFiles(tplPath, Configs.Key_SearchTplPattern); foreach (string tplFilePath in tplFilesPath) { var tplFileSplits = tplFilePath.Split('\\'); string fileName = tplFileSplits[tplFileSplits.Length - 1]; TplFile tplFile = new TplFile(_projectPath, fileName); tplFiles.Add(tplFile); } return(tplFiles); }
public Configs(string _projectPath, TemplateEnvironment _currentEnvironment) { this.projectPath = _projectPath; this.currentEnvironment = _currentEnvironment; this.TplFiles = TplFile.GetTplFiles(this.projectPath); }