Пример #1
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);
            }
        }
Пример #2
0
 public MethodGenerator AddParameter(ParameterGenerator parameter)
 {
     parameters.Add(parameter);
     return(this);
 }
Пример #3
0
 public InterfaceMethodGenerator AddParameter(ParameterGenerator generator)
 {
     parameters.Add(generator);
     return(this);
 }
Пример #4
0
 public DelegateGenerator AddParameter(ParameterGenerator generator)
 {
     parameters.Add(generator);
     return(this);
 }