1
- using IQueryableObjectSource ;
1
+ using Community . VisualStudio . Toolkit ;
2
+ using IQueryableObjectSource ;
2
3
using Microsoft . VisualStudio . Extensibility . DebuggerVisualizers ;
3
4
using Microsoft . VisualStudio . PlatformUI ;
4
5
using Microsoft . Web . WebView2 . Core ;
9
10
using System . Text ;
10
11
using System . Windows ;
11
12
using System . Windows . Controls ;
13
+ using MessageBox = System . Windows . MessageBox ;
12
14
13
15
namespace EFCore . Visualizer ;
14
16
15
17
public partial class QueryPlanUserControl : UserControl
16
18
{
19
+ private string ? filePath ;
17
20
private readonly VisualizerTarget visualizerTarget ;
18
21
private static readonly string AssemblyLocation = Path . GetDirectoryName ( typeof ( QueryPlanUserControl ) . Assembly . Location ) ;
19
- private string ? filePath ;
20
22
21
23
private Color backgroundColor = VSColorTheme . GetThemedColor ( ThemedDialogColors . WindowPanelBrushKey ) ;
24
+ private readonly RatingPrompt ratingPrompt = new RatingPrompt ( "GiorgiDalakishvili.EFCoreVisualizer" , "EFCore Visualizer" , General . Instance , requestsBeforePrompt : 3 ) ;
22
25
23
26
public QueryPlanUserControl ( VisualizerTarget visualizerTarget )
24
27
{
@@ -33,6 +36,7 @@ private void QueryPlanUserControlUnloaded(object sender, RoutedEventArgs e)
33
36
SafeDeleteFile ( filePath ) ;
34
37
35
38
Unloaded -= QueryPlanUserControlUnloaded ;
39
+ _ = ratingPrompt . PromptAsync ( ) ;
36
40
}
37
41
38
42
#pragma warning disable VSTHRD100 // Avoid async void methods
@@ -74,6 +78,8 @@ protected override async void OnInitialized(EventArgs e)
74
78
if ( ! string . IsNullOrEmpty ( filePath ) )
75
79
{
76
80
webView . CoreWebView2 . Navigate ( filePath ) ;
81
+
82
+ ratingPrompt . RegisterSuccessfulUsage ( ) ;
77
83
}
78
84
}
79
85
}
0 commit comments