aboutsummaryrefslogtreecommitdiff
path: root/RhSolutions.AddIn/Tools/ToolFactory.cs
blob: ca8841fd0d46300638cc61faea61b9473eab5447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
namespace RhSolutions.Tools;

internal class ToolFactory
{
	public ITool GetTool(string toolName)
	{
		return toolName switch
		{
			"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(),
			_ => throw new Exception($"Неизвестный инструмент {toolName}"),
		};
	}
}