Trail:

Changeset 86

Show
Ignore:
Timestamp:
2009-11-24 13:33:10 (2 years ago)
Author:
harald
Message:
  • add default logback config
  • add #region output to c# templates to suppress code validation
  • fix a proxy generation bug where nested generic types were not resolved
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build.xml

    r74 r86  
    3030                        <classpath refid="compile.classpath"/> 
    3131                </javac> 
     32 
     33                <copy todir="${output.dir}"> 
     34                        <fileset dir="${basedir}/src"> 
     35                                <include name="**/*.xml"/> 
     36                        </fileset> 
     37                        <fileset dir="${basedir}"> 
     38                                <include name="templates/**"/> 
     39                        </fileset> 
     40                </copy> 
     41 
    3242        </target> 
    3343 
     
    4959                        </manifest> 
    5060                        <fileset dir="${output.dir}"> 
     61                                <exclude name="**/logback-test.xml"/> 
     62 
    5163                                <include name="org/fluffnstuff/**"/> 
    52                         </fileset> 
    53                         <fileset dir="${basedir}"> 
    5464                                <include name="templates/**"/> 
    5565                        </fileset> 
  • trunk/src/org/fluffnstuff/asdoclet

    • Property svn:ignore set to
      logback-test.xml
  • trunk/src/org/fluffnstuff/asdoclet/AsDoclet.java

    r79 r86  
    22 
    33import java.lang.annotation.Annotation; 
     4import java.net.URL; 
    45import java.util.Arrays; 
    56 
     
    1415import org.fluffnstuff.asdoclet.map.ClassTypeMap; 
    1516import org.fluffnstuff.asdoclet.map.TypeMap; 
     17import org.slf4j.Logger; 
     18import org.slf4j.LoggerFactory; 
    1619 
     20import ch.qos.logback.classic.LoggerContext; 
     21import ch.qos.logback.classic.joran.JoranConfigurator; 
     22import ch.qos.logback.core.util.StatusPrinter; 
    1723import com.sun.javadoc.ClassDoc; 
    1824import com.sun.javadoc.DocErrorReporter; 
     
    3036        private static final String PARAM_ANNOTATION_TYPE_MAP = "-annotationmap"; 
    3137 
     38        private static final Logger logger = LoggerFactory.getLogger(AsDoclet.class); 
     39 
     40        static { 
     41                try { 
     42                        URL config = AsDoclet.class.getResource("logback-test.xml"); 
     43                        if (config == null) config = AsDoclet.class.getResource("logback.xml"); 
     44 
     45                        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); 
     46                        lc.reset(); 
     47 
     48                        JoranConfigurator configurator = new JoranConfigurator(); 
     49                        configurator.setContext(lc); 
     50                        configurator.doConfigure(config); 
     51 
     52                        StatusPrinter.printInCaseOfErrorsOrWarnings(lc); 
     53                } catch (Exception e) { 
     54                        e.printStackTrace(); 
     55                } 
     56        } 
     57 
    3258        public static boolean start(RootDoc root) throws Exception { 
    3359                Generator generator = readOptions(root.options()); 
     
    3763 
    3864                for (ClassDoc classDoc : docs) { 
    39                         System.out.println("Processing " + classDoc.qualifiedName()); 
     65                        logger.info("Processing {}", classDoc.qualifiedName()); 
     66 
    4067                        if (TagParser.hasClassTags(generator, classDoc)) { 
    4168                                Handler handler = createHandler(generator, classDoc); 
  • trunk/src/org/fluffnstuff/asdoclet/generator/AsGenerator.java

    r82 r86  
    1212import org.fluffnstuff.asdoclet.handler.Constants; 
    1313import org.fluffnstuff.asdoclet.map.TypeMap; 
    14  
     14import org.slf4j.Logger; 
     15import org.slf4j.LoggerFactory; 
     16 
     17import com.sun.javadoc.ClassDoc; 
    1518import uk.co.badgersinfoil.metaas.ActionScriptFactory; 
    1619import uk.co.badgersinfoil.metaas.ActionScriptProject; 
     
    2326import uk.co.badgersinfoil.metaas.dom.ASType; 
    2427import uk.co.badgersinfoil.metaas.dom.Visibility; 
    25 import com.sun.javadoc.ClassDoc; 
    2628 
    2729public class AsGenerator implements Generator { 
    2830        private static ActionScriptFactory factory = new ActionScriptFactory(); 
     31 
     32        private final Logger logger = LoggerFactory.getLogger(AsGenerator.class); 
    2933 
    3034        private ActionScriptProject project; 
     
    171175        @Override 
    172176        public void beginClass(Type classType) { 
    173                 System.out.println("Creating ActionScript class " + classType); 
     177                logger.info("Creating ActionScript class {}", classType); 
    174178 
    175179                newClass(classType, false); 
     
    179183        @Override 
    180184        public void beginEnum(Type name) { 
    181                 System.out.println("Creating ActionScript enumeration " + name); 
     185                logger.info("Creating ActionScript enumeration {}", name); 
    182186 
    183187                newClass(name, true); 
     
    201205        @Override 
    202206        public void beginInterface(Type name) { 
    203                 System.out.println("Creating ActionScript interface " + name); 
     207                logger.info("Creating ActionScript interface {}", name); 
    204208 
    205209                unit = project.newInterface(name.getName()); 
     
    240244        @Override 
    241245        public void beginProxy(Type proxy, Type baseType, Type interfaceType) { 
    242                 System.out.println("Creating ActionScript proxy " + proxy.getName()); 
     246                logger.info("Creating ActionScript proxy {}", proxy.getName()); 
    243247 
    244248                ASCompilationUnit eventUnit = project.newClass(proxy.getName() + "Events"); 
     
    358362 
    359363        @Override 
    360         public boolean isDebug() { 
    361                 return false; 
    362         } 
    363  
    364         @Override 
    365364        public Type postProcessType(Type type) { 
    366365                if (type.getDimensions() > 0) return GeneratorUtils.getType(Collection.class.getCanonicalName(), this); 
  • trunk/src/org/fluffnstuff/asdoclet/generator/Generator.java

    r82 r86  
    6464        boolean hasEnumSupport(); 
    6565 
    66         boolean isDebug(); 
    67  
    6866        Type postProcessType(Type type); 
    6967 
  • trunk/src/org/fluffnstuff/asdoclet/generator/VelocityGenerator.java

    r82 r86  
    174174                } 
    175175                if (proxyMethodDescriptor != null) { 
    176                         if (type.getTypeMap().containsKey(type.getName())) type = type.getTypeMap().get(type.getName()); 
     176 
     177 
     178                        type = replaceType(type); 
     179 
     180 
    177181                        ParameterDescriptor parameterDescriptor = new ParameterDescriptor(type, name); 
    178182                        proxyMethodDescriptor.addParameterDescriptor(parameterDescriptor); 
    179183                } 
     184        } 
     185 
     186        private Type replaceType(Type type) { 
     187                if (type.getTypeMap().containsKey(type.getName())) return type.getTypeMap().get(type.getName()); 
     188 
     189                Collection<Type> arguments = new ArrayList<Type>(); 
     190                if (type.getArguments() != null) { 
     191                        for (Type argument : type.getArguments()) { 
     192                                argument.setTypeMap(type.getTypeMap()); 
     193                                arguments.add(replaceType(argument)); 
     194                        } 
     195                } 
     196 
     197                return new Type(type.getName(), arguments, type.getBounds(), type.getDimensions(), type.isGeneric()); 
    180198        } 
    181199 
     
    268286                if (callbackType != org.fluffnstuff.asdoclet.generator.Type.EMPTY) { 
    269287                        if (methodDescriptor != null) methodDescriptor.setCallbackType(callbackType); 
    270                         if (proxyMethodDescriptor != null) proxyMethodDescriptor.setCallbackType(callbackType); 
     288                        if (proxyMethodDescriptor != null) proxyMethodDescriptor.setCallbackType(replaceType(callbackType)); 
    271289                } 
    272290 
     
    320338        public boolean hasEnumSupport() { 
    321339                return true; 
    322         } 
    323  
    324         @Override 
    325         public boolean isDebug() { 
    326                 return false; 
    327340        } 
    328341 
  • trunk/src/org/fluffnstuff/asdoclet/generator/utils/GeneratorUtils.java

    r76 r86  
    22 
    33import java.lang.annotation.Annotation; 
    4 import java.text.MessageFormat; 
    54import java.util.ArrayList; 
    65import java.util.Arrays; 
     
    1211import org.fluffnstuff.asdoclet.generator.Generator; 
    1312import org.fluffnstuff.asdoclet.map.TypeMap; 
     13import org.slf4j.Logger; 
     14import org.slf4j.LoggerFactory; 
    1415 
    1516import com.sun.javadoc.AnnotationDesc; 
     
    2223 
    2324public final class GeneratorUtils { 
     25        private static final Logger logger = LoggerFactory.getLogger(GeneratorUtils.class); 
     26 
    2427        private static Map<String, org.fluffnstuff.asdoclet.generator.Type> enumerationTypes = new HashMap<String, org.fluffnstuff.asdoclet.generator.Type>(); 
    2528 
    2629        public static org.fluffnstuff.asdoclet.generator.Type getType(MethodDoc doc, Generator generator, Collection<String> ignore) { 
    27                 if (generator.isDebug()) System.out.println(MessageFormat.format("Generating type {0} <{1}>", doc.name(), doc.getClass().getCanonicalName())); 
     30                logger.debug("Generating type {} <{}>", doc.name(), doc.getClass().getCanonicalName()); 
    2831 
    2932                Map<String, org.fluffnstuff.asdoclet.generator.Type> bounds = new HashMap<String, org.fluffnstuff.asdoclet.generator.Type>(); 
    3033                Collection<org.fluffnstuff.asdoclet.generator.Type> arguments = new ArrayList<org.fluffnstuff.asdoclet.generator.Type>(); 
    3134 
    32                 if (generator.isDebug()) System.out.println(MessageFormat.format("Parameters {0}", Arrays.toString(doc.typeParameters()))); 
     35                logger.debug("Parameters {}", Arrays.toString(doc.typeParameters())); 
    3336                for (Type argument : doc.typeParameters()) { 
    3437                        processArgument(argument, generator, arguments, bounds, ignore, new HashSet<String>()); 
     
    4245 
    4346        private static void processArgument(Type argument, Generator generator, Collection<org.fluffnstuff.asdoclet.generator.Type> arguments, Map<String, org.fluffnstuff.asdoclet.generator.Type> bounds, Collection<String> ignore, Collection<String> visited) { 
    44                 if (generator.isDebug()) System.out.println(MessageFormat.format("Processing argument {0} <{1}>", argument.qualifiedTypeName(), argument.getClass().getCanonicalName())); 
     47                logger.debug("Processing argument {} <{}>", argument.qualifiedTypeName(), argument.getClass().getCanonicalName()); 
    4548 
    4649                org.fluffnstuff.asdoclet.generator.Type argumentType = getType(argument, generator, ignore, visited); 
     
    5255 
    5356        private static org.fluffnstuff.asdoclet.generator.Type getType(Type type, Generator generator, Collection<String> ignore, Collection<String> visited) { 
    54                 if (generator.isDebug()) System.out.println(MessageFormat.format("Generating type {0} <{1}>", type.qualifiedTypeName(), type.getClass().getCanonicalName())); 
     57                logger.debug("Generating type {} <{}>", type.qualifiedTypeName(), type.getClass().getCanonicalName()); 
    5558 
    5659                if (ignore.contains(type.qualifiedTypeName())) return org.fluffnstuff.asdoclet.generator.Type.NULL; 
     
    6770                if (type instanceof ParameterizedType) { 
    6871                        ParameterizedType parameterizedType = type.asParameterizedType(); 
    69                         if (generator.isDebug()) System.out.println(MessageFormat.format("Arguments {0}", Arrays.toString(parameterizedType.typeArguments()))); 
     72                        logger.debug("Arguments {}", Arrays.toString(parameterizedType.typeArguments())); 
    7073                        for (Type argument : parameterizedType.typeArguments()) { 
    7174                                processArgument(argument, generator, arguments, bounds, ignore, visited); 
     
    7376                } else if (type instanceof ClassDoc) { 
    7477                        ClassDoc classDoc = type.asClassDoc(); 
    75                         if (generator.isDebug()) System.out.println(MessageFormat.format("Parameters {0}", Arrays.toString(classDoc.typeParameters()))); 
     78                        logger.debug("Parameters {}", Arrays.toString(classDoc.typeParameters())); 
    7679                        for (Type argument : classDoc.typeParameters()) { 
    7780                                processArgument(argument, generator, arguments, bounds, ignore, visited); 
     
    142145 
    143146                                if (bound != org.fluffnstuff.asdoclet.generator.Type.NULL) { 
    144                                         if (generator.isDebug()) System.out.println(MessageFormat.format("Adding boundary {0} extends {1} <{2}>", argument.qualifiedTypeName(), boundType.qualifiedTypeName(), boundType.getClass().getCanonicalName())); 
     147                                        logger.debug("Adding boundary {} extends {} <{}>", new Object[]{argument.qualifiedTypeName(), boundType.qualifiedTypeName(), boundType.getClass().getCanonicalName()}); 
    145148                                        bounds.put(argument.qualifiedTypeName(), bound); 
    146149                                } 
  • trunk/src/org/fluffnstuff/asdoclet/handler/InterfaceHandler.java

    r82 r86  
    8989                } 
    9090 
     91                returnType.setTypeMap(typeMap); 
     92 
    9193                org.fluffnstuff.asdoclet.generator.Type actualReturnType = returnType; 
    9294 
     
    111113                                                asyncType = new org.fluffnstuff.asdoclet.generator.Type(callbackType, null, null, 0, false); 
    112114                                        } 
     115 
     116                                        asyncType.setTypeMap(typeMap); 
    113117                                } 
    114118 
  • trunk/templates/cs/class.vm

    r71 r86  
    55*# 
    66namespace $typeDescriptor.nameSpace { 
     7#region AsDoclet generated code 
    78#if($typeDescriptor.description)        /** 
    89         * <summary> 
     
    3839#end 
    3940        } 
     41#endregion 
    4042} 
  • trunk/templates/cs/enum.vm

    r71 r86  
    55*# 
    66namespace $typeDescriptor.nameSpace { 
     7#region AsDoclet generated code 
    78#if($typeDescriptor.description)        /** 
    89         * <summary> 
     
    1819 
    1920        } 
     21#endregion 
    2022} 
  • trunk/templates/cs/interface.vm

    r71 r86  
    55*# 
    66namespace $typeDescriptor.nameSpace { 
     7#region AsDoclet generated code 
    78#if($typeDescriptor.description)        /** 
    89         * <summary> 
     
    3233#end 
    3334        } 
     35#endregion 
    3436} 
  • trunk/templates/cs/proxy.vm

    r79 r86  
    55*# 
    66namespace $typeDescriptor.nameSpace { 
     7#region AsDoclet generated code 
    78#if($typeDescriptor.description)        /** 
    89         * <summary> 
     
    4142#end 
    4243        } 
     44#endregion 
    4345} 
  • trunk/test/TestAsdoclet.java

    r82 r86  
    33public class TestAsdoclet { 
    44        public static void main(String[] args) { 
    5                 Main.execute(new String[]{"-d", "test/results/cs", "-doclet", "org.fluffnstuff.asdoclet.AsDoclet", "-generator", "actionscript", "asdoclet.test", "test/asdoclet/test/TestProxyInterface.java"}); 
     5                Main.execute(new String[]{"-d", "test/results/cs", "-doclet", "org.fluffnstuff.asdoclet.AsDoclet", "-generator", "cs", "asdoclet.test", "test/asdoclet/test/TestProxyInterface.java"}); 
    66        } 
    77} 
  • trunk/test/asdoclet/test/TestProxyInterface.java

    r82 r86  
    55/** 
    66 * @actionscript.class proxy=<code>true</code> 
    7  * @cs.class proxy=<code>true</code> 
     7 * @cs.class proxy=<code>true</code> async=<code>true</code> async.callbacktype=AsyncCallback&lt;$type$&gt; 
    88 */ 
    99public interface TestProxyInterface extends TestProxyInterfaceBase<Date> { 
  • trunk/test/asdoclet/test/TestProxyInterfaceBase.java

    r82 r86  
    11package asdoclet.test; 
    22 
     3import java.util.Collection; 
    34import java.util.Date; 
    45 
     
    89 */ 
    910public interface TestProxyInterfaceBase<T extends Date> extends TestProxyInterfaceGeneric { 
    10         void foo(T bar); 
     11        Collection<T> foo(T bar); 
    1112} 
  • trunk/test/expectations/actionscript/asdoclet/test/TestProxyInterfaceBase.as

    r82 r86  
    66         */ 
    77        public interface TestProxyInterfaceBase extends  asdoclet.test.TestProxyInterfaceGeneric { 
    8                 override function foo(bar:Date):void
     8                override function foo(bar:Date):Array
    99        } 
    1010} 
  • trunk/test/expectations/actionscript/asdoclet/test/TestProxyInterfaceProxy.as

    r82 r86  
    1010                protected function onStatus(status:Object):void { 
    1111                } 
    12                 public function foo(bar:Date):void
    13                         dispatchCall(TestProxyInterfaceProxyEvents.Foo, bar)
     12                public function foo(bar:Date):Array
     13                        return dispatchCall(TestProxyInterfaceProxyEvents.Foo, bar) as Array
    1414                } 
    1515        } 
  • trunk/test/expectations/cs/asdoclet/test/TestClassAnnotations.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1819                public virtual string NotAnnotatedProperty { get { return this.notAnnotatedProperty; } set { this.notAnnotatedProperty = value; } } 
    1920        } 
     21#endregion 
    2022} 
  • trunk/test/expectations/cs/asdoclet/test/TestException.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1314                public  TestException(string message, System.Exception exception)  : base(message, exception) {} 
    1415        } 
     16#endregion 
    1517} 
  • trunk/test/expectations/cs/asdoclet/test/TestIgnoreClass.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                public virtual T Test { get { return this.test; } set { this.test = value; } } 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestIgnoreGeneric.cs

    r76 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1011        public class TestIgnoreGeneric : asdoclet.test.TestOverrideClass { 
    1112        } 
     13#endregion 
    1214} 
  • trunk/test/expectations/cs/asdoclet/test/TestIgnoreInClass.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                public virtual T Test { get { return this.test; } set { this.test = value; } } 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestIgnoreInClassBase.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1011        public class TestIgnoreInClassBase<T> { 
    1112        } 
     13#endregion 
    1214} 
  • trunk/test/expectations/cs/asdoclet/test/TestIgnoreInInterface.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                void TestMethod(); 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestIgnoreInInterfaceBase.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1011        public interface TestIgnoreInInterfaceBase<T> { 
    1112        } 
     13#endregion 
    1214} 
  • trunk/test/expectations/cs/asdoclet/test/TestIgnoreInterface.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                void TestMethod(); 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestInterfaceAnnotations.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1617                void NotAnnotatedMethod(); 
    1718        } 
     19#endregion 
    1820} 
  • trunk/test/expectations/cs/asdoclet/test/TestInterfaceGeneric.cs

    r81 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1112                void Foo(A bar, B baz); 
    1213        } 
     14#endregion 
    1315} 
  • trunk/test/expectations/cs/asdoclet/test/TestOverrideClass.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                public override T Test { get { return this.test; } set { this.test = value; } } 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestOverrideClassBase.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                public virtual T Test { get { return this.test; } set { this.test = value; } } 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestOverrideInterface.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                void TestMethod(); 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestOverrideInterfaceBase.cs

    r71 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1213                void TestMethod(); 
    1314        } 
     15#endregion 
    1416} 
  • trunk/test/expectations/cs/asdoclet/test/TestProxyInterface.cs

    r82 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1011        public interface TestProxyInterface : asdoclet.test.TestProxyInterfaceBase<java.sql.Date> { 
    1112        } 
     13#endregion 
    1214} 
  • trunk/test/expectations/cs/asdoclet/test/TestProxyInterfaceBase.cs

    r82 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    910         */ 
    1011        public interface TestProxyInterfaceBase<T> : asdoclet.test.TestProxyInterfaceGeneric where T : System.DateTime? { 
    11                 void Foo(T bar); 
     12                System.Collections.Generic.ICollection<T> Foo(T bar); 
    1213        } 
     14#endregion 
    1315} 
  • trunk/test/expectations/cs/asdoclet/test/TestProxyInterfaceGeneric.cs

    r79 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        /** 
    56         * <summary> 
     
    1112                void Foo(string bar); 
    1213        } 
     14#endregion 
    1315} 
  • trunk/test/expectations/cs/asdoclet/test/TestProxyInterfaceProxy.cs

    r82 r86  
    22 
    33namespace asdoclet.test { 
     4#region AsDoclet generated code 
    45        public class TestProxyInterfaceProxy : asdoclet.test.TestProxyInterface { 
    56        protected virtual T DispatchCall<T>(string methodName, params object[] args) { 
     
    1011        } 
    1112 
    12                 virtual public void Foo(java.sql.Date bar) { 
    13                         DispatchCall<object>("foo", bar); 
     13                virtual public void Foo(AsyncCallback<System.Collections.Generic.ICollection<java.sql.Date>> async, java.sql.Date bar) { 
     14                        BeginDispatchCall<System.Collections.Generic.ICollection<java.sql.Date>>("foo", async, bar); 
    1415                } 
    15                 virtual public void Foo(string bar) { 
    16                         DispatchCall<object>("foo", bar); 
     16                virtual public void Foo(AsyncCallback async, string bar) { 
     17                        BeginDispatchCall<object>("foo", async, bar); 
    1718                } 
    1819        } 
     20#endregion 
    1921}