예제 #1
0
        public RenderableComposer Color(ConsoleColor color, Action <RenderableComposer> action)
        {
            var content = new RenderableComposer();

            action(content);
            Root.Append(new ColorElement(color, content.Root));
            return(this);
        }
예제 #2
0
        public RenderableComposer Condition(bool condition,
                                            Action <RenderableComposer> @true,
                                            Action <RenderableComposer> @false)
        {
            if (condition)
            {
                var block = new RenderableComposer();
                @true(block);
                Root.Append(block.Root);
            }
            else
            {
                var block = new RenderableComposer();
                @false(block);
                Root.Append(block.Root);
            }

            return(this);
        }