19 lines
678 B
C#
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;
|
|
}
|
|
}
|