xtd 0.2.0
Loading...
Searching...
No Matches
run_worker_completed_event_args.h
Go to the documentation of this file.
1
4#pragma once
5#include <xtd/any>
6#include <xtd/event_args>
7#include <xtd/optional>
8#include <cstdint>
9
11namespace xtd {
13 namespace forms {
25 public:
30
32
36 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) {}
38
40
42 bool cancel() const noexcept {return cancel_;}
43 void cancel(bool value) {cancel_ = value;}
44
47 std::any user_state() const noexcept {return user_state_;}
48
49 std::any result() const noexcept {return result_;}
51
52 private:
53 bool cancel_ = false;
54 std::optional<std::reference_wrapper<std::exception>> exception_;
55 std::any result_;
56 std::any user_state_;
57 };
58 }
59}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Defines the base class for predefined exceptions in the xtd namespace.
Definition exception.h:28
Provides data for the xtd::forms::background_worker::do_work event handler.
Definition do_work_event_args.h:23
Provides data for the xtd::forms::background_worker::run_worker_completed event handler.
Definition run_worker_completed_event_args.h:24
std::any user_state() const noexcept
Gets a value that represents the argument of an asynchronous operation.
Definition run_worker_completed_event_args.h:47
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:36
@ 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 xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10