public static InterfaceMethodGenerator Method(string name, Type returnType) { var method = new InterfaceMethodGenerator(); method.name = name; method.returnType = returnType; return(method); }
private void DefineCode() { for (int i = 0; i < decorated.properties.Count; i++) { var prop = decorated.properties[i]; @interface.AddProperty(InterfacePropertyGenerator.Property(prop.name, prop.type, prop.get, prop.set)); } for (int i = 0; i < decorated.methods.Count; i++) { var method = decorated.methods[i]; var methodGen = InterfaceMethodGenerator.Method(method.name, method.returnType); foreach (KeyValuePair <string, Type> pair in method.parameters) { methodGen.AddParameter(ParameterGenerator.Parameter(pair.Key, pair.Value.As().CSharpName(fullName: true), ParameterModifier.None)); } @interface.AddMethod(methodGen); } }
public InterfaceGenerator AddMethod(InterfaceMethodGenerator generator) { methods.Add(generator); return(this); }