File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
RetailCoder.VBE/UI/Command/MenuItems/CommandBars
Rubberduck.VBEEditor/SafeComWrappers/Office.Core Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,12 @@ public void EvaluateCanExecute(RubberduckParserState state)
111
111
public void RemoveChildren ( )
112
112
{
113
113
// note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works.
114
- // foreach (var child in _items.Values.Select(item => item as CommandBarButton).Where(child => child != null))
115
- // {
116
- // child.Click -= child_Click;
114
+ foreach ( var child in _items . Values . Select ( item => item as CommandBarButton ) . Where ( child => child != null ) )
115
+ {
116
+ child . Click -= child_Click ;
117
117
// child.Delete();
118
118
// child.Release();
119
- // }
119
+ }
120
120
}
121
121
122
122
// note: HAAAAACK!!!
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public void SetContextSelectionCaption(string caption)
54
54
public void Dispose ( )
55
55
{
56
56
//note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works.
57
- // RemoveChildren();
57
+ RemoveChildren ( ) ;
58
58
//Item.Delete();
59
59
//Item.Release(true);
60
60
}
Original file line number Diff line number Diff line change @@ -35,7 +35,14 @@ public event EventHandler<CommandBarButtonClickEventArgs> Click
35
35
}
36
36
remove
37
37
{
38
- ( ( Microsoft . Office . Core . CommandBarButton ) Target ) . Click -= Target_Click ;
38
+ try
39
+ {
40
+ ( ( Microsoft . Office . Core . CommandBarButton ) Target ) . Click -= Target_Click ;
41
+ }
42
+ catch
43
+ {
44
+ // he's gone, dave.
45
+ }
39
46
_clickHandler -= value ;
40
47
}
41
48
}
You can’t perform that action at this time.
0 commit comments