コード例 #1
0
        //this is hideous but wanted to show an idea.
        public HtmlTag BuildLabel(BehaviorNode behaviorNode)
        {
            // TODO -- come back and policize this

            var span = new HtmlTag("span").AddClass("label");
            var pp = behaviorNode.GetType().PrettyPrint();
            span.Text("behavior");

            if (pp.StartsWith("WebForm"))
            {
                span.Text("View");
                span.AddClass("notice");
            }
            else if (pp.StartsWith("Call"))
            {
                span.AddClass("warning");
                span.Text("continuation");
            }
            else if (!behaviorNode.GetType().Name.StartsWith("Fubu"))
            {
                span.Text("fubu");
            }

            return span;
        }