func init // adds using namespace sys.add_use('System.IO') // initialize instance params = this.props('Constructor').value if(params == 'Constructor') params = '' elseif(params == 'Constructor2') params = '' + d("Path") elseif(params == 'Constructor3') params = '' + d("Path") + ', ' + d("Filter") end sys.add_object(this.codename, 'FileSystemWatcher', params) // initialize properties sys.set_typed_field(104, 'EnableRaisingEvents') sys.set_undef_field('Filter') sys.set_typed_field(104, 'IncludeSubdirectories') if(not isdef('NotifyFilter')) v = this.props('NotifyFilter').value flags = ((v _and_ 1) ? '|NotifyFilters.FileName' : '') + ((v _and_ 2) ? '|NotifyFilters.DirectoryName' : '') + ((v _and_ 4) ? '|NotifyFilters.Attributes' : '') + ((v _and_ 8) ? '|NotifyFilters.Size' : '') + ((v _and_ 16) ? '|NotifyFilters.LastWrite' : '') + ((v _and_ 32) ? '|NotifyFilters.LastAccess' : '') + ((v _and_ 64) ? '|NotifyFilters.CreationTime' : '') + ((v _and_ 128) ? '|NotifyFilters.Security' : '') blk_init.println(this.codename, '.NotifyFilter = (0', flag, ');') end sys.set_undef_field('Path') // makes implementation methods for properties sys._prop_init('EnableRaisingEvents', 1, 1, 104) sys._prop_init('Filter', 0, 1, 2) sys._prop_init('IncludeSubdirectories', 1, 1, 104) sys._prop_init('InternalBufferSize', 1, 1, 1) sys._prop_init('NotifyFilter', 0, 1, 0) sys._prop_init('Path', 0, 1, 2) sys._prop_init('Site', 1, 1, 0) sys._prop_init('SynchronizingObject', 1, 1, 0) // makes implementation of methods as properties sys._mtd_as_prop_init('FileSystemWatcher') // makes implementation of simple methods sys._method_init('BeginInit') sys._method_init('EndInit') // initialize events sys.add_event_type('onChanged', 'Changed', 'FileSystemEvent', 'args') sys.add_event_type('onCreated', 'Created', 'FileSystemEvent', 'args') sys.add_event_type('onDeleted', 'Deleted', 'FileSystemEvent', 'args') sys.add_event_type('onError', 'Error', 'ErrorEvent', 'args') sys.add_event_type('onRenamed', 'Renamed', 'RenamedEvent', 'args') // initialize common events and properties include("Component-init") end func doConstructor() blk.println(this.codename, ' = new FileSystemWatcher();') end func doConstructor2(path) blk.println(this.codename, ' = new FileSystemWatcher(', d("Path"), ');') end func doConstructor3(path, filter) blk.println(this.codename, ' = new FileSystemWatcher(', d("Path"), ', ', d("Filter"), ');') end func doWaitForChanged(changeType) if(linked("onWaitForChanged")) event("onWaitForChanged", this.codename + '.WaitForChanged(' + d("changeType") + ')') else blk.println(this.codename, '.WaitForChanged(', d("changeType"), ');') end end func doWaitForChanged2(changeType, timeout) if(linked("onWaitForChanged")) event("onWaitForChanged", this.codename + '.WaitForChanged(' + d("changeType") + ', ' + d("timeout") + ')') else blk.println(this.codename, '.WaitForChanged(', d("changeType"), ', ', d("timeout"), ');') end end