func init // adds using namespace sys.add_use('System.IO') if(linked("onError")) this.setfield('ex', 'ex' + this.id) end // initialize instance params = this.props('Constructor').value if(params == 'None') sys.add_var(this.name, 'FileStream') else if(params == 'Constructor') params = '' + d("handle") + ', ' + this.dt("FileAccess", "access") elseif(params == 'Constructor2') params = '' + d("handle") + ', ' + this.dt("FileAccess", "access") elseif(params == 'Constructor3') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") elseif(params == 'Constructor4') params = '' + d("handle") + ', ' + this.dt("FileAccess", "access") + ', ' + d("ownsHandle") elseif(params == 'Constructor5') params = '' + d("handle") + ', ' + this.dt("FileAccess", "access") + ', ' + d("bufferSize") elseif(params == 'Constructor6') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") + ', ' + this.dt("FileAccess", "access") elseif(params == 'Constructor7') params = '' + d("handle") + ', ' + this.dt("FileAccess", "access") + ', ' + d("ownsHandle") + ', ' + d("bufferSize") elseif(params == 'Constructor8') params = '' + d("handle") + ', ' + this.dt("FileAccess", "access") + ', ' + d("bufferSize") + ', ' + d("isAsync") elseif(params == 'Constructor9') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") + ', ' + this.dt("FileAccess", "access") + ', ' + this.dt("FileShare", "share") elseif(params == 'Constructor10') params = '' + d("handle") + ', ' + this.dt("FileAccess", "access") + ', ' + d("ownsHandle") + ', ' + d("bufferSize") + ', ' + d("isAsync") elseif(params == 'Constructor11') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") + ', ' + this.dt("FileAccess", "access") + ', ' + this.dt("FileShare", "share") + ', ' + d("bufferSize") elseif(params == 'Constructor12') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") + ', ' + this.dt("FileAccess", "access") + ', ' + this.dt("FileShare", "share") + ', ' + d("bufferSize") + ', ' + d("useAsync") elseif(params == 'Constructor13') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") + ', ' + this.dt("FileAccess", "access") + ', ' + this.dt("FileShare", "share") + ', ' + d("bufferSize") + ', ' + this.dt("FileOptions", "options") elseif(params == 'Constructor14') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") + ', ' + this.dt("FileSystemRights", "rights") + ', ' + this.dt("FileShare", "share") + ', ' + d("bufferSize") + ', ' + this.dt("FileOptions", "options") elseif(params == 'Constructor15') params = '' + d("Path") + ', ' + this.dt("FileMode", "Mode") + ', ' + this.dt("FileSystemRights", "rights") + ', ' + this.dt("FileShare", "share") + ', ' + d("bufferSize") + ', ' + this.dt("FileOptions", "options") + ', ' + d("security") end sys.add_object(this.codename, 'FileStream', params) end // makes implementation methods for properties sys._prop_init('CanRead', 1, 0, 104) sys._prop_init('CanSeek', 1, 0, 104) sys._prop_init('CanWrite', 1, 0, 104) sys._prop_init('Handle', 1, 0, 0) sys._prop_init('IsAsync', 1, 0, 104) sys._prop_init('Length', 1, 0, 105) sys._prop_init('Name', 1, 0, 2) sys._prop_init('SafeFileHandle', 1, 0, 0) // makes implementation of methods as properties sys._mtd_as_prop_init('GetAccessControl()') sys._mtd_as_prop_init('FileStream') // makes implementation of simple methods sys._method_init('Close') // initialize common events and properties include("MarshalByRefObject-init") include("Object-init") end func doConstructor(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("handle"), ', ', this.dt("FileAccess", "access"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor2(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("handle"), ', ', this.dt("FileAccess", "access"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor3(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor4(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("handle"), ', ', this.dt("FileAccess", "access"), ', ', d("ownsHandle"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor5(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("handle"), ', ', this.dt("FileAccess", "access"), ', ', d("bufferSize"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor6(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ', ', this.dt("FileAccess", "access"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor7(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("handle"), ', ', this.dt("FileAccess", "access"), ', ', d("ownsHandle"), ', ', d("bufferSize"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor8(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("handle"), ', ', this.dt("FileAccess", "access"), ', ', d("bufferSize"), ', ', d("isAsync"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor9(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ', ', this.dt("FileAccess", "access"), ', ', this.dt("FileShare", "share"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor10(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("handle"), ', ', this.dt("FileAccess", "access"), ', ', d("ownsHandle"), ', ', d("bufferSize"), ', ', d("isAsync"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor11(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ', ', this.dt("FileAccess", "access"), ', ', this.dt("FileShare", "share"), ', ', d("bufferSize"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor12(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ', ', this.dt("FileAccess", "access"), ', ', this.dt("FileShare", "share"), ', ', d("bufferSize"), ', ', d("useAsync"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor13(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ', ', this.dt("FileAccess", "access"), ', ', this.dt("FileShare", "share"), ', ', d("bufferSize"), ', ', this.dt("FileOptions", "options"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor14(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ', ', this.dt("FileSystemRights", "rights"), ', ', this.dt("FileShare", "share"), ', ', d("bufferSize"), ', ', this.dt("FileOptions", "options"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doConstructor15(data) linked("onError") ? blk.println('try {').inc() : '' blk.println(this.codename, ' = new FileStream(', d("Path"), ', ', this.dt("FileMode", "Mode"), ', ', this.dt("FileSystemRights", "rights"), ', ', this.dt("FileShare", "share"), ', ', d("bufferSize"), ', ', this.dt("FileOptions", "options"), ', ', this.dt("FileSecurity", "security"), ');') if(linked("onError")) blk.dec().println('} catch (Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func dt(name, data) if(linked(data)) return(d(data)) end prop = this.props(data) if(prop.type == 14) return(code(name) + '.' + this.props(data).value) elseif(prop.type == 20 and not prop.isdef) return(sys.get_undef_manager(data)) else error(this.name + ' - property ' + data + ' does not defined') end end