1
0
ExcelAddIn/Tools/ToolFactory.cs
2023-06-14 15:23:33 +03:00

18 lines
358 B
C#

using ExcelDna.Integration.CustomUI;
namespace ExcelAddIn.Tools;
public static class ToolFactory
{
public static Tool GetTool(IRibbonControl control)
{
return control.Id switch
{
"Button1" => new Button1Tool(),
"Button2" => new Button2Tool(),
"Button3" => new Button3Tool(),
_ => throw new NotImplementedException(control.Id)
};
}
}