func init // adds using namespace sys.add_use('System.IO') sys.add_use('System.ComponentModel') // initialize a member if(not isdef('Name')) sys.add_var(this.name, 'FileOptions') blk_init.println(this.codename, ' = ', this.FileOptions(), ';') end // initialize parser sys._se_init('Parse', 'FileOptions', 'FileOptions') end func _se_make(value) return('(FileOptions)Enum.Parse(typeof(FileOptions), ' + d('Value') + ')') end func doMembers() blk.println('foreach (object item in TypeDescriptor.GetConverter(typeof(FileOptions)).GetStandardValues()) {').inc() event('onMembers', 'item') blk.dec().println('}') end func FileOptions() v = this.props('FileOptions').value flags = ((v _and_ 1) ? '|FileOptions.None' : '') + ((v _and_ 2) ? '|FileOptions.WriteThrough' : '') + ((v _and_ 4) ? '|FileOptions.Asynchronous' : '') + ((v _and_ 8) ? '|FileOptions.RandomAccess' : '') + ((v _and_ 16) ? '|FileOptions.DeleteOnClose' : '') + ((v _and_ 32) ? '|FileOptions.SequentialScan' : '') + ((v _and_ 64) ? '|FileOptions.Encrypted' : '') return('(0' + flags + ')') end