wenxiangchao
4 天以前 559890c482f5973f06aafdfec9550fee5ba3c7f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Windows;
using log4net.Config;
 
namespace CanSimulatorServer.App
{
    /// <summary>
    /// CAN 模拟器服务进程入口(纯手动启动,主程序与 DeviceBroker 均不拉起)。
    /// 读取 App.config 的 ServerPort / ListenOnAllInterfaces,拉起 TcpSimulatorHost 并显示监控 UI。
    /// </summary>
    public class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            XmlConfigurator.Configure();
 
            MainWindow = new MainWindow
            {
                Title = "CAN 模拟器服务 (CanSimulatorServer)",
                Width = 1000,
                Height = 680,
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };
            MainWindow.Show();
        }
    }
 
    /// <summary>无 XAML 启动器:SDK 工程显式入口。</summary>
    public static class Entry
    {
        [STAThread]
        public static void Main()
        {
            var app = new App();
            app.Run();
        }
    }
}