Example #1
0
 private void AddParameters(MethodGenerator method, Method nest)
 {
     foreach (KeyValuePair <string, Type> pair in nest.macro.entry.parameters)
     {
         method.AddParameter(ParameterGenerator.Parameter(pair.Key, pair.Value, ParameterModifier.None));
     }
 }
Example #2
0
 private void AddParameters(MethodGenerator generator, Method method)
 {
     if (method.entry.declaration.parameters != null)
     {
         foreach (ParameterDeclaration declaration in method.entry.declaration.parameters)
         {
             generator.AddParameter(ParameterGenerator.Parameter(declaration.name, declaration.type, ParameterModifier.None));
         }
     }
 }
Example #3
0
        private string GetParameters(MethodGenerator generator, Method method)
        {
            var parameters = new List <ParameterGenerator>();

            foreach (ParameterDeclaration declaration in method.entry.declaration.parameters)
            {
                parameters.Add(ParameterGenerator.Parameter(declaration.name, declaration.type, ParameterModifier.None));
            }

            return(parameters.Count == 0 ? string.Empty : parameters.Parameters());
        }
Example #4
0
        private string GetParameters(MethodGenerator method, Method nest)
        {
            var parameters = new List <ParameterGenerator>();

            foreach (KeyValuePair <string, Type> pair in nest.macro.entry.parameters)
            {
                parameters.Add(ParameterGenerator.Parameter(pair.Key, pair.Value, ParameterModifier.None));
            }

            return(parameters.Count == 0 ? string.Empty : parameters.Parameters());
        }
Example #5
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);
            }
        }