From 53f632ae875a62db87992c26c9a8cb5297138517 Mon Sep 17 00:00:00 2001 From: Steven Morgan Date: Fri, 26 Nov 2021 17:52:45 +0000 Subject: [PATCH 1/2] Add support for WebView2 display. --- .../DisplayPluginLibrary.csproj | 4 +- DisplayPluginLibrary/packages.config | 2 +- .../DriverDisplayPlugin.csproj | 4 +- DriverDisplayPlugin/packages.config | 2 +- .../EnhancedDisplayPlugin.csproj | 4 +- EnhancedDisplayPlugin/packages.config | 2 +- ....Atlas.Plugins.Samples.HelloConsole.csproj | 4 +- .../packages.config | 2 +- ...AT.Atlas.Plugins.Samples.HelloWorld.csproj | 4 +- .../packages.config | 2 +- MAT.OCS.Atlas10.ClientAPI.sln | 7 + .../NumericCompareDisplayPlugin.csproj | 4 +- NumericCompareDisplayPlugin/packages.config | 2 +- .../SampleDisplayPlugin.csproj | 4 +- SampleDisplayPlugin/packages.config | 2 +- ShowWebPagePlugin/PluginModule.cs | 24 ++++ ShowWebPagePlugin/Properties/AssemblyInfo.cs | 54 ++++++++ .../Properties/Resources.Designer.cs | 60 ++++++++ ShowWebPagePlugin/Properties/Resources.resx | 117 ++++++++++++++++ .../Properties/Settings.Designer.cs | 26 ++++ .../Properties/Settings.settings | 7 + ShowWebPagePlugin/Resources/icon.png | Bin 0 -> 3463 bytes ShowWebPagePlugin/SampleDisplayView.xaml | 18 +++ ShowWebPagePlugin/SampleDisplayView.xaml.cs | 38 ++++++ ShowWebPagePlugin/SampleDisplayViewModel.cs | 86 ++++++++++++ ShowWebPagePlugin/ShowWebPagePlugin.csproj | 129 ++++++++++++++++++ ShowWebPagePlugin/packages.config | 8 ++ SimpleGaugePlugin/SimpleGaugePlugin.csproj | 4 +- SimpleGaugePlugin/packages.config | 2 +- scripts/deploy.bat | 2 +- 30 files changed, 599 insertions(+), 25 deletions(-) create mode 100644 ShowWebPagePlugin/PluginModule.cs create mode 100644 ShowWebPagePlugin/Properties/AssemblyInfo.cs create mode 100644 ShowWebPagePlugin/Properties/Resources.Designer.cs create mode 100644 ShowWebPagePlugin/Properties/Resources.resx create mode 100644 ShowWebPagePlugin/Properties/Settings.Designer.cs create mode 100644 ShowWebPagePlugin/Properties/Settings.settings create mode 100644 ShowWebPagePlugin/Resources/icon.png create mode 100644 ShowWebPagePlugin/SampleDisplayView.xaml create mode 100644 ShowWebPagePlugin/SampleDisplayView.xaml.cs create mode 100644 ShowWebPagePlugin/SampleDisplayViewModel.cs create mode 100644 ShowWebPagePlugin/ShowWebPagePlugin.csproj create mode 100644 ShowWebPagePlugin/packages.config diff --git a/DisplayPluginLibrary/DisplayPluginLibrary.csproj b/DisplayPluginLibrary/DisplayPluginLibrary.csproj index eb47125..df77a8a 100644 --- a/DisplayPluginLibrary/DisplayPluginLibrary.csproj +++ b/DisplayPluginLibrary/DisplayPluginLibrary.csproj @@ -44,8 +44,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll ..\packages\MathNet.Numerics.4.15.0\lib\net461\MathNet.Numerics.dll diff --git a/DisplayPluginLibrary/packages.config b/DisplayPluginLibrary/packages.config index 1d1541e..3dc437b 100644 --- a/DisplayPluginLibrary/packages.config +++ b/DisplayPluginLibrary/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/DriverDisplayPlugin/DriverDisplayPlugin.csproj b/DriverDisplayPlugin/DriverDisplayPlugin.csproj index 79445c6..81c5cd9 100644 --- a/DriverDisplayPlugin/DriverDisplayPlugin.csproj +++ b/DriverDisplayPlugin/DriverDisplayPlugin.csproj @@ -44,8 +44,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll ..\packages\MathNet.Numerics.4.15.0\lib\net461\MathNet.Numerics.dll diff --git a/DriverDisplayPlugin/packages.config b/DriverDisplayPlugin/packages.config index afdea41..6e51da8 100644 --- a/DriverDisplayPlugin/packages.config +++ b/DriverDisplayPlugin/packages.config @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/EnhancedDisplayPlugin/EnhancedDisplayPlugin.csproj b/EnhancedDisplayPlugin/EnhancedDisplayPlugin.csproj index f1c9eb9..5e9e320 100644 --- a/EnhancedDisplayPlugin/EnhancedDisplayPlugin.csproj +++ b/EnhancedDisplayPlugin/EnhancedDisplayPlugin.csproj @@ -44,8 +44,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll ..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.31\lib\net45\Microsoft.Xaml.Behaviors.dll diff --git a/EnhancedDisplayPlugin/packages.config b/EnhancedDisplayPlugin/packages.config index e8330c5..24624c2 100644 --- a/EnhancedDisplayPlugin/packages.config +++ b/EnhancedDisplayPlugin/packages.config @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/MAT.Atlas.Plugins.Samples.HelloConsole/MAT.Atlas.Plugins.Samples.HelloConsole.csproj b/MAT.Atlas.Plugins.Samples.HelloConsole/MAT.Atlas.Plugins.Samples.HelloConsole.csproj index a99d24f..4e5bcc4 100644 --- a/MAT.Atlas.Plugins.Samples.HelloConsole/MAT.Atlas.Plugins.Samples.HelloConsole.csproj +++ b/MAT.Atlas.Plugins.Samples.HelloConsole/MAT.Atlas.Plugins.Samples.HelloConsole.csproj @@ -43,8 +43,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll diff --git a/MAT.Atlas.Plugins.Samples.HelloConsole/packages.config b/MAT.Atlas.Plugins.Samples.HelloConsole/packages.config index 1d1541e..3dc437b 100644 --- a/MAT.Atlas.Plugins.Samples.HelloConsole/packages.config +++ b/MAT.Atlas.Plugins.Samples.HelloConsole/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/MAT.Atlas.Plugins.Samples.HelloWorld/MAT.Atlas.Plugins.Samples.HelloWorld.csproj b/MAT.Atlas.Plugins.Samples.HelloWorld/MAT.Atlas.Plugins.Samples.HelloWorld.csproj index 1ff9f5e..1db8df9 100644 --- a/MAT.Atlas.Plugins.Samples.HelloWorld/MAT.Atlas.Plugins.Samples.HelloWorld.csproj +++ b/MAT.Atlas.Plugins.Samples.HelloWorld/MAT.Atlas.Plugins.Samples.HelloWorld.csproj @@ -43,8 +43,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll diff --git a/MAT.Atlas.Plugins.Samples.HelloWorld/packages.config b/MAT.Atlas.Plugins.Samples.HelloWorld/packages.config index 1d1541e..3dc437b 100644 --- a/MAT.Atlas.Plugins.Samples.HelloWorld/packages.config +++ b/MAT.Atlas.Plugins.Samples.HelloWorld/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/MAT.OCS.Atlas10.ClientAPI.sln b/MAT.OCS.Atlas10.ClientAPI.sln index ec0f1de..17295f8 100644 --- a/MAT.OCS.Atlas10.ClientAPI.sln +++ b/MAT.OCS.Atlas10.ClientAPI.sln @@ -33,6 +33,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleDisplayPlugin", "Samp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleGaugePlugin", "SimpleGaugePlugin\SimpleGaugePlugin.csproj", "{899080EB-4531-438A-97C0-DDC890DFA5B1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowWebPagePlugin", "ShowWebPagePlugin\ShowWebPagePlugin.csproj", "{093714DA-B8FF-47F6-98BB-2B62FF50731C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -71,6 +73,10 @@ Global {899080EB-4531-438A-97C0-DDC890DFA5B1}.Debug|Any CPU.Build.0 = Debug|Any CPU {899080EB-4531-438A-97C0-DDC890DFA5B1}.Release|Any CPU.ActiveCfg = Release|Any CPU {899080EB-4531-438A-97C0-DDC890DFA5B1}.Release|Any CPU.Build.0 = Release|Any CPU + {093714DA-B8FF-47F6-98BB-2B62FF50731C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {093714DA-B8FF-47F6-98BB-2B62FF50731C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {093714DA-B8FF-47F6-98BB-2B62FF50731C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {093714DA-B8FF-47F6-98BB-2B62FF50731C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -82,6 +88,7 @@ Global {AF5DEE0A-1307-4B0C-A641-9E617B14E14A} = {7D1224A3-A217-4AB4-A0F7-FE45AA4386C4} {25EC5637-EA0E-438C-B0BD-6EC2F7B1CFB6} = {7D1224A3-A217-4AB4-A0F7-FE45AA4386C4} {899080EB-4531-438A-97C0-DDC890DFA5B1} = {7D1224A3-A217-4AB4-A0F7-FE45AA4386C4} + {093714DA-B8FF-47F6-98BB-2B62FF50731C} = {7D1224A3-A217-4AB4-A0F7-FE45AA4386C4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5F01EE0C-3E60-4D5E-A2C8-7462210A0BBC} diff --git a/NumericCompareDisplayPlugin/NumericCompareDisplayPlugin.csproj b/NumericCompareDisplayPlugin/NumericCompareDisplayPlugin.csproj index 564bd7e..f2b6d8e 100644 --- a/NumericCompareDisplayPlugin/NumericCompareDisplayPlugin.csproj +++ b/NumericCompareDisplayPlugin/NumericCompareDisplayPlugin.csproj @@ -44,8 +44,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll diff --git a/NumericCompareDisplayPlugin/packages.config b/NumericCompareDisplayPlugin/packages.config index 1d1541e..3dc437b 100644 --- a/NumericCompareDisplayPlugin/packages.config +++ b/NumericCompareDisplayPlugin/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/SampleDisplayPlugin/SampleDisplayPlugin.csproj b/SampleDisplayPlugin/SampleDisplayPlugin.csproj index 0a6b6ba..186581a 100644 --- a/SampleDisplayPlugin/SampleDisplayPlugin.csproj +++ b/SampleDisplayPlugin/SampleDisplayPlugin.csproj @@ -44,8 +44,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll diff --git a/SampleDisplayPlugin/packages.config b/SampleDisplayPlugin/packages.config index 1d1541e..3dc437b 100644 --- a/SampleDisplayPlugin/packages.config +++ b/SampleDisplayPlugin/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/ShowWebPagePlugin/PluginModule.cs b/ShowWebPagePlugin/PluginModule.cs new file mode 100644 index 0000000..6c43220 --- /dev/null +++ b/ShowWebPagePlugin/PluginModule.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.Composition; +using Autofac; +using Autofac.Core; +using MAT.Atlas.Client.Presentation.Plugins; + +namespace ShowWebPagePlugin +{ + [Export(typeof(IModule))] + public sealed class PluginModule : Module + { + protected override void Load(ContainerBuilder builder) + { + Plugin.Register(builder); + } + + [DisplayPlugin( + View = typeof(SampleDisplayView), + ViewModel = typeof(SampleDisplayViewModel), + IconUri = "Resources/icon.png")] + private sealed class Plugin : DisplayPlugin + { + } + } +} \ No newline at end of file diff --git a/ShowWebPagePlugin/Properties/AssemblyInfo.cs b/ShowWebPagePlugin/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3d961bd --- /dev/null +++ b/ShowWebPagePlugin/Properties/AssemblyInfo.cs @@ -0,0 +1,54 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ShowWebPagePlugin")] +[assembly: AssemblyDescription("Show Web Page Display")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("McLaren Applied")] +[assembly: AssemblyProduct("Show.Web.Page.Plugin")] +[assembly: AssemblyCopyright("Copyright © McLaren Applied 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("9A5B4C75-E327-41AC-9531-FA83EAE655AB")] diff --git a/ShowWebPagePlugin/Properties/Resources.Designer.cs b/ShowWebPagePlugin/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2dcec98 --- /dev/null +++ b/ShowWebPagePlugin/Properties/Resources.Designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ShowWebPagePlugin.Properties { + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SimpleGaugePlugin.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/ShowWebPagePlugin/Properties/Resources.resx b/ShowWebPagePlugin/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ShowWebPagePlugin/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShowWebPagePlugin/Properties/Settings.Designer.cs b/ShowWebPagePlugin/Properties/Settings.Designer.cs new file mode 100644 index 0000000..ac0541f --- /dev/null +++ b/ShowWebPagePlugin/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SimpleGaugePlugin.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/ShowWebPagePlugin/Properties/Settings.settings b/ShowWebPagePlugin/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/ShowWebPagePlugin/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/ShowWebPagePlugin/Resources/icon.png b/ShowWebPagePlugin/Resources/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4782ae8ae190496969c510918ebbebabe6498996 GIT binary patch literal 3463 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 + + + + + + + \ No newline at end of file diff --git a/ShowWebPagePlugin/SampleDisplayView.xaml.cs b/ShowWebPagePlugin/SampleDisplayView.xaml.cs new file mode 100644 index 0000000..ad407d3 --- /dev/null +++ b/ShowWebPagePlugin/SampleDisplayView.xaml.cs @@ -0,0 +1,38 @@ +using System.IO; + +using Microsoft.Web.WebView2.Core; + +namespace ShowWebPagePlugin +{ + public partial class SampleDisplayView + { + public SampleDisplayView() + { + InitializeComponent(); + } + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + if (this.DataContext is SampleDisplayViewModel vm) + { + this.InitializeAsync(vm); + } + } + + public async void InitializeAsync(SampleDisplayViewModel vm) + { + var browserFolder = Path.Combine(Path.GetTempPath(), "ATLAS10_WebBrowser"); + var env = await CoreWebView2Environment.CreateAsync(userDataFolder: browserFolder); + await webView.EnsureCoreWebView2Async(env); + + if (vm.IsDevToolsOpen) + { + webView.CoreWebView2.OpenDevToolsWindow(); + } + + vm.Initialize(this.webView.CoreWebView2); + } + } +} \ No newline at end of file diff --git a/ShowWebPagePlugin/SampleDisplayViewModel.cs b/ShowWebPagePlugin/SampleDisplayViewModel.cs new file mode 100644 index 0000000..9276196 --- /dev/null +++ b/ShowWebPagePlugin/SampleDisplayViewModel.cs @@ -0,0 +1,86 @@ +using System; +using System.ComponentModel; + +using MAT.Atlas.Api.Core.Diagnostics; +using MAT.Atlas.Client.Presentation.Displays; + +using Microsoft.Web.WebView2.Core; + +namespace ShowWebPagePlugin +{ + public sealed class SampleDisplayViewModel : DisplayPluginViewModel + { + private readonly ILogger logger; + private CoreWebView2 coreWebView2; + private bool firstLoad = true; + private bool isVisible; + private bool isDevToolsOpen; + private string url; + + public SampleDisplayViewModel(ILogger logger) + { + this.logger = logger; + } + + public bool IsDevToolsOpen + { + get => this.isDevToolsOpen; + set + { + if (this.SetProperty(ref this.isDevToolsOpen, value) && + this.isDevToolsOpen) + { + this.coreWebView2.OpenDevToolsWindow(); + } + } + } + + [Browsable(false)] + public bool IsVisible + { + get => this.isVisible; + set => this.SetProperty(ref this.isVisible, value); + } + + public string Url + { + get => this.url = this.ReadProperty("https://www.mclaren.com/applied/"); + set + { + if (this.SetProperty(ref this.url, value)) + { + this.SaveProperty(value); + } + } + } + + public void Initialize(CoreWebView2 coreWebView2) + { + this.coreWebView2 = coreWebView2; + this.coreWebView2.NavigationCompleted += this.OnNavigationCompleted; + this.NavigateToUrl(); + } + + private void NavigateToUrl() + { + try + { + this.coreWebView2.Navigate(this.Url); + } + catch (Exception ex) + { + this.logger.Error($"Navigation to {this.url} failed", ex); + } + } + + + private void OnNavigationCompleted(object sender, CoreWebView2NavigationCompletedEventArgs e) + { + if (this.firstLoad) + { + this.firstLoad = false; + this.IsVisible = true; + } + } + } +} \ No newline at end of file diff --git a/ShowWebPagePlugin/ShowWebPagePlugin.csproj b/ShowWebPagePlugin/ShowWebPagePlugin.csproj new file mode 100644 index 0000000..22f4435 --- /dev/null +++ b/ShowWebPagePlugin/ShowWebPagePlugin.csproj @@ -0,0 +1,129 @@ + + + + + Debug + AnyCPU + {093714DA-B8FF-47F6-98BB-2B62FF50731C} + library + ShowWebPagePlugin + ShowWebPagePlugin + v4.8 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x64 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x64 + + + + ..\packages\Autofac.4.5.0\lib\net45\Autofac.dll + + + ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Api.Core.dll + + + ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Platform.dll + + + ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll + + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll + + + ..\packages\Microsoft.Web.WebView2.1.0.902.49\lib\net45\Microsoft.Web.WebView2.Core.dll + + + ..\packages\Microsoft.Web.WebView2.1.0.902.49\lib\net45\Microsoft.Web.WebView2.WinForms.dll + + + ..\packages\Microsoft.Web.WebView2.1.0.902.49\lib\net45\Microsoft.Web.WebView2.Wpf.dll + + + + + ..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll + + + + + 4.0 + + + + + + + + + + MSBuild:Compile + Designer + + + SampleDisplayView.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + call "$(SolutionDir)scripts\deploy.bat" "$(TargetDir)$(ProjectName).dll" +call "$(SolutionDir)scripts\deploy.bat" "$(TargetDir)Microsoft.Web.WebView2.*.dll" +call "$(SolutionDir)scripts\deploy.bat" "$(TargetDir)runtimes" + + + + + 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}. + + + + \ No newline at end of file diff --git a/ShowWebPagePlugin/packages.config b/ShowWebPagePlugin/packages.config new file mode 100644 index 0000000..97cf029 --- /dev/null +++ b/ShowWebPagePlugin/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/SimpleGaugePlugin/SimpleGaugePlugin.csproj b/SimpleGaugePlugin/SimpleGaugePlugin.csproj index 67a0bf8..c2fa551 100644 --- a/SimpleGaugePlugin/SimpleGaugePlugin.csproj +++ b/SimpleGaugePlugin/SimpleGaugePlugin.csproj @@ -47,8 +47,8 @@ ..\packages\Atlas.DisplayAPI.10.4.4.220\lib\net48\MAT.Atlas.Client.Presentation.dll - - ..\packages\MAT.OCS.Core.2.1.11\lib\net45\MAT.OCS.Core.dll + + ..\packages\MAT.OCS.Core.2.1.12\lib\net45\MAT.OCS.Core.dll ..\packages\MathNet.Numerics.4.15.0\lib\net461\MathNet.Numerics.dll diff --git a/SimpleGaugePlugin/packages.config b/SimpleGaugePlugin/packages.config index 37b53e4..ba2e15c 100644 --- a/SimpleGaugePlugin/packages.config +++ b/SimpleGaugePlugin/packages.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/scripts/deploy.bat b/scripts/deploy.bat index 631bb4d..8522df4 100644 --- a/scripts/deploy.bat +++ b/scripts/deploy.bat @@ -1,7 +1,7 @@ NET SESSION >nul 2>&1 IF %ERRORLEVEL% EQU 0 ( IF EXIST "C:\Program Files\McLaren Applied Technologies\ATLAS 10\" ( - xcopy /r /y %1 "C:\Program Files\McLaren Applied Technologies\ATLAS 10" + xcopy /r /y /S /I /F %1 "C:\Program Files\McLaren Applied Technologies\ATLAS 10" ) ELSE ( echo "No Atlas installation detected - skip deploying" ) From a0000d0d781d95034b1760d48f571e446b15109f Mon Sep 17 00:00:00 2001 From: Steven Morgan Date: Tue, 29 Mar 2022 19:49:56 +0100 Subject: [PATCH 2/2] wip --- ShowWebPagePlugin/SampleDisplayViewModel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ShowWebPagePlugin/SampleDisplayViewModel.cs b/ShowWebPagePlugin/SampleDisplayViewModel.cs index 9276196..8db1c9b 100644 --- a/ShowWebPagePlugin/SampleDisplayViewModel.cs +++ b/ShowWebPagePlugin/SampleDisplayViewModel.cs @@ -50,6 +50,7 @@ public string Url if (this.SetProperty(ref this.url, value)) { this.SaveProperty(value); + this.NavigateToUrl(); } } }