public void Run() { if (_worldConfiguration == null) { return; } _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.SUCCESSFULLY_LOADED)); _events.ForEach(e => { Observable.Interval(e.Delay).Subscribe(_ => e.Execution()); }); ConnectMaster(); AppDomain.CurrentDomain.ProcessExit += (s, e) => { var eventSaveAll = new SaveAll(); eventSaveAll.Execution(); _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.CHANNEL_WILL_EXIT)); Thread.Sleep(30000); }; try { _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.LISTENING_PORT), _worldConfiguration.Port); Console.Title += $" - Port : {_worldConfiguration.Port} - WebApi : {_worldConfiguration.WebApi}"; _networkManager.RunServerAsync().Wait(); } catch { Console.ReadKey(); } }
public async Task RunAsync() { await _mapInstanceProvider.InitializeAsync().ConfigureAwait(false); _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.SUCCESSFULLY_LOADED)); _events.ForEach(e => { Observable.Interval(e.Delay).Subscribe(_ => e.ExecutionAsync()); }); AppDomain.CurrentDomain.ProcessExit += (s, e) => { var eventSaveAll = new SaveAll(_logger); _ = eventSaveAll.ExecutionAsync(); _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.CHANNEL_WILL_EXIT)); Thread.Sleep(30000); }; try { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { Console.Title += $@" - Port : {_worldConfiguration.Value.Port} - WebApi : {_worldConfiguration.Value.WebApi}"; } _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.LISTENING_PORT), _worldConfiguration.Value.Port); await Task.WhenAny(_channelHttpClient.ConnectAsync(), _networkManager.RunServerAsync()).ConfigureAwait(false); } catch { Console.ReadKey(); } }
public void CreateMainMenu(Gtk.Menu menu) { window_menu = menu; menu.Append(SaveAll.CreateAcceleratedMenuItem(Gdk.Key.A, Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.ControlMask)); menu.Append(CloseAll.CreateAcceleratedMenuItem(Gdk.Key.W, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask)); menu.AppendSeparator(); }
private void buttonAutoSave_Click(object sender, EventArgs e) { FolderBrowserDialog fdDialog = new FolderBrowserDialog(); if (fdDialog.ShowDialog() == DialogResult.OK) { SaveAll?.Invoke(this, fdDialog.SelectedPath); } }
/// <summary> /// Fills in the trial data and save. /// </summary> /// <param name="contextTrialTitle">The context trial title.</param> public void FillinTrialDataAndSave(string contextTrialTitle) { CreatedTrialRecord.Click(); FillInTrialDateDetails(); FillInTrialDetailsAndActivity(); FillInCancerParticipantsData(); SaveAll.Click(); Thread.Sleep(TimeSpan.FromSeconds(12)); }
public void RegisterActions(Gtk.Application app, GLib.Menu menu) { app.AddAccelAction(SaveAll, "<Ctrl><Alt>A"); menu.AppendItem(SaveAll.CreateMenuItem()); app.AddAccelAction(CloseAll, "<Primary><Shift>W"); menu.AppendItem(CloseAll.CreateMenuItem()); doc_section = new GLib.Menu(); menu.AppendSection(null, doc_section); app.AddAction(active_doc_action); }
public async Task RunAsync() { if (_worldConfiguration == null) { return; } await _mapInstanceProvider.InitializeAsync().ConfigureAwait(false); _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.SUCCESSFULLY_LOADED)); _events.ForEach(e => { Observable.Interval(e.Delay).Subscribe(_ => e.ExecutionAsync()); }); AppDomain.CurrentDomain.ProcessExit += (s, e) => { var eventSaveAll = new SaveAll(_logger); eventSaveAll.ExecutionAsync().Forget(); _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.CHANNEL_WILL_EXIT)); Thread.Sleep(30000); }; try { try { Console.Title += $@" - Port : {_worldConfiguration.Port} - WebApi : {_worldConfiguration.WebApi}"; } catch (PlatformNotSupportedException) { _logger.Warning(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.PLATFORM_UNSUPORTED_CONSOLE_TITLE)); } _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.LISTENING_PORT), _worldConfiguration.Port); await Task.WhenAny(_channelHttpClient.ConnectAsync(), _networkManager.RunServerAsync()).ConfigureAwait(false); } catch { Console.ReadKey(); } }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { await _mapInstanceGeneratorService.InitializeAsync().ConfigureAwait(false); _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.SUCCESSFULLY_LOADED)); AppDomain.CurrentDomain.ProcessExit += (s, e) => { var eventSaveAll = new SaveAll(_logger); _ = eventSaveAll.ExecuteAsync(); _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.CHANNEL_WILL_EXIT)); Thread.Sleep(30000); }; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { Console.Title += $@" - Port : {_worldConfiguration.Value.Port} - WebApi : {_worldConfiguration.Value.WebApi}"; } _logger.Information(LogLanguage.Instance.GetMessageFromKey(LogLanguageKey.LISTENING_PORT), _worldConfiguration.Value.Port); await Task.WhenAny(_clock.Run(stoppingToken), _channelHttpClient.ConnectAsync(), _networkManager.RunServerAsync()).ConfigureAwait(false); }