2024-11-09 22:59:46 +03:00
|
|
|
|
namespace RhSolutions.Tools;
|
2023-04-14 08:08:46 +03:00
|
|
|
|
|
|
|
|
|
internal class ToolFactory
|
|
|
|
|
{
|
2024-11-09 22:59:46 +03:00
|
|
|
|
public ITool GetTool(string toolName)
|
2024-11-06 23:43:00 +03:00
|
|
|
|
{
|
2024-11-09 22:59:46 +03:00
|
|
|
|
return toolName switch
|
2024-11-06 23:43:00 +03:00
|
|
|
|
{
|
2024-11-09 22:59:46 +03:00
|
|
|
|
"export" => new ExportTool(),
|
|
|
|
|
"convert" => new ConvertTool(),
|
|
|
|
|
"merge" => new MergeTool(),
|
|
|
|
|
"dxfexport" => new DxfTool(),
|
|
|
|
|
"guess" => new GuessTool(),
|
|
|
|
|
"fillsleeves" => new FittingsTool("Sleeves"),
|
|
|
|
|
"fillcouplings" => new FittingsTool("Couplings"),
|
|
|
|
|
"ocr" => new OcrTool(),
|
2024-11-06 23:43:00 +03:00
|
|
|
|
_ => throw new Exception($"Неизвестный инструмент {toolName}"),
|
|
|
|
|
};
|
|
|
|
|
}
|
2023-04-14 08:08:46 +03:00
|
|
|
|
}
|