Here's an unrelated example of using a strongly typed enum value as a parameter to a class constructor.
ObjectClrOption ( 'use', 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
;; The following line creates an enum 'object'.
enumPathType = ObjectClrNew('System.Diagnostics.Eventing.Reader.PathType')
;; The following line creates a type object with the desired enum enumerator value.
LogName = ObjectClrType('System.Diagnostics.Eventing.Reader.PathType', enumPathType.LogName)
strQuery = `<QueryList><Query Id="0" Path="Microsoft/Windows">`
strQuery = strQuery:`<Select Path="Microsoft-Windows-Diagnostics-Performance/Operational">`
strQuery = strQuery:` *[System/Opcode=34]</Select></Query></QueryList>`
;; The following line uses the typed enum value as a parameter to the class constructor for the 'EventLogQuery' class.
objLogQuery = ObjectClrNew('System.Diagnostics.Eventing.Reader.EventLogQuery','Microsoft', LogName, strQuery)
objEventReader = ObjectClrNew('System.Diagnostics.Eventing.Reader.EventLogReader', objLogQuery )
strDescription = ''
While 1
objEvent = objEventReader.ReadEvent()
if ObjectTypeGet(objEvent) == "EMPTY" then break
id = objEvent.Id
strDescription := objEvent.FormatDescription():@Lf
endwhile
Pause("Boot List", strDescription)