From 7905d3af4d32405ef041de897bf2d23ee7d6d08e Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 14 Jun 2023 15:23:33 +0300 Subject: Add custom panel and tools --- Tools/ToolFactory.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Tools/ToolFactory.cs (limited to 'Tools/ToolFactory.cs') 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) + }; + } +} -- cgit v1.2.3