コード例 #1
0
        public static InterfaceMethodGenerator Method(string name, Type returnType)
        {
            var method = new InterfaceMethodGenerator();

            method.name       = name;
            method.returnType = returnType;
            return(method);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public InterfaceGenerator AddMethod(InterfaceMethodGenerator generator)
 {
     methods.Add(generator);
     return(this);
 }