Beispiel #1
0
        static void ExportMethod(StreamWriter writer, ClassMethod method, FileFormatter exporter)
        {
            exporter.Title3(writer, method.ReturnType + " " + method.Name + "(" + method.Arguments + ")");

            exporter.OpenList(writer);
            if (method.MethodSummary != null)
            {
                exporter.ListItem(writer, exporter.InlineBold("Summary"));
                exporter.PlainText(writer, method.MethodSummary);
            }
            //export inputs and their descriptions
            if (method.ArgumentDescriptions.Keys.Count > 0)
            {
                exporter.ListItem(writer, exporter.InlineBold("Parameters"));
                exporter.OpenList(writer);
                foreach (string argument in method.ArgumentDescriptions.Keys)
                {
                    exporter.Tab(writer, exporter.InlineListItem(
                                     exporter.InlineItalic(argument) + ": " + method.ArgumentDescriptions[argument]));
                }
                exporter.CloseList(writer);
            }
            //export output
            if (method.ReturnValueDescription != null)
            {
                exporter.ListItem(writer, exporter.InlineBold("Return Value"));
                exporter.PlainText(writer, method.ReturnValueDescription);
            }
            exporter.CloseList(writer);
        }
 public void AddMethod(ClassMethod method)
 {
     if (method.Type == ClassMethod.MethodType.Regular)
     {
         Methods.Add(method);
     }
     else if (method.Type == ClassMethod.MethodType.Constructor)
     {
         Constructors.Add(method);
     }
     else
     {
         Destructors.Add(method);
     }
 }