using BPASmartClient.CustomResource.Pages.Enums;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.Helper;
using BPASmartClient.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using BPASmart.Server;
using BPASmartClient.CustomResource.Pages.ViewModel;
namespace BPASmart.DataServer
{
///
/// Interaction logic for App.xaml
///
public partial class App : Application
{
public static Window MainWindow;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
MenuInit();
MainView mv = new MainView();
mv.WindowState = WindowState.Normal;
MainWindow = mv;
mv.Show();
BPASmart.Server.Main.GetInstance.Init();
}
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
//数据服务中心异常退出后自动重启
}
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
}
private void MenuInit()
{
#region 消息中心
ObservableCollection InfoLog = new ObservableCollection();
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "消息日志",
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.DebugLogView",
SubMenuVisibility = Visibility.Visible,
});
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "",
MainMenuName = "消息中心",
Alias = "Device Management",
subMenumodels = InfoLog,
});
#endregion
}
private SubMenumodel AddSubMenuModel(string s)
{
return new SubMenumodel()
{
SubMenuName = s,
AssemblyName = "BPASmart.VariableManager",
ToggleWindowPath = "Views.VariableConfig",
SubMenuVisibility = Visibility.Visible,
};
}
private void DataSave()
{
}
private void DataRead()
{
Json.Read();
}
}
}