Skip to content

Commit 91edb33

Browse files
committed
Add ribbon back to Master
1 parent bc01677 commit 91edb33

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

MasterSlave/Master/Master.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<Reference Include="System.Xml" />
4545
</ItemGroup>
4646
<ItemGroup>
47+
<Compile Include="MasterRibbon.cs" />
4748
<Compile Include="SlaveDriver.cs" />
4849
<Compile Include="Properties\AssemblyInfo.cs" />
4950
</ItemGroup>

MasterSlave/Master/MasterRibbon.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Runtime.InteropServices;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
using ExcelDna.Integration;
9+
using ExcelDna.Integration.CustomUI;
10+
11+
namespace MasterSlave
12+
{
13+
[ComVisible(true)]
14+
public class MasterRibbon : ExcelRibbon
15+
{
16+
public MasterRibbon()
17+
{
18+
}
19+
20+
public override string GetCustomUI(string RibbonID)
21+
{
22+
// XlCall.Excel(XlCall.xlcMessage, "BANG!!!!");
23+
Console.Beep();
24+
Console.Beep();
25+
Console.Beep();
26+
return
27+
@"
28+
<customUI xmlns = 'http://schemas.microsoft.com/office/2006/01/customui' >
29+
<ribbon>
30+
<tabs>
31+
<tab id = 'MyTab' label = 'Master' >
32+
<group id = 'MyGroup' label = 'Slave Driver' >
33+
<button id = 'RegisterSlave' label = 'Register Slave' onAction = 'RunTagMacro' tag = 'RegisterSlave' />
34+
<button id = 'UnregisterSlave' label = 'Unregister Slave' onAction = 'RunTagMacro' tag = 'UnregisterSlave' />
35+
</group>
36+
</tab>
37+
</tabs>
38+
</ribbon>
39+
</customUI>
40+
";
41+
}
42+
}
43+
44+
}

MasterSlave/Slave/Slave.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<ItemGroup>
4747
<Compile Include="SlaveAddIn.cs" />
4848
<Compile Include="Properties\AssemblyInfo.cs" />
49-
<Compile Include="Ribbon.cs" />
49+
<Compile Include="SlaveRibbon.cs" />
5050
</ItemGroup>
5151
<ItemGroup>
5252
<Content Include="Slave-AddIn.dna">

MasterSlave/Slave/Ribbon.cs renamed to MasterSlave/Slave/SlaveRibbon.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
namespace MasterSlave
1212
{
1313
[ComVisible(true)]
14-
public class Ribbon : ExcelRibbon
14+
public class SlaveRibbon : ExcelRibbon
1515
{
16-
public Ribbon()
16+
public SlaveRibbon()
1717
{
1818
}
1919

@@ -28,8 +28,8 @@ public override string GetCustomUI(string RibbonID)
2828
<customUI xmlns = 'http://schemas.microsoft.com/office/2006/01/customui' >
2929
<ribbon>
3030
<tabs>
31-
<tab id = 'CustomTab' label = 'My Tab' >
32-
<group id = 'SampleGroup' label = 'My Sample Group' >
31+
<tab id = 'MyTab' label = 'Slave' >
32+
<group id = 'MyGroup' label = 'My Sample Group' >
3333
<button id = 'Button1' label = 'My Button Label' size = 'large' onAction = 'RunTagMacro' tag = 'ShowHelloMessage' />
3434
<button id = 'Button2' label = 'My Second Button' size = 'normal' onAction = 'OnButtonPressed' />
3535
</group>

0 commit comments

Comments
 (0)