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