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

19 lines
678 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),
_ => throw new Exception($"Неизвестный инструмент {toolName}"),
2023-04-14 08:08:46 +03:00
};
return tool;
}
}