Beispiel #1
0
        void OutputDocComments(Austin.Linode.ApiMethod meth)
        {
            int    firstPeriodNdx = meth.Description.IndexOf(". ");
            string summary, remarks;

            if (firstPeriodNdx < 0)
            {
                summary = meth.Description.Trim();
                remarks = null;
            }
            else
            {
                summary = meth.Description.Substring(0, firstPeriodNdx + 1).Trim();
                remarks = meth.Description.Substring(firstPeriodNdx + 2).Trim();
            }

            this.Write("        /// <summary>\r\n        /// ");

            this.Write(this.ToStringHelper.ToStringWithCulture(summary));

            this.Write("\r\n        /// </summary>\r\n");


            if (remarks != null)
            {
                this.Write("        /// <remarks>\r\n        /// ");

                this.Write(this.ToStringHelper.ToStringWithCulture(remarks));

                this.Write("\r\n        /// </remarks>\r\n");
            }
            if (!string.IsNullOrEmpty(meth.Throws))
            {
                this.Write("        /// <exception cref=\"LinodeException\">possible errors: ");

                this.Write(this.ToStringHelper.ToStringWithCulture(meth.Throws));

                this.Write("</exception>\r\n");
            }
            foreach (var param in SortParams(meth.Parameters))
            {
                this.Write("        /// <param name=\"");

                this.Write(this.ToStringHelper.ToStringWithCulture(param.Key));

                this.Write("\">");

                this.Write(this.ToStringHelper.ToStringWithCulture(param.Value.Description));

                this.Write("</param>\r\n");
            }
        }
Beispiel #2
0
        void OutputParamters(Austin.Linode.ApiMethod meth)
        {
            int paramCount = meth.Parameters.Count();

            PushIndent(new string(' ', 12));
            foreach (var param in SortParams(meth.Parameters))
            {
                Write(ParamDec(param.Key, param.Value));
                if (--paramCount != 0)
                {
                    WriteLine(", ");
                }
            }
            PopIndent();
        }