Example #1
0
        // This replaces any `Java.Lang.ICharSequence` parameters with `string`.
        public static void AddMethodParametersStringOverloads(this MethodWriter method, ParameterList parameters, CodeGenerationOptions opt)
        {
            foreach (var p in parameters)
            {
                var para = new MethodParameterWriter(opt.GetSafeIdentifier(p.Name), new TypeReferenceWriter(opt.GetTypeReferenceName(p).Replace("Java.Lang.ICharSequence", "string").Replace("global::string", "string")));

                if (p.IsEnumified)
                {
                    para.Attributes.Add(new GeneratedEnumAttr());
                }
                if (p.Annotation != null)
                {
                    para.Attributes.Add(new CustomAttr(p.Annotation));
                }

                method.Parameters.Add(para);
            }
        }
Example #2
0
        public static void AddMethodParameters(this ITakeParameters method, ParameterList parameters, CodeGenerationOptions opt)
        {
            foreach (var p in parameters)
            {
                var para = new MethodParameterWriter(opt.GetSafeIdentifier(p.Name), new TypeReferenceWriter(opt.GetTypeReferenceName(p)));

                if (p.IsEnumified)
                {
                    para.Attributes.Add(new GeneratedEnumAttr());
                }
                if (p.Annotation != null)
                {
                    para.Attributes.Add(new CustomAttr(p.Annotation));
                }

                method.Parameters.Add(para);
            }
        }