func init // adds using namespace sys.add_use('System.Diagnostics') // initialize instance if(linked("EventLog")) this.setfield('log', d("EventLog")) elseif(isdef("EventLog")) error(this.name + ' - property EventLog does not defined') else this.setfield('log', sys.get_undef_manager("EventLog")) end if(linked("onError")) this.setfield('ex', 'ex' + this.id) end end func doCreateEventSource(data) blk.println('EventLog.CreateEventSource(', d("sourceData"), ');') end func doCreateEventSource2(data) blk.println('EventLog.CreateEventSource(', d("source"), ', ', d("logName"), ');') end func doCreateEventSource3(data) blk.println('EventLog.CreateEventSource(', d("source"), ', ', d("logName"), ', ', d("machineName"), ');') end func doDelete(data) blk.println('EventLog.Delete(', d("logName"), ');') end func doDelete2(data) blk.println('EventLog.Delete(', d("logName"), ', ', d("machineName"), ');') end func doDeleteEventSource(data) blk.println('EventLog.DeleteEventSource(', d("source"), ');') end func doDeleteEventSource2(data) blk.println('EventLog.DeleteEventSource(', d("source"), ', ', d("machineName"), ');') end func doEnableRaisingEvents(data) blk.println(this.log, '.EnableRaisingEvents = ', sys.to_type(data, 104), ';') end func doExists(data) if(linked("onExists")) event("onExists", 'EventLog.Exists(' + d("logName") + ')') else blk.println('EventLog.Exists(', d("logName"), ');') end end func doExists2(data) if(linked("onExists")) event("onExists", 'EventLog.Exists(' + d("logName") + ', ' + d("machineName") + ')') else blk.println('EventLog.Exists(', d("logName"), ', ', d("machineName"), ');') end end func GetEventLogs return('EventLog.GetEventLogs()') end func doGetEventLogs2(data) if(linked("onGetEventLogs")) event("onGetEventLogs", 'EventLog.GetEventLogs(' + d("machineName") + ')') else blk.println('EventLog.GetEventLogs(', d("machineName"), ');') end end func doLogNameFromSourceName(data) if(linked("onLogNameFromSourceName")) event("onLogNameFromSourceName", 'EventLog.LogNameFromSourceName(' + d("source") + ', ' + d("machineName") + ')') else blk.println('EventLog.LogNameFromSourceName(', d("source"), ', ', d("machineName"), ');') end end func doModifyOverflowPolicy(data) blk.println(this.log, '.ModifyOverflowPolicy(', d("action"), ', ', d("retentionDays"), ');') end func doRegisterDisplayName(data) blk.println(this.log, '.RegisterDisplayName(', d("resourceFile"), ', ', d("resourceId"), ');') end func doSourceExists(data) if(linked("onSourceExists")) event("onSourceExists", 'EventLog.SourceExists(' + d("source") + ')') else blk.println('EventLog.SourceExists(', d("source"), ');') end end func doSourceExists2(data) if(linked("onSourceExists")) event("onSourceExists", 'EventLog.SourceExists(' + d("source") + ', ' + d("machineName") + ')') else blk.println('EventLog.SourceExists(', d("source"), ', ', d("machineName"), ');') end end func doWriteEntry(data) blk.println(this.log, '.WriteEntry(', d("Message"), ');') end func doWriteEntry2(data) blk.println(this.log, '.WriteEntry(', d("Message"), ', ', d("type"), ');') end func doWriteEntry3(data) blk.println('EventLog.WriteEntry(', d("source"), ', ', d("Message"), ');') end func doWriteEntry4(data) blk.println(this.log, '.WriteEntry(', d("Message"), ', ', d("type"), ', ', d("eventID"), ');') end func doWriteEntry5(data) blk.println('EventLog.WriteEntry(', d("source"), ', ', d("Message"), ', ', d("type"), ');') end func doWriteEntry6(data) blk.println(this.log, '.WriteEntry(', d("Message"), ', ', d("type"), ', ', d("eventID"), ', ', d("category"), ');') end func doWriteEntry7(data) blk.println('EventLog.WriteEntry(', d("source"), ', ', d("Message"), ', ', d("type"), ', ', d("eventID"), ');') end func doWriteEntry8(data) blk.println(this.log, '.WriteEntry(', d("Message"), ', ', d("type"), ', ', d("eventID"), ', ', d("category"), ', ', d("rawData"), ');') end func doWriteEntry9(data) blk.println('EventLog.WriteEntry(', d("source"), ', ', d("Message"), ', ', d("type"), ', ', d("eventID"), ', ', d("category"), ');') end func doWriteEntry10(data) blk.println('EventLog.WriteEntry(', d("source"), ', ', d("Message"), ', ', d("type"), ', ', d("eventID"), ', ', d("category"), ', ', d("rawData"), ');') end func doWriteEvent(data) blk.println(this.log, '.WriteEvent(', d("instance"), ', ', d("values"), ');') end func doWriteEvent2(data) blk.println(this.log, '.WriteEvent(', d("instance"), ', ', d("data"), ', ', d("values"), ');') end func doWriteEvent3(data) blk.println('EventLog.WriteEvent(', d("source"), ', ', d("instance"), ', ', d("values"), ');') end func doWriteEvent4(data) blk.println('EventLog.WriteEvent(', d("source"), ', ', d("instance"), ', ', d("data"), ', ', d("values"), ');') end