示例#1
0
        public void AddPlottableApiTable(XmlDoc xd)
        {
            AddGroupHeader("Plottable Types");
            AddHTML("This table lists the types of plottable objects that can be added to a plot. " +
            "Many of these plottable types have helper methods to easily create, customize, and add them to the plot. " +
            "Public methods, properties, and fields of plottables can be used to customize their behavior and styling.");

            AddHTML("<table>");
            AddTableRow(new string[] { "Method", "Summary" }, true);

            foreach (Type plottableType in Locate.GetPlottableTypes())
            {
                string summary = xd.GetSummary(plottableType);
                string name = Locate.TypeName(plottableType);
                string url = Locate.TypeName(plottableType, urlSafe: true);
                string html = $"<a href='api-plottable-{url}.html'><strong>{name}</strong></a>";
                AddTableRow(new string[] { html, summary });
            }

            AddHTML("</table>");
        }
示例#2
0
        private void AddPlotApiSummary()
        {
            string    xmlPath = "../../../../../src/ScottPlot/ScottPlot.xml";
            XDocument xmlDoc  = XDocument.Load(xmlPath);

            AddHeading("The Plot Module", 1);
            Add("The Plot module is the primary way to interct with ScottPlot. " +
                "It has helper methods to make it easy to create and add Plottable objects. " +
                "Use the Render() method to render the plot as an image.");

            //AddHeading("Fields", 3);
            //foreach (var field in Locate.GetPlotFields().Select(x => new DocumentedField(x, xmlDoc)))
            //Add(OneLineInfo(field, "plot/"));

            AddHeading("Properties", 2);
            foreach (var property in Locate.GetPlotProperties().Select(x => new DocumentedProperty(x, xmlDoc)))
            {
                Add(OneLineInfo(property, "api/plot/"));
            }

            AddHeading("Methods", 2);
            foreach (var method in Locate.GetPlotMethodsNoAdd().Select(x => new DocumentedMethod(x, xmlDoc)))
            {
                Add(OneLineInfo(method, "api/plot/"));
            }

            AddHeading("Methods for Creating Plottables", 2);
            foreach (var method in Locate.GetPlotMethodsOnlyAdd().Select(x => new DocumentedMethod(x, xmlDoc)))
            {
                Add(OneLineInfo(method, "api/plot/"));
            }

            AddHeading("Plottable Types", 1);
            foreach (Type plottableType in Locate.GetPlottableTypes())
            {
                var classInfo = new DocumentedClass(plottableType, xmlDoc);
                Add(OneLineInfo(classInfo, $"api/plottable/{Sanitize(plottableType.Name)}/"));
            }
        }