xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
run_worker_completed_event_args.h
Go to the documentation of this file.
1
4#pragma once
5#include <any>
6#include <optional>
7#include <cstdint>
8#include <xtd/event_args.h>
9
11namespace xtd {
13 namespace forms {
21 public:
26
29 run_worker_completed_event_args(const std::any& result, std::optional<std::reference_wrapper<std::exception>> exception, bool cancel) : cancel_(cancel), exception_(exception), result_(result) {}
30
31 bool cancel() const {return cancel_;}
32 void cancel(bool value) {cancel_ = value;}
33
36 std::any user_state() const {return user_state_;}
37
38 std::any result() const {return result_;}
39
40 private:
41 bool cancel_ = false;
42 std::optional<std::reference_wrapper<std::exception>> exception_;
43 std::any result_;
44 std::any user_state_;
45 };
46 }
47}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
Provides data for the do_work event handler.
Definition: do_work_event_args.h:19
Provides data for the do_work event handler.
Definition: run_worker_completed_event_args.h:20
std::any user_state() const
Gets a value that represents the argument of an asynchronous operation.
Definition: run_worker_completed_event_args.h:36
run_worker_completed_event_args(const std::any &result, std::optional< std::reference_wrapper< std::exception > > exception, bool cancel)
Initializes a new instance of the DoWorkEventArgs class.
Definition: run_worker_completed_event_args.h:29
Contains xtd::event_args event args.
@ cancel
The dialog box return value is Cancel (usually sent from a button labeled Cancel).
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17