From 00a491d93733d4625ad329b2ba8237f445364b3f Mon Sep 17 00:00:00 2001 From: Mirta Date: Wed, 30 Dec 2020 16:39:52 +0200 Subject: merge --- .../PPC/Modules/Tango.PPC.Browser/App.xaml | 11 -- .../Attributes/BoundObjectAttribute.cs | 20 -- .../BoundsObjects/KeyboardHandler.cs | 66 ------- .../PPC/Modules/Tango.PPC.Browser/BrowserModule.cs | 101 ---------- .../Modules/Tango.PPC.Browser/CefSharpOutput.zip | Bin 143444091 -> 0 bytes .../Helpers/BoundObjectsHelper.cs | 72 ------- .../Modules/Tango.PPC.Browser/Images/browser.png | Bin 2539 -> 0 bytes .../Navigation/BrowserNavigationRequest.cs | 19 -- .../Tango.PPC.Browser/Properties/AssemblyInfo.cs | 20 -- .../Properties/Resources.Designer.cs | 63 ------ .../Tango.PPC.Browser/Properties/Resources.resx | 117 ------------ .../Properties/Settings.Designer.cs | 26 --- .../Tango.PPC.Browser/Properties/Settings.settings | 7 - .../RequestHandlers/ChromiumRequestHandler.cs | 114 ----------- .../Modules/Tango.PPC.Browser/Scripts/keyboard.js | 21 -- .../Tango.PPC.Browser/Tango.PPC.Browser.csproj | 199 ------------------- .../ViewContracts/IBrowserView.cs | 18 -- .../Modules/Tango.PPC.Browser/ViewModelLocator.cs | 32 ---- .../Tango.PPC.Browser/ViewModels/BrowserViewVM.cs | 134 ------------- .../Tango.PPC.Browser/Views/BrowserView.xaml | 77 -------- .../Tango.PPC.Browser/Views/BrowserView.xaml.cs | 211 --------------------- .../Modules/Tango.PPC.Browser/Views/ErrorView.xaml | 23 --- .../Tango.PPC.Browser/Views/ErrorView.xaml.cs | 29 --- .../PPC/Modules/Tango.PPC.Browser/app.config | 90 --------- .../PPC/Modules/Tango.PPC.Browser/packages.config | 11 -- 25 files changed, 1481 deletions(-) delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/App.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Attributes/BoundObjectAttribute.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BrowserModule.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/CefSharpOutput.zip delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Helpers/BoundObjectsHelper.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Images/browser.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Navigation/BrowserNavigationRequest.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/AssemblyInfo.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.Designer.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.resx delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.Designer.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.settings delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/RequestHandlers/ChromiumRequestHandler.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Scripts/keyboard.js delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Tango.PPC.Browser.csproj delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewContracts/IBrowserView.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModelLocator.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModels/BrowserViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/app.config delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/packages.config (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/App.xaml deleted file mode 100644 index 576597134..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/App.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Attributes/BoundObjectAttribute.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Attributes/BoundObjectAttribute.cs deleted file mode 100644 index b4e822f1e..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Attributes/BoundObjectAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.PPC.Browser.Attributes -{ - public class BoundObjectAttribute : Attribute - { - public String Name { get; set; } - public String ScriptFile { get; set; } - - public BoundObjectAttribute(String name,String scriptFile) - { - Name = name; - ScriptFile = scriptFile; - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs deleted file mode 100644 index 3c608a518..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using Tango.PPC.Browser.Attributes; -using Tango.PPC.Browser.Views; -using Tango.PPC.Common.Helpers; -using Tango.Touch.Keyboard; - -namespace Tango.PPC.Browser.BoundsObjects -{ - [BoundObject("keyboard", "keyboard.js")] - public class KeyboardHandler - { - private DateTime _lastTime; - - public KeyboardHandler() - { - _lastTime = DateTime.Now; - } - - public void openKeyboard(String inputType) - { - if (DateTime.Now > _lastTime.AddMilliseconds(1000)) - { - _lastTime = DateTime.Now; - - Application.Current.Dispatcher.BeginInvoke(new Action(async () => - { - switch (inputType) - { - case "search": - KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go); - break; - default: - KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Next); - break; - } - - - await Task.Delay(50); - BrowserView.Instance.btnGo.Focus(); - await Task.Delay(50); - BrowserView.Instance.Browser.Focus(); - Debug.WriteLine("Focus"); - })); - } - } - - public void closeKeyboard() - { - if (DateTime.Now > _lastTime.AddMilliseconds(1000)) - { - _lastTime = DateTime.Now; - - Application.Current.Dispatcher.BeginInvoke(new Action(() => - { - KeyboardHelper.CloseKeyboard(); - })); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BrowserModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BrowserModule.cs deleted file mode 100644 index dc7b294d5..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BrowserModule.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media.Imaging; -using Tango.BL.Enumerations; -using Tango.PPC.Common; -using Tango.PPC.Browser.Views; -using Tango.SharedUI.Helpers; -using Tango.Core.DI; -using Tango.PPC.Common.Application; -using System.IO; -using Tango.Core.Helpers; - -namespace Tango.PPC.Browser -{ - /// - /// Represents a PPC . - /// - /// - [PPCModule(10)] - public class BrowserModule : PPCModuleBase - { - /// - /// Initializes a new instance of the class. - /// - public BrowserModule() - { - IsVisibleInMenu = false; - } - - /// - /// Gets the module name. - /// - public override string Name - { - get - { - return "Browser"; - } - } - - /// - /// Gets the module description. - /// - public override string Description - { - get - { - return "Browser module"; - } - } - - /// - /// Gets the module cover image. - /// - public override BitmapSource Image - { - get - { - return ResourceHelper.GetImageFromResources("Images/browser.png"); - } - } - - /// - /// Gets the module entry point view type. - /// - public override Type MainViewType - { - get - { - return IsCefAvailable() ? typeof(BrowserView) : typeof(ErrorView); - } - } - - /// - /// Gets the permission required to see and load this module. - /// - public override Permissions Permission - { - get - { - return Permissions.RunPPC; - } - } - - private bool IsCefAvailable() - { - return File.Exists(Path.Combine(AssemblyHelper.GetCurrentAssemblyFolder(), "x86", "CefSharp.Core.dll")); - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public override void Dispose() - { - //Dispose module here... - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/CefSharpOutput.zip b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/CefSharpOutput.zip deleted file mode 100644 index 8c68cedb7..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/CefSharpOutput.zip and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Helpers/BoundObjectsHelper.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Helpers/BoundObjectsHelper.cs deleted file mode 100644 index fe68ee848..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Helpers/BoundObjectsHelper.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Reflection; -using Tango.PPC.Browser.Attributes; -using CefSharp; -using CefSharp.Wpf; -using Tango.Core.Helpers; -using System.Windows.Threading; - -namespace Tango.PPC.Browser.Helpers -{ - public static class BoundObjectsHelper - { - private static DispatcherTimer _timer; - private static Dispatcher _dispatcher; - private static ChromiumWebBrowser _browser; - - private static List _scripts = new List(); - - public static void RegisterAllBoundObjects(ChromiumWebBrowser browser, Dispatcher dispatcher) - { - _dispatcher = dispatcher; - _browser = browser; - - _timer = new DispatcherTimer(DispatcherPriority.Background, dispatcher); - _timer.Tick += _timer_Tick; - _timer.Interval = TimeSpan.FromSeconds(2); - _timer.Stop(); - - foreach (var type in typeof(BoundObjectsHelper).Assembly.GetTypes().Where(x => x.GetCustomAttribute() != null)) - { - var att = type.GetCustomAttribute(); - - var script = EmbeddedResourceHelper.GetEmbeddedResourceText($"Tango.PPC.Browser.Scripts.{att.ScriptFile}"); - _scripts.Add(script); - - browser.JavascriptObjectRepository.Register(att.Name, Activator.CreateInstance(type), true); - - browser.FrameLoadEnd += Browser_FrameLoadEnd; - } - } - - private static void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) - { - _timer.Stop(); - _timer.Start(); - } - - private static void _timer_Tick(object sender, EventArgs e) - { - try - { - _timer.Stop(); - - _dispatcher.BeginInvoke(new Action(() => - { - foreach (var script in _scripts) - { - _browser.GetMainFrame().ExecuteJavaScriptAsync(script); - } - })); - } - catch - { - _timer.Start(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Images/browser.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Images/browser.png deleted file mode 100644 index ebb975b6f..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Images/browser.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Navigation/BrowserNavigationRequest.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Navigation/BrowserNavigationRequest.cs deleted file mode 100644 index a8becf251..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Navigation/BrowserNavigationRequest.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.PPC.Browser.Navigation -{ - public class BrowserNavigationRequest - { - public String Address { get; set; } - public bool DisplayAddressBar { get; set; } - - public BrowserNavigationRequest() - { - DisplayAddressBar = true; - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/AssemblyInfo.cs deleted file mode 100644 index 70edee491..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -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("Tango Web Browser Module")] -[assembly: AssemblyVersion("2.0.1.1407")] - -[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) -)] diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.Designer.cs deleted file mode 100644 index 01c0a8851..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Tango.PPC.Browser.Properties { - using System; - - - /// - /// 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", "15.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("Tango.PPC.Browser.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/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.Designer.cs deleted file mode 100644 index f464e258d..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Tango.PPC.Browser.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.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/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/RequestHandlers/ChromiumRequestHandler.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/RequestHandlers/ChromiumRequestHandler.cs deleted file mode 100644 index fc6cb119c..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/RequestHandlers/ChromiumRequestHandler.cs +++ /dev/null @@ -1,114 +0,0 @@ -using CefSharp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.PPC.Browser.RequestHandlers -{ - public class ChromiumRequestHandler : IRequestHandler - { - public event EventHandler AddressChanged; - - public bool GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback) - { - return false; - } - - public bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect) - { - // You can check the Request object for the URL Here - return false; - } - - public CefReturnValue OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback) - { - // You can also check the URL here - callback.Dispose(); - return CefReturnValue.Continue; - } - - public bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) - { - callback.Dispose(); - return false; - } - - public bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture) - { - return false; - } - - public void OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath) - { - } - - public bool OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url) - { - return false; - } - - public bool OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize, IRequestCallback callback) - { - callback.Dispose(); - return false; - } - - public void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status) - { - } - - public void OnRenderViewReady(IWebBrowser browserControl, IBrowser browser) - { - } - - public void OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength) - { - // You can also check the request URL here - } - - public void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl) - { - } - - public bool OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response) - { - return false; - } - - - public IResponseFilter GetResourceResponseFilter(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response) - { - return null; - } - - - public void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, ref string newUrl) - { - } - - public bool OnSelectClientCertificate(IWebBrowser browserControl, IBrowser browser, bool isProxy, string host, int port, System.Security.Cryptography.X509Certificates.X509Certificate2Collection certificates, ISelectClientCertificateCallback callback) - { - callback.Dispose(); - return false; - } - - public bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect) - { - AddressChanged?.Invoke(this, request.Url); - return false; - } - - public IResourceRequestHandler GetResourceRequestHandler(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool isNavigation, bool isDownload, string requestInitiator, ref bool disableDefaultHandling) - { - return null; - } - - public bool GetAuthCredentials(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback) - { - callback.Dispose(); - return false; - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Scripts/keyboard.js b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Scripts/keyboard.js deleted file mode 100644 index 21771eb8e..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Scripts/keyboard.js +++ /dev/null @@ -1,21 +0,0 @@ -(async function () { - await CefSharp.BindObjectAsync("keyboard", "bound"); - - var inputs = document.getElementsByTagName('input'); - var i = 0; - - do { - - var type = inputs[i].type; - - if (type == 'text' || type == 'email' || type == 'password' || type == 'search' || type == 'date' || type == 'url' || type == 'time' || type == 'tel' || type == 'number') { - inputs[i].onfocus = function () { - keyboard.openKeyboard(type); - } - inputs[i].onblur = function () { - keyboard.closeKeyboard(); - } - } - } - while (inputs[++i]) -})(); \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Tango.PPC.Browser.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Tango.PPC.Browser.csproj deleted file mode 100644 index b742d4d75..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Tango.PPC.Browser.csproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - true - Debug - AnyCPU - {F02EAA84-AD59-465B-99A2-4422C13BFB72} - library - Tango.PPC.Browser - Tango.PPC.Browser - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - - - - true - full - false - ..\..\..\Build\PPC\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll - True - - - ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll - - - ..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll - - - ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll - - - - - - ..\..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - GlobalVersionInfo.cs - - - - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - BrowserView.xaml - - - ErrorView.xaml - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - {f441feee-322a-4943-b566-110e12fd3b72} - Tango.BL - - - {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} - Tango.Core - - - {b112d89a-a106-41ae-a0c1-4abc84c477f5} - Tango.DragAndDrop - - - {bc932dbd-7cdb-488c-99e4-f02cf441f55e} - Tango.Logging - - - {e4927038-348d-4295-aaf4-861c58cb3943} - Tango.PMR - - - {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} - Tango.Settings - - - {8491d07b-c1f6-4b62-a412-41b9fd2d6538} - Tango.SharedUI - - - {fd86424c-6e84-491b-8df9-3d0f5c236a2a} - Tango.Touch - - - {74e700b0-1156-4126-be40-ee450d3c3026} - Tango.Transport - - - {0be74eee-22cb-4dba-b896-793b9e1a3ac0} - Tango.PPC.Common - - - - - - - - - - - - - - - - - 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/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewContracts/IBrowserView.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewContracts/IBrowserView.cs deleted file mode 100644 index 8369209a3..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewContracts/IBrowserView.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PPC.Common; -using Tango.SharedUI; - -namespace Tango.PPC.Browser.ViewContracts -{ - public interface IBrowserView : IPPCView - { - event EventHandler AddressChanged; - bool CanGoBack(); - void NavigateTo(String address); - void GoBack(); - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModelLocator.cs deleted file mode 100644 index 054310e99..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModelLocator.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.DI; -using Tango.PPC.Browser.ViewModels; - -namespace Tango.PPC.Browser -{ - public static class ViewModelLocator - { - /// - /// Initializes a new instance of the ViewModelLocator class. - /// - static ViewModelLocator() - { - TangoIOC.Default.Register(); - } - - /// - /// Gets the main view VM. - /// - public static BrowserViewVM BrowserViewVM - { - get - { - return TangoIOC.Default.GetInstance(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModels/BrowserViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModels/BrowserViewVM.cs deleted file mode 100644 index 0f5a49639..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/ViewModels/BrowserViewVM.cs +++ /dev/null @@ -1,134 +0,0 @@ -using CefSharp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.Commands; -using Tango.PPC.Browser.Navigation; -using Tango.PPC.Browser.ViewContracts; -using Tango.PPC.Common; -using Tango.PPC.Common.Navigation; -using Tango.Touch.Keyboard; - -namespace Tango.PPC.Browser.ViewModels -{ - /// - /// Represents the main view VM and entry point for . - /// - /// - public class BrowserViewVM : PPCViewModel, INavigationObjectReceiver - { - private bool _isFromObject; - - private String _address; - public String Address - { - get { return _address; } - set { _address = value; RaisePropertyChangedAuto(); } - } - - private bool _displayAddressBar; - public bool DisplayAddressBar - { - get { return _displayAddressBar; } - set { _displayAddressBar = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand GoCommand { get; set; } - - public BrowserViewVM() - { - DisplayAddressBar = true; - - GoCommand = new RelayCommand(Go); - } - - public override void OnViewAttached() - { - base.OnViewAttached(); - View.AddressChanged += View_AddressChanged; - } - - private void View_AddressChanged(object sender, string address) - { - Address = address; - } - - public override void OnNavigatedTo() - { - base.OnNavigatedTo(); - - KeyboardView.Default.OutputMode = KeyboardOutputMode.Windows; - - if (!_isFromObject) - { - DisplayAddressBar = true; - } - - _isFromObject = false; - } - - public override void OnNavigatedFrom() - { - base.OnNavigatedFrom(); - KeyboardView.Default.OutputMode = KeyboardOutputMode.Wpf; - } - - public override Task OnNavigateBackRequest() - { - if (View != null && View.CanGoBack()) - { - View.GoBack(); - return Task.FromResult(false); - } - else - { - return Task.FromResult(true); - } - } - - /// - /// Called when the application has been started - /// - public override void OnApplicationStarted() - { - - } - - public override void OnApplicationShuttingDown() - { - base.OnApplicationShuttingDown(); - - try - { - Cef.Shutdown(); - } - catch (Exception ex) - { - LogManager.Log(ex, "Error shutting down cef."); - } - } - - private void Go() - { - if (View != null) - { - View.NavigateTo(Address); - } - } - - public void OnNavigatedToWithObject(BrowserNavigationRequest obj) - { - _isFromObject = true; - - DisplayAddressBar = obj.DisplayAddressBar; - - if (obj.Address != null) - { - Address = obj.Address; - Go(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml deleted file mode 100644 index ce28d660e..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page Not Found - - The page at '' - could not be reached. - - Please check your internet connection. - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml.cs deleted file mode 100644 index e7fe1ca27..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/BrowserView.xaml.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Threading; -using CefSharp; -using CefSharp.Wpf; -using Tango.Core.DI; -using Tango.Core.Helpers; -using Tango.Logging; -using Tango.PPC.Browser.BoundsObjects; -using Tango.PPC.Browser.ViewContracts; -using Tango.PPC.Common.Helpers; -using Tango.Touch.Keyboard; - -namespace Tango.PPC.Browser.Views -{ - /// - /// Interaction logic for MainView.xaml - /// - public partial class BrowserView : UserControl, IBrowserView - { - public event EventHandler AddressChanged; - - public static BrowserView Instance { get; set; } - - public BrowserView() - { - try - { - var settings = new CefSettings(); - settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe"; - settings.UserAgent = "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"; - - Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null); - } - catch (Exception ex) - { - LogManager.Default.Log(ex, "Error loading cef."); - } - - InitializeComponent(); - - Instance = this; - - TangoIOC.Default.Register(this); - - Helpers.BoundObjectsHelper.RegisterAllBoundObjects(Browser, Dispatcher); - - KeyboardView.Default.KeyboardOpened += Default_KeyboardOpened; - KeyboardView.Default.KeyboardClosed += Default_KeyboardClosed; - - var handler = new RequestHandlers.ChromiumRequestHandler(); - handler.AddressChanged += Handler_AddressChanged; - Browser.RequestHandler = handler; - Browser.LoadError += Browser_LoadError; - Browser.LoadingStateChanged += Browser_LoadingStateChanged; - } - - private void Browser_LoadError(object sender, LoadErrorEventArgs e) - { - //if (e.ErrorCode == CefErrorCode.ConnectionTimedOut || e.ErrorCode == CefErrorCode.NameNotResolved) - //{ - InvokeUI(() => - { - runError.Text = e.ErrorText; - gridError.Visibility = Visibility.Visible; - }); - //} - } - - private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e) - { - if (!e.IsLoading) - { - InvokeUI(() => - { - KeyboardHelper.CloseKeyboard(); - }); - } - else - { - InvokeUI(() => - { - gridError.Visibility = Visibility.Hidden; - }); - } - } - - private void Handler_AddressChanged(object sender, string address) - { - InvokeUI(() => - { - AddressChanged?.Invoke(this, address); - }); - } - - private void Default_KeyboardClosed(object sender, EventArgs e) - { - Browser.VerticalAlignment = VerticalAlignment.Stretch; - Browser.Height = double.NaN; - } - - private void Default_KeyboardOpened(object sender, EventArgs e) - { - Browser.VerticalAlignment = VerticalAlignment.Top; - Browser.Height = 780; - } - - public bool CanGoBack() - { - return Browser.CanGoBack; - } - - public void NavigateTo(string address) - { - if (Browser.Address != address) - { - String uri; - - if (ValidHttpURL(address, out uri)) - { - Browser.Address = uri; - } - else - { - Browser.Address = $"google.com/search?q={address.Replace(" ", "+")}"; - } - } - else - { - Browser.Reload(); - } - } - - public static bool ValidHttpURL(string s, out string result) - { - if (Uri.IsWellFormedUriString(s, UriKind.Absolute)) - { - result = s; - return true; - } - else if (s.StartsWith("www.")) - { - result = "http://" + s; - return true; - } - - result = s; - return false; - } - - public void GoBack() - { - if (Browser.CanGoBack) - { - Browser.Back(); - } - } - - private async void TxtAddress_GotFocus(object sender, RoutedEventArgs e) - { - KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go); - await Task.Delay(100); - txtAddress.SelectAll(); - } - - private void TxtAddress_LostFocus(object sender, RoutedEventArgs e) - { - KeyboardHelper.CloseKeyboard(); - } - - private void TxtAddress_KeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Return) - { - KeyboardHelper.CloseKeyboard(); - NavigateTo(txtAddress.Text); - } - } - - private void TxtAddress_MouseUp(object sender, MouseButtonEventArgs e) - { - KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go); - } - - private async void TxtAddress_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) - { - KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go); - await Task.Delay(100); - txtAddress.SelectAll(); - } - - private void InvokeUI(Action action) - { - Dispatcher.BeginInvoke(action); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml deleted file mode 100644 index 25e3381ba..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Browser Not Loaded - - The browser module was not loaded properly or has caused some error. - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml.cs deleted file mode 100644 index 0d59b80f0..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/Views/ErrorView.xaml.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using Tango.PPC.Browser.ViewContracts; - -namespace Tango.PPC.Browser.Views -{ - /// - /// Interaction logic for ErrorView.xaml - /// - public partial class ErrorView : UserControl - { - public ErrorView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/app.config deleted file mode 100644 index cf33970a7..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/app.config +++ /dev/null @@ -1,90 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/packages.config deleted file mode 100644 index f7fe1b9a2..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file -- cgit v1.3.1