func init // adds using namespace sys.add_use('System') // initialize instance sys.add_var(this.name, 'IConvertible') end func GetTypeCode blk.println(this.codename, ' = ', d('Interface'), ';') return(this.codename + '.GetTypeCode()') end func doToBoolean(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToBoolean")) event("onToBoolean", this.codename + '.ToBoolean(' + d("provider") + ')') else blk.println(this.codename, '.ToBoolean(', d("provider"), ');') end end func doToByte(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToByte")) event("onToByte", this.codename + '.ToByte(' + d("provider") + ')') else blk.println(this.codename, '.ToByte(', d("provider"), ');') end end func doToChar(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToChar")) event("onToChar", this.codename + '.ToChar(' + d("provider") + ')') else blk.println(this.codename, '.ToChar(', d("provider"), ');') end end func doToDateTime(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToDateTime")) event("onToDateTime", this.codename + '.ToDateTime(' + d("provider") + ')') else blk.println(this.codename, '.ToDateTime(', d("provider"), ');') end end func doToDecimal(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToDecimal")) event("onToDecimal", this.codename + '.ToDecimal(' + d("provider") + ')') else blk.println(this.codename, '.ToDecimal(', d("provider"), ');') end end func doToDouble(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToDouble")) event("onToDouble", this.codename + '.ToDouble(' + d("provider") + ')') else blk.println(this.codename, '.ToDouble(', d("provider"), ');') end end func doToInt16(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToInt16")) event("onToInt16", this.codename + '.ToInt16(' + d("provider") + ')') else blk.println(this.codename, '.ToInt16(', d("provider"), ');') end end func doToInt32(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToInt32")) event("onToInt32", this.codename + '.ToInt32(' + d("provider") + ')') else blk.println(this.codename, '.ToInt32(', d("provider"), ');') end end func doToInt64(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToInt64")) event("onToInt64", this.codename + '.ToInt64(' + d("provider") + ')') else blk.println(this.codename, '.ToInt64(', d("provider"), ');') end end func doToSByte(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToSByte")) event("onToSByte", this.codename + '.ToSByte(' + d("provider") + ')') else blk.println(this.codename, '.ToSByte(', d("provider"), ');') end end func doToSingle(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToSingle")) event("onToSingle", this.codename + '.ToSingle(' + d("provider") + ')') else blk.println(this.codename, '.ToSingle(', d("provider"), ');') end end func doToString(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToString")) event("onToString", this.codename + '.ToString(' + d("provider") + ')') else blk.println(this.codename, '.ToString(', d("provider"), ');') end end func doToType(conversionType, provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToType")) event("onToType", this.codename + '.ToType(' + d("conversionType") + ', ' + d("provider") + ')') else blk.println(this.codename, '.ToType(', d("conversionType"), ', ', d("provider"), ');') end end func doToUInt16(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToUInt16")) event("onToUInt16", this.codename + '.ToUInt16(' + d("provider") + ')') else blk.println(this.codename, '.ToUInt16(', d("provider"), ');') end end func doToUInt32(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToUInt32")) event("onToUInt32", this.codename + '.ToUInt32(' + d("provider") + ')') else blk.println(this.codename, '.ToUInt32(', d("provider"), ');') end end func doToUInt64(provider) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onToUInt64")) event("onToUInt64", this.codename + '.ToUInt64(' + d("provider") + ')') else blk.println(this.codename, '.ToUInt64(', d("provider"), ');') end end