Example #1
0
        public static void WriteWebMethodForm(StringAction Write, InternalWebMethodInfo WebMethod)
        {
            Write("<form target='_blank' action='" + WebMethod.ToQueryString() + "' method='POST'>");
            WriteWebMethod(Write, WebMethod,
                           Parameter =>
            {
                if (Parameter == null)
                {
                    Write("<input type='submit' value='Invoke'  />");

                    return;
                }

                var key = "_" + WebMethod.MetadataToken + "_" + Parameter.Name;

                // C# named parameters style
                Write(": ");

                var value = "";

                Parameter.Value.With(x => value = x.Replace("'", "&apos;"));


                Write("<input type='text'  name='" + key + "' value='" + value + "' />");
            }
                           );
            Write("</form>");
        }
Example #2
0
        public static void WriteWebMethod(StringAction Write, InternalWebMethodInfo item, InternalWebMethodParameterInfoAction more)
        {
            Write("<br /> ");

            if (string.IsNullOrEmpty(item.MetadataToken))
            {
                // when does this happen?

                Write("<img src='http://i.msdn.microsoft.com/yxcx7skw.pubdelegate(en-us,VS.90).gif' />");
                Write(" <code>" + item.MethodName + "</code>");
            }
            else
            {
                Write("<img src='http://i.msdn.microsoft.com/deshae98.pubmethod(en-us,VS.90).gif' /> <code><a style='text-decoration: none;' href='" + item.ToQueryString() + "'>" + item.MethodName + "</a></code>");
            }

            if (more != null)
            {
                more(null);
            }

            if (item.Parameters != null)
            {
                foreach (var p in item.Parameters)
                {
                    Write("<br /> &nbsp;&nbsp;&nbsp;&nbsp;");

                    if (p.IsDelegate)
                    {
                        Write("<img src='http://i.msdn.microsoft.com/yxcx7skw.pubdelegate(en-us,VS.90).gif' />");
                        Write(" <code>" + p.Name + "</code>");
                    }
                    else
                    {
                        Write("<img src='http://i.msdn.microsoft.com/yxcx7skw.pubclass(en-us,VS.90).gif' />");
                        Write(" <code>" + p.Name + "</code>");

                        if (more != null)
                        {
                            more(p);
                        }
                    }
                }
            }
        }
        public static void WriteWebMethod(StringAction Write, InternalWebMethodInfo item, InternalWebMethodParameterInfoAction more)
        {
            Write("<br /> ");

            if (string.IsNullOrEmpty(item.MetadataToken))
            {
                // when does this happen?

                Write("<img src='http://i.msdn.microsoft.com/yxcx7skw.pubdelegate(en-us,VS.90).gif' />");
                Write(" <code>" + item.MethodName + "</code>");

            }
            else
            {
                Write("<img src='http://i.msdn.microsoft.com/deshae98.pubmethod(en-us,VS.90).gif' /> <code><a style='text-decoration: none;' href='" + item.ToQueryString() + "'>" + item.MethodName + "</a></code>");
            }

            if (more != null)
                more(null);

            if (item.Parameters != null)
                foreach (var p in item.Parameters)
                {
                    Write("<br /> &nbsp;&nbsp;&nbsp;&nbsp;");

                    if (p.IsDelegate)
                    {
                        Write("<img src='http://i.msdn.microsoft.com/yxcx7skw.pubdelegate(en-us,VS.90).gif' />");
                        Write(" <code>" + p.Name + "</code>");


                    }
                    else
                    {
                        Write("<img src='http://i.msdn.microsoft.com/yxcx7skw.pubclass(en-us,VS.90).gif' />");
                        Write(" <code>" + p.Name + "</code>");

                        if (more != null)
                            more(p);

                    }

                }


        }
        public static void WriteWebMethodForm(StringAction Write, InternalWebMethodInfo WebMethod)
        {
            Write("<form target='_blank' action='" + WebMethod.ToQueryString() + "' method='POST'>");
            WriteWebMethod(Write, WebMethod,
                Parameter =>
                {
                    if (Parameter == null)
                    {
                        Write("<input type='submit' value='Invoke'  />");

                        return;
                    }

                    var key = "_" + WebMethod.MetadataToken + "_" + Parameter.Name;

                    // C# named parameters style
                    Write(": ");

                    var value = "";

                    Parameter.Value.With(x => value = x.Replace("'", "&apos;"));


                    Write("<input type='text'  name='" + key + "' value='" + value + "' />");
                }
            );
            Write("</form>");
        }