RhSolutions-AddIn/RhSolutions.AddIn/Tools/ToolFactory.cs
2023-05-30 08:23:31 +03:00

19 lines
678 B
C#

namespace RhSolutions.Tools;
internal class ToolFactory
{
public Tool GetTool(string toolName)
{
Tool tool = toolName switch
{
"export" => new ExportTool(RhSolutionsAddIn.ServiceProvider),
"convert" => new ConvertTool(RhSolutionsAddIn.ServiceProvider),
"merge" => new MergeTool(RhSolutionsAddIn.ServiceProvider),
"dxfexport" => new DxfTool(RhSolutionsAddIn.ServiceProvider),
"Guessexport" => new GuessTool(RhSolutionsAddIn.ServiceProvider),
_ => throw new Exception($"Неизвестный инструмент {toolName}"),
};
return tool;
}
}