public static void InvokeAction(string @event, params object[] args) { switch (@event.ToLower()) { case "clear": ClearPlace?.Invoke(); break; case "exit": ExitApplication?.Invoke(); break; case "ended": OnCommandEnded?.Invoke(args[0] as Socket); break; case "sleep": OnCommandSleep?.Invoke((Task)args[0]); break; case "before": CommandBeforeStart?.Invoke(); break; default: throw new Exception("Unknown action!"); } }
public MainViewModel(IPortalPersistence model, PublisherDTO author) { _model = model ?? throw new ArgumentNullException("model"); _isLoaded = false; _publisher = author; EditArticleCommand = new DelegateCommand(param => EditArticleAction((int)param)); ExitCommand = new DelegateCommand(_ => ExitApplication?.Invoke(this, EventArgs.Empty)); CreateArticleCommand = new DelegateCommand(_ => CreateArticleAction()); Refresh(); }
public Updater(string version, string projectId, string publicKey, string updateUrl) { _updateUrl = updateUrl; _version = version.ToString(); _projectId = projectId; _publicKey = publicKey; m_Controller = new updateController(_updateUrl, _version, _publicKey); m_Controller.projectId = _projectId; m_Controller.updateInstallerStarted += (s, e) => { if (ExitApplication != null) { ExitApplication.Invoke(this, EventArgs.Empty); } }; }
private void OnExitApplication() { ExitApplication?.Invoke(this, EventArgs.Empty); }
private void ButtonExit_Click(object sender, RoutedEventArgs e) { ExitApplication?.Invoke(sender, EventArgs.Empty); }
public void OnExitApplication() { ExitApplication?.Invoke(); }
protected virtual void OnExitApplication(EventArgs e) { ExitApplication?.Invoke(this, e); }