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, 'FileAttributes') blk_init.println(this.codename, ' = ', this.FileAttributes(), ';') end // initialize parser sys._se_init('Parse', 'FileAttributes', 'FileAttributes') end func _se_make(value) return('(FileAttributes)Enum.Parse(typeof(FileAttributes), ' + d('Value') + ')') end func doMembers() blk.println('foreach (object item in TypeDescriptor.GetConverter(typeof(FileAttributes)).GetStandardValues()) {').inc() event('onMembers', 'item') blk.dec().println('}') end func FileAttributes() v = this.props('FileAttributes').value flags = ((v _and_ 1) ? '|FileAttributes.ReadOnly' : '') + ((v _and_ 2) ? '|FileAttributes.Hidden' : '') + ((v _and_ 4) ? '|FileAttributes.System' : '') + ((v _and_ 8) ? '|FileAttributes.Directory' : '') + ((v _and_ 16) ? '|FileAttributes.Archive' : '') + ((v _and_ 32) ? '|FileAttributes.Device' : '') + ((v _and_ 64) ? '|FileAttributes.Normal' : '') + ((v _and_ 128) ? '|FileAttributes.Temporary' : '') + ((v _and_ 256) ? '|FileAttributes.SparseFile' : '') + ((v _and_ 512) ? '|FileAttributes.ReparsePoint' : '') + ((v _and_ 1024) ? '|FileAttributes.Compressed' : '') + ((v _and_ 2048) ? '|FileAttributes.Offline' : '') + ((v _and_ 4096) ? '|FileAttributes.NotContentIndexed' : '') + ((v _and_ 8192) ? '|FileAttributes.Encrypted' : '') return('(0' + flags + ')') end