func init // adds using namespace sys.add_use('System.ComponentModel') // initialize instance sys.add_object(this.codename, 'BackgroundWorker') // initialize properties sys.set_typed_field(104, 'WorkerReportsProgress') sys.set_typed_field(104, 'WorkerSupportsCancellation') // makes implementation methods for properties sys._prop_init('CancellationPending', 1, 0, 104) sys._prop_init('IsBusy', 1, 0, 104) sys._prop_init('WorkerReportsProgress', 1, 1, 104) sys._prop_init('WorkerSupportsCancellation', 1, 1, 104) // makes implementation of methods as properties sys._mtd_as_prop_init('BackgroundWorker') // makes implementation of simple methods sys._method_init('CancelAsync') sys._method_init('RunWorkerAsync') // initialize events sys.add_event_type('onDoWork', 'DoWork', 'DoWorkEvent', 'args') sys.add_event_type('onProgressChanged', 'ProgressChanged', 'ProgressChangedEvent', 'args') sys.add_event_type('onRunWorkerCompleted', 'RunWorkerCompleted', 'RunWorkerCompletedEvent', 'args') // initialize common events and properties include("Component-init") end func doReportProgress(percentProgress) blk.println(this.codename, '.ReportProgress(', d("percentProgress"), ');') end func doReportProgress2(percentProgress, userState) blk.println(this.codename, '.ReportProgress(', d("percentProgress"), ', ', d("userState"), ');') end func doRunWorkerAsync2(argument) blk.println(this.codename, '.RunWorkerAsync(', d("argument"), ');') end