private void BuildProject() { var pathExtension = Path.GetExtension(ConfigPath).ToUpper(); switch (pathExtension) { case ".JSON": { ConfigBuilder = new JsonBuilder(ConfigPath); break; } case ".YML": { ConfigBuilder = new YamlBuilder(ConfigPath); break; } default: { throw new SmartCodeException($"未知扩展名:{pathExtension}"); } } Project = ConfigBuilder.Build(); Project.ConfigPath = ConfigPath; }
public void Build() { var configPath = @"D:\01Code\Git\OpenSource\SmartCode\doc\SmartCode.yml"; YamlBuilder yamlBuilder = new YamlBuilder(configPath); var project = yamlBuilder.Build(); }
public void Build() { var configPath = @"E:\Ahoo\SmartCode\doc\SmartCode.yml"; YamlBuilder yamlBuilder = new YamlBuilder(configPath); var project = yamlBuilder.Build(); }