Esempio n. 1
0
        public void DecoratorTest()
        {
            var decors = new ElementDecorators();

            Assert.IsInstanceOf <ElementDecorators>(decors);
            Assert.IsNull(decors.LeftDecorator);
            decors.LeftDecorator = '{';
            Assert.That(decors.LeftDecorator.GetType() == new char?('c').GetType());
        }
Esempio n. 2
0
        public void CreateUI()
        {
            firstNameField       = manager.CreateInputField("FirstName", new CursorPosition(2, 2), 10, InputType.StringNoNumbersNoSpecialCharacters, false);
            ageField             = manager.CreateInputField("Age", new CursorPosition(20, 2), 3, InputType.Integer, false);
            firstNameField.Label = "First name";
            ageField.Label       = "Age";

            ElementDecorators decors = new ElementDecorators(null, null, '[', ']');

            manager.AddDecors(decors, firstNameField, ageField);
            ButtonField sendButton = manager.CreateButtonField("sendButton", new CursorPosition(13, 5), "Send");

            manager.CreateNavigationStateTransition(firstNameField, ConsoleKey.RightArrow, ageField, true);
            manager.CreateNavigationStateTransition(firstNameField, ConsoleKey.DownArrow, sendButton, true);
            manager.CreateNavigationStateTransition(ageField, ConsoleKey.DownArrow, sendButton, false);

            manager.CreateActionStateTransition(sendButton, ConsoleKey.Enter, SendMessage);

            manager.SetCursorToUIElement(firstNameField);
            manager.Init();
        }