diff options
Diffstat (limited to 'Tools/ToolFactory.cs')
-rw-r--r-- | Tools/ToolFactory.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tools/ToolFactory.cs b/Tools/ToolFactory.cs new file mode 100644 index 0000000..dba781e --- /dev/null +++ b/Tools/ToolFactory.cs @@ -0,0 +1,17 @@ +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) + }; + } +} |