| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using Notifications.Wpf;
- using System;
- using System.Threading.Tasks;
- using System.Windows;
- namespace DeviceCenter
- {
- /// <summary>
- /// Splash.xaml 的交互逻辑
- /// </summary>
- public partial class Splash : Window
- {
- private NotificationManager notificationManager = new NotificationManager();
- public Splash()
- {
- InitializeComponent();
- //CarCamSDK.Net_Init();
- //Login login = new Login();
- //login.Show();
- //Close();
- init();
- }
- private async void init()
- {
- await Task.Run(() =>
- {
- int code = CarCamSDK.Net_Init();
- notificationManager.Show(new NotificationContent
- {
- Title = "Info",
- Message = "CarCamSDK Net_Init " + code,
- Type = NotificationType.Information
- });
- if (!CHCNetSDK.NET_DVR_Init())
- {
- notificationManager.Show(new NotificationContent
- {
- Title = "Error",
- Message = "NET_DVR_Init Error",
- Type = NotificationType.Error
- });
- }
- else
- {
- notificationManager.Show(new NotificationContent
- {
- Title = "Success",
- Message = "NET_DVR_Init Succss",
- Type = NotificationType.Success
- });
- }
- Application.Current.Dispatcher.Invoke((Action)(() =>
- {
- Login login = new Login();
- login.Show();
- Close();
- }));
- });
- }
- }
- }
|