diff --git a/src/shell/dotnet/.gitignore b/src/shell/dotnet/.gitignore index d6a679ae0..e69de29bb 100644 --- a/src/shell/dotnet/.gitignore +++ b/src/shell/dotnet/.gitignore @@ -1 +0,0 @@ -Preload diff --git a/src/shell/dotnet/Shell/App.xaml.cs b/src/shell/dotnet/Shell/App.xaml.cs index e7e55038f..faa5caaa9 100644 --- a/src/shell/dotnet/Shell/App.xaml.cs +++ b/src/shell/dotnet/Shell/App.xaml.cs @@ -25,6 +25,7 @@ using MorganStanley.ComposeUI.Fdc3.DesktopAgent; using MorganStanley.ComposeUI.Messaging.Server.WebSocket; using Shell.Utilities; +using Shell.Preload; namespace Shell; @@ -176,11 +177,10 @@ private void InjectMessageRouterConfig() """); } - + private void InjectFdc3() { - string bundle = @"Shell.fdc3-iife-bundle.js"; - string iife = ResourceReader.ReadResource(bundle); + string iife = ResourceReader.ReadResource(PreloadFdc3.Fdc3BundleResourceName); WebWindow.AddPreloadScript(iife); } diff --git a/src/shell/dotnet/Shell/Preload/PreloadFdc3.cs b/src/shell/dotnet/Shell/Preload/PreloadFdc3.cs new file mode 100644 index 000000000..90e5823af --- /dev/null +++ b/src/shell/dotnet/Shell/Preload/PreloadFdc3.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Shell.Preload +{ + public static class PreloadFdc3 + { + public static readonly string Fdc3BundleResourceName = @"Shell.fdc3-iife-bundle.js"; + } +} diff --git a/src/shell/dotnet/Shell/Shell.csproj b/src/shell/dotnet/Shell/Shell.csproj index 8dd39c7e9..1cd22f0a9 100644 --- a/src/shell/dotnet/Shell/Shell.csproj +++ b/src/shell/dotnet/Shell/Shell.csproj @@ -51,7 +51,7 @@ - + diff --git a/src/shell/dotnet/tests/Shell.Tests/ResourceReaderTests.cs b/src/shell/dotnet/tests/Shell.Tests/ResourceReaderTests.cs index f3ce309fe..8570d144a 100644 --- a/src/shell/dotnet/tests/Shell.Tests/ResourceReaderTests.cs +++ b/src/shell/dotnet/tests/Shell.Tests/ResourceReaderTests.cs @@ -20,6 +20,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; +using Shell.Preload; namespace ShellTests { @@ -28,7 +29,7 @@ public class ReadResourceTests [Fact] public void ResourceCanBeRead() { - var resource = ResourceReader.ReadResource(@"Shell.fdc3-iife-bundle.js"); + var resource = ResourceReader.ReadResource(PreloadFdc3.Fdc3BundleResourceName); Assert.NotNull(resource); }