func init // adds using namespace sys.add_use('System.IO') // initialize properties if(linked("Exists") and linked("doExists")) sys.add_var(this.name, 104) end if(linked("onError")) this.setfield('ex', 'ex' + this.id) end end func doMove(data) linked("onError") ? blk.println('try {').inc() : '' blk.println('File.Move(', d('Source'), ', ', d('Destination'), ');') event("onComplete") if(linked("onError")) blk.dec().println('} catch (IOException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doCopy(data) linked("onError") ? blk.println('try {').inc() : '' blk.println('File.Copy(', d('Source'), ', ', d('Destination'), ');') event("onComplete") if(linked("onError")) blk.dec().println('} catch (IOException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doCopy2(data) linked("onError") ? blk.println('try {').inc() : '' source = d('Source') destination = d('Destination') overwrite = d('Overwrite') blk.println('File.Copy(', source, ', ', destination, ', ', (overwrite == 0) ? 'true' : overwrite, ');') event("onComplete") if(linked("onError")) blk.dec().println('} catch (IOException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doDecrypt(data) linked("onError") ? blk.println('try {').inc() : '' blk.println('File.Decrypt(', d('Source'), ');') event("onComplete") if(linked("onError")) blk.dec().println('} catch (IOException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doDelete(data) linked("onError") ? blk.println('try {').inc() : '' blk.println('File.Delete(', d('Source'), ');') event("onComplete") if(linked("onError")) blk.dec().println('} catch (IOException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doEncrypt(data) linked("onError") ? blk.println('try {').inc() : '' blk.println('File.Encrypt(', d('Source'), ');') event("onComplete") if(linked("onError")) blk.dec().println('} catch (IOException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doExists(data) if(linked("Exists")) blk.println(this.codename, ' = ', this.make_check(data), ';') event("onExists", this.codename) else event("onExists", this.make_check(data)) end end func Exists if(linked("doExists")) return(this.codename) else return(this.make_check()) end end func make_check(data) return('File.Exists(' + d('Source') + ')') end