Skip to content

Commit

Permalink
DEV-30489 Use WebView 2 based on Edge Chromium (#6)
Browse files Browse the repository at this point in the history
* DEV-30489; fix: Use SDK with WebView 2 support

* DEV-30489; fix: add nuget config to access Github registry

* DEV-30489; fix: Add async/await modifiers for SDK functions

* DEV-30489; fix: add button to demo show message functionality

* DEV-30489; fix: update readme with info about webview 2

* DEV-30489; fix: update sample screenshot

* DEV-30489; fix: update screenshot resolution

* DEV-30489; fix: update screenshot resolution

* build: update deps

* build: use new sonar version and pass sonar token (#8)

* Enable Dependabot updates for nuget and github-actions (#7)

* Enable Dependabot updates for nuget and github-actions

Also enable Dependabot auto-merge

* Fix path to packages file

* Use Java 17 instead of 11 for the Sonar-Check job (#18)

* Update links from docs.acrolinx.com to support.acrolinx.com (#19)

* Bump actions/checkout from 2 to 4 (#20)

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump Newtonsoft.Json from 13.0.1 to 13.0.3 in /Acrolinx.Demo.Sidebar (#13)

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.3.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](JamesNK/Newtonsoft.Json@13.0.1...13.0.3)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-dotnet from 2 to 3 (#16)

Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 2 to 3.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* DEV-30489; fix: Use SDK with WebView 2 support

* build: update deps

* fix: review comments

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Thilo-Acrolinx <125662076+Thilo-Acrolinx@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 28, 2023
1 parent 7b496a9 commit 32f8486
Show file tree
Hide file tree
Showing 18 changed files with 238 additions and 111 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

env:
Solution_Name: Acrolinx.Demo.Sidebar.Net.sln
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ download

# Eclipse
.project
Acrolinx.Demo.Sidebar/runtimes/
6 changes: 6 additions & 0 deletions Acrolinx.Demo.Sidebar.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|x86.ActiveCfg = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|x86.Build.0 = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|Any CPU.Build.0 = Release|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|x86.ActiveCfg = Release|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
52 changes: 39 additions & 13 deletions Acrolinx.Demo.Sidebar/Acrolinx.Demo.Sidebar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Acrolinx.Demo.Sidebar</RootNamespace>
<AssemblyName>Acrolinx.Demo.Sidebar</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<CodeContractsAssemblyMode>0</CodeContractsAssemblyMode>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -81,24 +83,39 @@
<ApplicationIcon>acrolinx.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Acrolinx.Sidebar, Version=1.1.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Acrolinx.Sidebar.1.1.8.1220\lib\net45\Acrolinx.Sidebar.dll</HintPath>
<Reference Include="Acrolinx.Sidebar, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Acrolinx.Sidebar.2.0.0.1380\lib\net472\Acrolinx.Sidebar.dll</HintPath>
</Reference>
<Reference Include="Diff.Match.Patch, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Diff.Match.Patch.2.1.0\lib\net45\Diff.Match.Patch.dll</HintPath>
<Reference Include="Diff.Match.Patch, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Diff.Match.Patch.3.0.1\lib\netstandard2.0\Diff.Match.Patch.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core, Version=4.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\FSharp.Core.4.7.2\lib\net45\FSharp.Core.dll</HintPath>
<Reference Include="FSharp.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\FSharp.Core.5.0.0\lib\netstandard2.0\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.WebView2.Core, Version=1.0.2151.40, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.2151.40\lib\net45\Microsoft.Web.WebView2.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.WebView2.WinForms, Version=1.0.2151.40, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.2151.40\lib\net45\Microsoft.Web.WebView2.WinForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.2151.40, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.2151.40\lib\net45\Microsoft.Web.WebView2.Wpf.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand Down Expand Up @@ -134,6 +151,7 @@
<Compile Include="TextBoxAdapter.cs" />
<EmbeddedResource Include="MultiSample.resx">
<DependentUpon>MultiSample.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand All @@ -150,6 +168,7 @@
</EmbeddedResource>
<EmbeddedResource Include="SimpleSample.resx">
<DependentUpon>SimpleSample.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="packages.config">
<SubType>Designer</SubType>
Expand All @@ -170,13 +189,20 @@
<ItemGroup>
<Content Include="acrolinx.ico" />
<Content Include="Acrolinx.Sidebar.log4net.xml" />
<Content Include="Acrolinx.Startpage.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Config.Resource.log4net.xml" />
<Content Include="runtimes\win-arm64\native\WebView2Loader.dll" />
<Content Include="runtimes\win-x64\native\WebView2Loader.dll" />
<Content Include="runtimes\win-x86\native\WebView2Loader.dll" />
<None Include="Resources\loading.bmp" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Binary file removed Acrolinx.Demo.Sidebar/Acrolinx.Startpage.dll
Binary file not shown.
12 changes: 10 additions & 2 deletions Acrolinx.Demo.Sidebar/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<applicationSettings>
<Acrolinx.Demo.Sidebar.Properties.Settings>
Expand Down Expand Up @@ -170,7 +170,15 @@ CAUTION: Don't lift the 360 chassis by the front (bezel end) and back (service e
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.14.0" newVersion="2.0.14.0" />
<bindingRedirect oldVersion="0.0.0.0-2.0.15.0" newVersion="2.0.15.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.WinForms" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2151.40" newVersion="1.0.2151.40" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.Core" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2151.40" newVersion="1.0.2151.40" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
20 changes: 11 additions & 9 deletions Acrolinx.Demo.Sidebar/Integration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public Integration(AcrolinxSidebar sidebar)
//This allows you to talk to the server without configuring CORS.
//Ensure the SidebarSourceLocation uses the same host as ServerAddress.
//Ensure the external name of the Acrolinx Server equals the host name you are talking to.
//sidebar.SidebarSourceLocation = "http://yourlocalserver:8031/sidebar/v14/index.html";
//sidebar.ServerAddress = "http://yourlocalserver:8031";
//sidebar.ServerAddress = "https://company.acrolinx.cloud";

Check warning on line 39 in Acrolinx.Demo.Sidebar/Integration.cs

View workflow job for this annotation

GitHub Actions / build

Remove this commented out code.
//sidebar.ShowServerSelector = false;
//Make sure to call sidebar.Start() instead of sidebar.Start(serverAddress), if you uncomment one of these options.

Expand All @@ -52,9 +51,12 @@ public Integration(AcrolinxSidebar sidebar)
//Set version information. This is used for support and Acrolinx Analytics.
//sidebar.RegisterClientComponent(typeof(Integration).Assembly, "Acrolinx for " + Application.ProductName, AcrolinxSidebar.SoftwareComponentCategory.MAIN);

Check warning on line 52 in Acrolinx.Demo.Sidebar/Integration.cs

View workflow job for this annotation

GitHub Actions / build

Remove this commented out code.
//sidebar.RegisterClientComponent(Assembly.GetEntryAssembly(), Application.ProductName, AcrolinxSidebar.SoftwareComponentCategory.DEFAULT);
}

public async Task Start()
{
//Start the Sidebar, which connects to an Acrolinx Server.
sidebar.Start();
await sidebar.Start();
}

public void RegisterTextBox(TextBox textBox)
Expand All @@ -79,14 +81,14 @@ public void RegisterXmlTextBox(TextBox textBox)
private MultiAdapter current = new MultiAdapter("", new UniversalAdapter[0], Format.Auto);
private MultiAdapter request = new MultiAdapter("", new UniversalAdapter[0], Format.Auto);

private void RequestCheck(object sender, EventArgs e)
private async void RequestCheck(object sender, EventArgs e)
{
Logger.AcroLog.Info("RequestCheck");

request = new MultiAdapter("DotNetSampleXML", adapterList, Format.Auto);
request.DocumentReference = "dotnetSample/topspin.xml"; //Document reference should be set to path, uri or unique id of the current document

var checkId = sidebar.Check(request.Document);
var checkId = await sidebar.Check(request.Document);

Logger.AcroLog.Debug("Check submitted with id: " + checkId);
}
Expand All @@ -99,7 +101,7 @@ private void Checked(object sender, CheckedEventArgs e)
}


private void SelectRanges(object sender, MatchesEventArgs e)
private async void SelectRanges(object sender, MatchesEventArgs e)
{
Contract.Requires(e.Matches.All(m => (0 <= m.Range.Start && m.Range.End <= current.Document.Content.Length)));

Expand All @@ -112,11 +114,11 @@ private void SelectRanges(object sender, MatchesEventArgs e)
catch (Exception err)
{
Logger.AcroLog.Error(err);
sidebar.InvalidateRanges(e.CheckId, e.Matches);
await sidebar.InvalidateRanges(e.CheckId, e.Matches);
}
}

private void ReplaceRanges(object sender, MatchesWithReplacementEventArgs e)
private async void ReplaceRanges(object sender, MatchesWithReplacementEventArgs e)
{
Contract.Requires(e.Matches.All(m => m.Range.Start >= 0 && m.Range.End <= current.Document.Content.Length));
Logger.AcroLog.Info("ReplaceRanges: " + e.Matches);
Expand All @@ -127,7 +129,7 @@ private void ReplaceRanges(object sender, MatchesWithReplacementEventArgs e)
catch (Exception err)
{
Logger.AcroLog.Error(err);
sidebar.InvalidateRanges(e.CheckId, e.Matches);
await sidebar.InvalidateRanges(e.CheckId, e.Matches);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions Acrolinx.Demo.Sidebar/MultiSample.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Acrolinx.Demo.Sidebar/MultiSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ public MultiSample()

integration = new Integration(acrolinxSidebar);


integration.RegisterTitleTextBox(textBoxTitle); //Deal with plain text
integration.RegisterXmlTextBox(textBoxPlainXML); //Deal with xml content

for (int i = 0; i < 3; i++)
{
addTextSnippet();
}


}

private void addTextSnippetToolStripMenuItem_Click(object sender, EventArgs e)
Expand All @@ -64,5 +61,10 @@ private void addTextSnippet()

integration.RegisterTextBox(newTextBox);
}

private async void MultiSample_Load(object sender, EventArgs e)
{
await integration.Start();
}
}
}
9 changes: 4 additions & 5 deletions Acrolinx.Demo.Sidebar/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 32f8486

Please sign in to comment.