Skip to content

Commit

Permalink
extension: Do not loadLibrary again for the same preview #7
Browse files Browse the repository at this point in the history
  • Loading branch information
roxk committed Apr 2, 2024
1 parent caf201a commit e053e42
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,14 @@ private async Task<List<string>> GetDllPathsAsync(Project project, CancellationT
private async Task<(string appPath, string host, string quries)> OpenDllProjectAsync(Project docProject)
{
var source = new CancellationTokenSource();
var dllPaths = await GetDllPathsAsync(docProject, source.Token);
var projectName = await docProject.GetAttributeAsync("ProjectName");
var outDir = await docProject.GetAttributeAsync("OutDir");
var appPath = await GetUnpackagedAppNameAsync(docProject, $"{outDir}..\\{projectName}_Preview", "WinUI3XamlPreview_DllLoader");
if (_lastOpenedInfo?.AppPath == appPath)
{
return (appPath, "show", "");
}
var dllPaths = await GetDllPathsAsync(docProject, source.Token);
return (appPath, "loadLibrary", string.Join("&", dllPaths.Select(x => $"dllPath={WebUtility.UrlEncode(x)}")));
}

Expand Down

0 comments on commit e053e42

Please sign in to comment.