func init // adds using namespace sys.add_use('System.Drawing') // initialize instance params = this.props('Constructor').value if(params == 'Constructor') params = '' + d("location") + ', ' + d("size") elseif(params == 'Constructor2') params = '' + sys.get_typed_field(0, "x", 1) + ', ' + sys.get_typed_field(0, "y", 1) + ', ' + sys.get_typed_field(0, "width", 1) + ', ' + sys.get_typed_field(0, "height", 1) end sys.add_object(this.codename, 'Rectangle', params) // makes implementation methods for properties sys._prop_init('.Bottom', 1, 0, 1) sys._prop_init('.Height', 1, 1, 1) sys._prop_init('IsEmpty', 1, 0, 104) sys._prop_init('.Left', 1, 0, 1) sys._prop_init('.Location', 1, 1, 0) sys._prop_init('.Right', 1, 0, 1) sys._prop_init('.Size', 1, 1, 0) sys._prop_init('.Top', 1, 0, 1) sys._prop_init('.Width', 1, 1, 1) sys._prop_init('.X', 1, 1, 1) sys._prop_init('.Y', 1, 1, 1) // makes implementation of methods as properties sys._mtd_as_prop_init('GetHashCode()') sys._mtd_as_prop_init('ToString()') sys._mtd_as_prop_init('Rectangle') end func doConstructor(data) blk.println(this.codename, ' = new Rectangle(', d("location"), ', ', d("size"), ');') end func doConstructor2(data) blk.println(this.codename, ' = new Rectangle(', d("x", 1), ', ', d("y", 1), ', ', d("width", 1), ', ', d("height", 1), ');') end func doRectangle(data) blk.println(this.codename, ' = ', d("rect"), ';') end func Empty return('Rectangle.Empty') end func doCeiling(data) if(linked("onCeiling")) event("onCeiling", 'Rectangle.Ceiling(' + d("value") + ')') else blk.println('Rectangle.Ceiling(', d("value"), ');') end end func doContains(data) if(linked("onContains")) event("onContains", this.codename + '.Contains(' + d("pt") + ')') else blk.println(this.codename, '.Contains(', d("pt"), ');') end end func doContains2(data) if(linked("onContains")) event("onContains", this.codename + '.Contains(' + d("rect") + ')') else blk.println(this.codename, '.Contains(', d("rect"), ');') end end func doContains3(data) if(linked("onContains")) event("onContains", this.codename + '.Contains(' + d("x") + ', ' + d("y") + ')') else blk.println(this.codename, '.Contains(', d("x"), ', ', d("y"), ');') end end func doEquals(data) if(linked("onEquals")) event("onEquals", this.codename + '.Equals(' + d("obj") + ')') else blk.println(this.codename, '.Equals(', d("obj"), ');') end end func doFromLTRB(data) if(linked("onFromLTRB")) event("onFromLTRB", 'Rectangle.FromLTRB(' + d("left") + ', ' + d("top") + ', ' + d("right") + ', ' + d("bottom") + ')') else blk.println('Rectangle.FromLTRB(', d("left"), ', ', d("top"), ', ', d("right"), ', ', d("bottom"), ');') end end func doInflate(data) blk.println(this.codename, '.Inflate(', d("size"), ');') end func doInflate2(data) blk.println(this.codename, '.Inflate(', d("width"), ', ', d("height"), ');') end func doInflate3(data) if(linked("onInflate")) event("onInflate", 'Rectangle.Inflate(' + d("rect") + ', ' + d("x") + ', ' + d("y") + ')') else blk.println('Rectangle.Inflate(', d("rect"), ', ', d("x"), ', ', d("y"), ');') end end func doIntersect(data) blk.println(this.codename, '.Intersect(', d("rect"), ');') end func doIntersect2(data) if(linked("onIntersect")) event("onIntersect", 'Rectangle.Intersect(' + d("a") + ', ' + d("b") + ')') else blk.println('Rectangle.Intersect(', d("a"), ', ', d("b"), ');') end end func doIntersectsWith(data) if(linked("onIntersectsWith")) event("onIntersectsWith", this.codename + '.IntersectsWith(' + d("rect") + ')') else blk.println(this.codename, '.IntersectsWith(', d("rect"), ');') end end func doOffset(data) blk.println(this.codename, '.Offset(', d("pos"), ');') end func doOffset2(data) blk.println(this.codename, '.Offset(', d("x"), ', ', d("y"), ');') end func doRound(data) if(linked("onRound")) event("onRound", 'Rectangle.Round(' + d("value") + ')') else blk.println('Rectangle.Round(', d("value"), ');') end end func doTruncate(data) if(linked("onTruncate")) event("onTruncate", 'Rectangle.Truncate(' + d("value") + ')') else blk.println('Rectangle.Truncate(', d("value"), ');') end end func doUnion(data) if(linked("onUnion")) event("onUnion", 'Rectangle.Union(' + d("a") + ', ' + d("b") + ')') else blk.println('Rectangle.Union(', d("a"), ', ', d("b"), ');') end end