xtd.forms - Reference Guide  0.1.0
Modern c++17 library containing classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and Linux like Ubuntu operating system.
run_worker_completed_event_args.h
1 #pragma once
2 #include <any>
3 #include <optional>
4 #include <cstdint>
5 #include <xtd/event_args.h>
6 
8 namespace xtd {
10  namespace forms {
12  class run_worker_completed_event_args : public event_args {
13  public:
16  run_worker_completed_event_args& operator=(const run_worker_completed_event_args& do_work_event_args) = default;
18 
21  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) {}
22 
23  bool cancel() const {return cancel_;}
24  void cancel(bool value) {cancel_ = value;}
25 
28  std::any user_state() const {return user_state_;}
29 
30  std::any result() const {return result_;}
31 
32  private:
33  bool cancel_ = false;
34  std::optional<std::reference_wrapper<std::exception>> exception_;
35  std::any result_;
36  std::any user_state_;
37  };
38  }
39 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Provides data for the do_work event handler.
Definition: run_worker_completed_event_args.h:12
Provides data for the do_work event handler.
Definition: do_work_event_args.h:11
std::any user_state() const
Gets a value that represents the argument of an asynchronous operation.
Definition: run_worker_completed_event_args.h:28
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:21