File tree Expand file tree Collapse file tree 4 files changed +6
-10
lines changed
CmdPalRandomDadJokeExtension
CmdPalRandomFactsExtension Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 55
66namespace CmdPalRandomDadJokeExtension ;
77
8- [ ComVisible ( true ) ]
98[ Guid ( "16a2ba75-311c-4d5f-901f-8057c86a71c6" ) ]
10- [ ComDefaultInterface ( typeof ( IExtension ) ) ]
119public sealed partial class CmdPalRandomDadJokeExtension : IExtension , IDisposable
1210{
1311 private readonly ManualResetEvent _extensionDisposedEvent ;
Original file line number Diff line number Diff line change @@ -35,12 +35,11 @@ public DadJokePage()
3535 _refreshContextMenuItem = new CommandContextItem ( _refreshCommand ) ;
3636
3737 Commands = [ _refreshContextMenuItem , _copyContextMenuItem ] ;
38+ RefreshJoke ( ) ;
3839 }
3940
4041 public override IContent [ ] GetContent ( )
4142 {
42- RefreshJoke ( ) ;
43-
4443 return [ _markdownContent ] ;
4544 }
4645
@@ -74,7 +73,8 @@ public void RefreshJoke()
7473
7574 private void HandleRefresh ( object sender , object ? args )
7675 {
77- RaiseItemsChanged ( 1 ) ;
76+ RefreshJoke ( ) ;
77+ RaiseItemsChanged ( 0 ) ;
7878 }
7979
8080 private static async Task < string ? > GetJokeAsync ( )
Original file line number Diff line number Diff line change 55
66namespace CmdPalRandomFactsExtension ;
77
8- [ ComVisible ( true ) ]
98[ Guid ( "BC38F10C-DBFF-43A7-9FB1-E6A10209AF76" ) ]
10- [ ComDefaultInterface ( typeof ( IExtension ) ) ]
119public sealed partial class CmdPalRandomFactsExtension : IExtension , IDisposable
1210{
1311 private readonly ManualResetEvent _extensionDisposedEvent ;
Original file line number Diff line number Diff line change @@ -34,12 +34,11 @@ public FactsPage()
3434 _refreshContextMenuItem = new CommandContextItem ( _refreshCommand ) ;
3535
3636 Commands = [ _refreshContextMenuItem , _copyContextMenuItem ] ;
37+ RefreshFact ( ) ;
3738 }
3839
3940 public override IContent [ ] GetContent ( )
4041 {
41- RefreshFact ( ) ;
42-
4342 return [ _markdownContent ] ;
4443 }
4544
@@ -73,7 +72,8 @@ public void RefreshFact()
7372
7473 private void HandleRefresh ( object sender , object ? args )
7574 {
76- RaiseItemsChanged ( 1 ) ;
75+ RefreshFact ( ) ;
76+ RaiseItemsChanged ( 0 ) ;
7777 }
7878
7979 private static async Task < string ? > GetFactAsync ( )
You can’t perform that action at this time.
0 commit comments