summaryrefslogtreecommitdiff
path: root/Tools/ToolFactory.cs
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-06-14 15:23:33 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-06-14 15:23:33 +0300
commit7905d3af4d32405ef041de897bf2d23ee7d6d08e (patch)
treea51153a14fc394e1c37a3cc7839cf57ac692bb68 /Tools/ToolFactory.cs
parentc29849b19d444956f002a65377610f639c0873e1 (diff)
Add custom panel and tools
Diffstat (limited to 'Tools/ToolFactory.cs')
-rw-r--r--Tools/ToolFactory.cs17
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)
+ };
+ }
+}