static void Main() { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); AlarmMonitorContext _context = new AlarmMonitorContext(); PanelPresenter panelPresenter = new PanelPresenter(_context); FrmPanel frmPanel = new FrmPanel(_context); System.Windows.Forms.Application.Run(frmPanel); }
public void LoadForm() { PanelPresenter presenter = new PanelPresenter(this); presenter.LocalidadResult(codigo); //Data Localidad labelX1.Text = "Sucursal: " + Sucursal; labelX2.Text = "Marca: " + Marca; labelX3.Text = "Empresa: " + Empresa; labelX4.Text = "Localidad:" + Localidad; FileStream fs = new System.IO.FileStream(Logotipo, FileMode.Open, FileAccess.Read); pictureBox1.Image = Image.FromStream(fs); pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; fs.Close(); //Encargado auditado labelX5.Text = "Jefe de Sucursal: " + Encargado; //Nombre auditor labelX6.Text = "Auditor: " + NombreAuditor; }
/// <summary> /// System.Windows.Application.Startup イベントを発生させます。 /// </summary> /// <param name="e">イベント データを格納している System.Windows.StartupEventArgsです。</param> protected override async void OnStartup(StartupEventArgs e) { string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); ProfileOptimization.SetProfileRoot(path); ProfileOptimization.StartProfile("Naya.profile"); if (!Environment.Is64BitOperatingSystem || !Environment.Is64BitProcess) { MessageBox.Show("Not Support 32BitOS."); Environment.Exit(-1); } AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.CurrentDomain_UnhandledException); // Setup PluginPresenter. { PluginPresenter pluginPresenter = new PluginPresenter(); string pluginPath = Path.Combine(path, "Plugins"); pluginPresenter.Setup(pluginPath); this.presenter.AddPluginPresenter(pluginPresenter); } // Setup LogPresenter { OutputLogFactory factory = new OutputLogFactory(); LogPresenter logPresenter = new LogPresenter(factory); this.presenter.AddLogPresenter(logPresenter); } // Setup OperationPresenter { OperationPresenter operationPresenter = new OperationPresenter(); this.presenter.AddOperationPresenter(operationPresenter); } // Setup MenuPresenter { MenuPresenter menuPresenter = new MenuPresenter(); this.presenter.AddMenuPresenter(menuPresenter); } // Setup PanelPresenter { PanelPresenter panelPresenter = new PanelPresenter(); this.presenter.AddPanelPresenter(panelPresenter); } // Setup RepositoryPresenter { RepositoryPresenter repositoryPresenter = new RepositoryPresenter(); this.presenter.AddRepositoryPresenter(repositoryPresenter); } // Setup ScriptPresenter { PythonScriptBridge scriptBridge = new PythonScriptBridge("Naya"); ScriptPresenter scriptPresenter = new ScriptPresenter(scriptBridge); this.presenter.AddScriptPresenter(scriptPresenter); } MainWindow window = new MainWindow(); MainViewModel viewModel = new MainViewModel(); GlobalPresenter.SetOwner(window); window.DataContext = viewModel; window.Show(); window.IsEnabled = false; await NayaPresenter.Initialize(); if (LayoutHelper.HasAvalonDockConfigFile()) { window.LoadLayout(); } else { GlobalPresenter.MakeDefaultTools(); } window.IsEnabled = true; }