예제 #1
0
        public void TabButtonOnKey()
        {
            tlog.Debug(tag, $"TabButtonOnKey START");

            var testingTarget = new MyTabButton();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <TabButton>(testingTarget, "Should return TabButton instance.");

            Key key    = null;
            var result = testingTarget.OnKey(key);

            Assert.AreEqual(false, result, "should be equal here!");

            key = new Key()
            {
                State          = Key.StateType.Up,
                KeyPressedName = "Return"
            };
            testingTarget.IsEnabled  = true;
            testingTarget.IsSelected = true;
            result = testingTarget.OnKey(key);
            tlog.Debug(tag, "OnKey : " + result);

            testingTarget.OnDispose(DisposeTypes.Explicit);
            tlog.Debug(tag, $"TabButtonOnKey END (OK)");
        }
예제 #2
0
        public void TabButtonHandleControlStateOnTouch()
        {
            tlog.Debug(tag, $"TabButtonHandleControlStateOnTouch START");

            var testingTarget = new MyTabButton()
            {
                IsEnabled = true,
            };

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <TabButton>(testingTarget, "Should return TabButton instance.");

            try
            {
                using (Touch touch = new Touch())
                {
                    testingTarget.OnHandleControlStateOnTouch(touch);
                }
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"TabButtonHandleControlStateOnTouch END (OK)");
        }
예제 #3
0
        public async Task TabButtonOnRelayoutWithText()
        {
            tlog.Debug(tag, $"TabButtonOnRelayoutWithText START");

            TabButtonStyle style = new TabButtonStyle()
            {
                Size            = new Size(100, 200),
                BackgroundColor = Color.Cyan,
                Text            = new TextLabelStyle()
                {
                    BackgroundColor = Color.Red,
                }
            };

            var testingTarget = new MyTabButton();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <TabButton>(testingTarget, "Should return TabButton instance.");


            testingTarget.IconURL = image_path;
            NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);

            testingTarget.Size            = new Size(50, 80);
            testingTarget.BackgroundColor = Color.Blue;

            await Task.Delay(200);

            NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);

            testingTarget.Dispose();
            tlog.Debug(tag, $"TabButtonOnRelayoutWithText END (OK)");
        }
예제 #4
0
        /// <summary>
        /// 子菜单点击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChildClick(object sender, EventArgs e)
        {
            var button = sender as MenuButton;

            if (_SelectedChild != null && _SelectedChild._MenuInfo.Equals(button._MenuInfo.id) && tabBody._Items.Count > 0)
            {
                return;
            }

            _SelectedChild = button;

            var tabButton = new MyTabButton();

            tabButton._ContentFormName = button._MenuInfo.url;
            tabButton._Text            = button._MenuInfo.menuTitle;
            tabBody._AddItem(tabButton);
            tabBody._SelectTab(ControllerUIAssembly, button._MenuInfo.url);
        }
예제 #5
0
        public void TabButtonCreateViewStyle()
        {
            tlog.Debug(tag, $"TabButtonCreateViewStyle START");

            var testingTarget = new MyTabButton();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <TabButton>(testingTarget, "Should return TabButton instance.");

            try
            {
                testingTarget.OnCreateViewStyle();
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"TabButtonCreateViewStyle END (OK)");
        }