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