RhSolutions-AddIn/RhSolutions.AddIn/Tools/ToolFactory.cs

19 lines
666 B
C#
Raw Normal View History

2023-04-14 08:08:46 +03:00
namespace RhSolutions.Tools;
internal class ToolFactory
{
public Tool GetTool(string toolName)
{
Tool tool = toolName switch
{
2023-04-17 08:49:26 +03:00
"export" => new ExportTool(RhSolutionsAddIn.ServiceProvider),
"convert" => new ConvertTool(RhSolutionsAddIn.ServiceProvider),
"merge" => new MergeTool(RhSolutionsAddIn.ServiceProvider),
"dxfexport" => new DxfTool(RhSolutionsAddIn.ServiceProvider),
2023-05-23 07:07:16 +03:00
"Guessexport" => new GuessTool(RhSolutionsAddIn.ServiceProvider),
2023-04-14 08:08:46 +03:00
_ => throw new Exception("Неизвестный инструмент"),
};
return tool;
}
}