CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
background_worker.h
1
2#if !defined(_background_worker_h_)
3#define _background_worker_h_
4
5#include <system/component_model/component.h>
6#include <system/smart_ptr.h>
7#include <system/multicast_delegate.h>
8#include <system/threading/thread.h>
9
10#include <system/component_model/do_work_event_args.h>
11#include <system/component_model/run_worker_completed_event_args.h>
12#include <system/component_model/progress_changed_event_args.h>
13
14namespace System { namespace ComponentModel {
15
19class ASPOSECPP_SHARED_CLASS BackgroundWorker : public Component
20{
22 typedef System::BaseTypesInfo<Component> ThisBaseTypesInfo;
24 RTTI_INFO(BackgroundWorker, ThisBaseTypesInfo)
25public:
27 ASPOSECPP_SHARED_API BackgroundWorker();
29 ASPOSECPP_SHARED_API ~BackgroundWorker();
30
31public:
38
39public:
41 ASPOSECPP_SHARED_API void RunWorkerAsync();
44 ASPOSECPP_SHARED_API void RunWorkerAsync(const System::SharedPtr<System::Object>& argument);
47 ASPOSECPP_SHARED_API void ReportProgress(int percentProgress);
51 ASPOSECPP_SHARED_API void ReportProgress(int percentProgress, const System::SharedPtr<System::Object>& userState);
52
53public:
56 inline bool get_WorkerReportsProgress() const { return m_WorkerReportsProgress; }
59 inline void set_WorkerReportsProgress(bool value) { m_WorkerReportsProgress = value; }
60
61private:
62 bool m_WorkerReportsProgress;
63 bool m_IsBusy;
65};
66
67}}
68
69#endif
Objects of this class should only be allocated using System::MakeObject() function....
Definition: background_worker.h:20
void RunWorkerAsync()
Starts execution of a background operation.
System::MulticastDelegate< void(System::SharedPtr< System::Object >, System::SharedPtr< System::ComponentModel::DoWorkEventArgs >) > DoWork
Occurs when System::ComponentModel::BackgroundWorker::RunWorkerAsync is called.
Definition: background_worker.h:33
void RunWorkerAsync(const System::SharedPtr< System::Object > &argument)
Starts execution of a background operation.
System::MulticastDelegate< void(System::SharedPtr< System::Object >, System::SharedPtr< System::ComponentModel::RunWorkerCompletedEventArgs >)> RunWorkerCompleted
Occurs when the background operation has completed, has been canceled, or has raised an exception.
Definition: background_worker.h:35
bool get_WorkerReportsProgress() const
Gets a value indicating whether the System::ComponentModel::BackgroundWorker can report progress upda...
Definition: background_worker.h:56
System::MulticastDelegate< void(System::SharedPtr< System::Object >, System::SharedPtr< System::ComponentModel::ProgressChangedEventArgs >)> ProgressChanged
Occurs when System::ComponentModel::BackgroundWorker::ReportProgress(int) is called.
Definition: background_worker.h:37
void set_WorkerReportsProgress(bool value)
Sets a value indicating whether the System::ComponentModel::BackgroundWorker can report progress upda...
Definition: background_worker.h:59
void ReportProgress(int percentProgress, const System::SharedPtr< System::Object > &userState)
Raises the System::ComponentModel::BackgroundWorker::ProgressChanged event with userState object.
void ReportProgress(int percentProgress)
Raises the System::ComponentModel::BackgroundWorker::ProgressChanged event.
Dummy class to make translated code using Component class compilable. Objects of this class should on...
Definition: component.h:15
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: db_command.h:9