示例#1
0
        public void SwitchOnControlStateChanged()
        {
            tlog.Debug(tag, $"SwitchOnControlStateChanged START");

            var testingTarget = new MySwitch();

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

            testingTarget.IsSelectable     = true;
            testingTarget.SelectedEvent   += OnSelectedEvent;
            testingTarget.SelectedChanged += OnSelectedChanged;

            try
            {
                ControlStateChangedEventArgs args = new ControlStateChangedEventArgs(ControlState.Selected, ControlState.Normal);
                testingTarget.MyOnControlStateChanged(args);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            testingTarget.SelectedEvent   -= OnSelectedEvent;
            testingTarget.SelectedChanged -= OnSelectedChanged;

            testingTarget.Dispose();
            tlog.Debug(tag, $"SwitchOnControlStateChanged END (OK)");
        }
 void ReleaseDesignerOutlets()
 {
     if (MySwitch != null)
     {
         MySwitch.Dispose();
         MySwitch = null;
     }
     if (SimpleCommandButton != null)
     {
         SimpleCommandButton.Dispose();
         SimpleCommandButton = null;
     }
     if (StaticParameterButton != null)
     {
         StaticParameterButton.Dispose();
         StaticParameterButton = null;
     }
 }
示例#3
0
        public void SwitchAccessibilityCalculateStates()
        {
            tlog.Debug(tag, $"SwitchAccessibilityCalculateStates START");

            var testingTarget = new MySwitch();

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

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

            testingTarget.Dispose();
            tlog.Debug(tag, $"SwitchAccessibilityCalculateStates END (OK)");
        }