func init // adds using namespace sys.add_use('System.Text.RegularExpressions') sys.add_use('System.ComponentModel') // initialize a member if(not isdef('Name')) sys.add_var(this.name, 'RegexOptions') blk_init.println(this.codename, ' = ', this.RegexOptions(), ';') end // initialize parser sys._se_init('Parse', 'RegexOptions', 'RegexOptions') end func _se_make(value) return('(RegexOptions)Enum.Parse(typeof(RegexOptions), ' + d('Value') + ')') end func doMembers() blk.println('foreach (object item in TypeDescriptor.GetConverter(typeof(RegexOptions)).GetStandardValues()) {').inc() event('onMembers', 'item') blk.dec().println('}') end func RegexOptions() v = this.props('RegexOptions').value flags = ((v _and_ 1) ? '|RegexOptions.None' : '') + ((v _and_ 2) ? '|RegexOptions.IgnoreCase' : '') + ((v _and_ 4) ? '|RegexOptions.Multiline' : '') + ((v _and_ 8) ? '|RegexOptions.ExplicitCapture' : '') + ((v _and_ 16) ? '|RegexOptions.Compiled' : '') + ((v _and_ 32) ? '|RegexOptions.Singleline' : '') + ((v _and_ 64) ? '|RegexOptions.IgnorePatternWhitespace' : '') + ((v _and_ 128) ? '|RegexOptions.RightToLeft' : '') + ((v _and_ 256) ? '|RegexOptions.ECMAScript' : '') + ((v _and_ 512) ? '|RegexOptions.CultureInvariant' : '') return('(0' + flags + ')') end