Beispiel #1
0
 public Interface(string modifier, string name, Method [] methods)
 {
     Modifier = modifier;
     JavaName = name;
     Name = name [0] == 'I' ? name : 'I' + name;
     Methods = methods ?? new Method [0];
 }
 string JoinArguments(Method m)
 {
     return m.Arguments != null ? String.Join (", ", (from a in m.Arguments select ToOutputTypeName (name_cache.ToCSharp (a.Type)) + " " + SafeCSharpName (a.Name)).ToArray ()) : null;
 }
 public void GenerateCode(Method method)
 {
     w.Write ("\t\t{0} {1} (", ToOutputTypeName (name_cache.ToCSharp (method.ReturnType)), method.Name);
     bool written = false;
     if (method.Arguments != null)
         foreach (var a in method.Arguments) {
             if (written)
                 w.Write (", ");
             else
                 written = true;
             w.Write ("{0} {1}", ToOutputTypeName (name_cache.ToCSharp (a.Type)), SafeCSharpName (a.Name));
         }
     w.WriteLine (");");
 }