Ejemplo n.º 1
0
        private void WriteExampleCode(string parameterString, IList <object> args, MethodInfo mi)
        {
            if (mi.GetParameters().Length > 0)
            {
                if ((mi.GetParameters())[0].ParameterType.IsEnum)
                {
                    parameterString = (mi.GetParameters())[0].ParameterType + "." + args[0];
                }
                else
                {
                    parameterString = (mi.GetParameters())[0].ParameterType + args[0].ToString();
                }
            }

            ProdTextTemplate template = new ProdTextTemplate(mi, _thisWindow.ParentWindowTitle, _selectedControl.Name, parameterString);
            TextGenerator    gen      = new TextGenerator();

            /* display code to invoke the methods */
            RtbCode.Enabled = true;
            RtbCode.Text    = gen.GenerateProd(template, OutputLanguage.CSharp);
            return;
        }