func init // add using namespaces sys.add_use('System.IO') // initialize properties if(linked("Attributes") and linked("doGetAttributes")) sys.add_var(this.name, 'FileAttributes') end this.setfield('ex', 'ex' + this.id) end func doSetAttributes(data) linked("onError") ? blk.println('try {').inc() : '' blk.println('File.SetAttributes(', d('Source'), ', ', d("fileAttributes"), ');') if(linked("Attributes") and linked("doGetAttributes")) blk.println(this.codename, ' = ', d("fileAttributes"), ';') end if(linked("onError")) blk.dec().println('} catch(Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doGetAttributes(source) linked("onError") ? blk.println('try {').inc() : '' if(linked("Attributes")) blk.println(this.codename, ' = ', this.make_attr(source), ';') event("onAttributes", this.codename) else event("onAttributes", this.make_attr(source)) end if(linked("onError")) blk.dec().println('} catch(Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func Attributes if(linked("doGetAttributes")) return(this.codename) else return(this.make_attr()) end end func make_attr(source) return('File.GetAttributes(' + d('Source') + ')') end