예제 #1
0
        void ExplainEnum(WebData data, Type t)
        {
            var html = new HtmlPageBuilder(data.Request);

            html.Breadcrump.Add(new WebLink()
            {
                Text = t.FullName
            });
            Bootstrap4 content = html.Content;

            content.CardOpenText($"Enum {t.Name}");
            DocumentHtml(content, documentation.GetEnum(t), t.ToString());
            content.ListGroupOpen();
            int i = 0;

            foreach (object value in Enum.GetValues(t))
            {
                XNetDocItem doc = documentation.GetField(t, value.ToString());
                FieldHtml(content, i++, value, doc);
            }
            content.ListGroupClose();
            content.CardClose();
            content.AddHtml(" ");
            var message = WebMessage.Create("Explain " + t.Name, string.Format("Explain enum {0}", t.Name));

            data.Answer = html.ToAnswer(message);
        }