예제 #1
0
파일: Console.cs 프로젝트: jorolf/baumRPE
        private void log(LogEntry logEntry)
        {
            if (logEntry.Level < LogLevel.Important && logEntry.LoggerName != CONSOLE_LOG_TYPE)
            {
                return;
            }

            Color4 color;

            switch (logEntry.Message.Substring(0, 2))
            {
            default:
                color = Color4.White;
                break;

            case "\01":
                color = Color4.Green;
                break;

            case "\02":
                color = Color4.Yellow;
                break;

            case "\03":
                color = Color4.Red;
                break;
            }

            consoleLog.AddText(logEntry.Message.StartsWith("\0") ? logEntry.Message.Substring(2) : logEntry.Message, spriteText => spriteText.Colour = color);
            consoleLog.NewLine();
        }
        public TestCaseButton(Type test)
            : this()
        {
            TestType = test;
            text.AddText(test.Name.Replace("TestCase", ""));

            var description = test.GetCustomAttribute<DescriptionAttribute>()?.Description;
            if (description != null)
            {
                text.NewLine();
                text.AddText(description, t => t.TextSize = 15);
            }
        }
예제 #3
0
        public TestCaseButton(Type test)
        {
            Masking = true;

            TestType = test;

            CornerRadius     = 5;
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;

            AddRange(new Drawable[]
            {
                box = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = new Color4(140, 140, 140, 255),
                    Alpha            = 0.7f
                },
                text = new TextFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding
                    {
                        Left   = 4,
                        Right  = 4,
                        Bottom = 2,
                    },
                }
            });

            text.AddText(test.Name.Replace("TestCase", ""));

            var description = test.GetCustomAttribute <DescriptionAttribute>()?.Description;

            if (description != null)
            {
                text.NewLine();
                text.AddText(description, t => t.TextSize = 15);
            }
        }