| | |
| | | using GZ.DB.Repository.OIDATABASE; |
| | | using GZ.DB.IRepository.OIDATABASE; |
| | | using GZ.DB.Entity.OIDATABASE; |
| | | using Microsoft.Web.WebView2.Wpf; |
| | | using System.Threading; |
| | | |
| | | namespace GZ.Projects.AuxAllWCS |
| | | { |
| | |
| | | public View1() |
| | | { |
| | | InitializeComponent(); |
| | | #region éå¶è¿è¡å®ä¾æ°é |
| | | #region éå¶è¿è¡å®ä¾æ°é |
| | | System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("AuxAllWCS"); |
| | | if (processes.Length > System.Int32.Parse(System.Configuration.ConfigurationManager.AppSettings["InstanceLimit"])) |
| | | { |
| | | System.Windows.MessageBox.Show("è¿è¡å¤±è´¥:è¿è¡å®ä¾æ°éå·²è¶
åºéå¶"); |
| | | this.Close(); |
| | | } |
| | | #endregion |
| | | this.DataContext = ViewModel.CreateInstance(this,typeof(View1)); |
| | | #endregion |
| | | this.DataContext = ViewModel.CreateInstance(this, typeof(View1)); |
| | | this.Loaded += (this.DataContext as ViewModel).View1_LoadEvent; |
| | | this.Closing += (this.DataContext as ViewModel).View1_CloseEvent; |
| | | this.Closing += (this.DataContext as ViewModel).View1_CloseEvent; |
| | | |
| | | commmd(); |
| | | } |
| | | |
| | | public async void commmd() |
| | | { |
| | | await webView.EnsureCoreWebView2Async(); |
| | | labbb: |
| | | if (!string.IsNullOrEmpty(HttpServer._listenerPrefix)) |
| | | if (webView.Source != new Uri(HttpServer._listenerPrefix)) |
| | | { |
| | | webView.CoreWebView2.Navigate(HttpServer._listenerPrefix + "/index.html"); |
| | | goto EndInit; |
| | | } |
| | | System.Threading.Thread.Sleep(2000); |
| | | goto labbb; |
| | | EndInit: |
| | | Console.WriteLine("end"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |