Пример #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            _edLogService  = new EdLogService();
            _serverService = new ServerService(_edLogService);


            var mainWindow = new MainWindow(_serverService, _edLogService);

            mainWindow.Show();
        }
Пример #2
0
        public MainWindow(ServerService serverService, EdLogService edLogService)
        {
            InitializeComponent();
#if DEBUG
            Properties.Settings.Default.ApiKey = Guid.NewGuid().ToString();
#endif

            _model = this.DataContext as MainWindowViewModel;

            _edLogService = edLogService;
            _edLogService.JournalFileSelected += edLogService_JournalFileSelected;
            _edLogService.LocationUpdate      += edLogService_LocationUpdate;

            _serverService = serverService;

            _serverService.DistressSignalReceived += _serverService_DistressSignalReceived;
            _serverService.DistressSignalCreated  += serverService_DistressSignalCreated;
            _serverService.Connected += serverService_Connected;

            _serverService.Connect();

            StartKeyInterceptor();
        }