Exemplo n.º 1
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            root = new View();


            frontView = new TextLabel
            {
                Size            = new Size(300, 300),
                Text            = "Front View",
                Position        = new Position(150, 170),
                PointSize       = 11,
                BackgroundColor = new Color(1.0f, 0.0f, 0.0f, 1.0f),
            };
            frontView.TouchEvent += OnFrontTouchEvent;


            backView = new TextLabel
            {
                Size            = new Size(300, 300),
                Text            = "Back View",
                Position        = new Position(50, 70),
                PointSize       = 11,
                BackgroundColor = new Color(1.0f, 1.0f, 0.0f, 1.0f),
            };

            mGestureDetector     = new GestureDetectorManager(backView, new MyGestureListener());
            backView.TouchEvent += OnBackTouchEvent;

            backView.Add(frontView);

            root.Add(backView);
            window.Add(root);
        }
Exemplo n.º 2
0
        public void GestrueFeedTouchEvent()
        {
            tlog.Debug(tag, $"GestrueFeedTouchEvent START");
            object sender = new object();
            View   view   = new View();

            View.TouchEventArgs    e  = new View.TouchEventArgs();
            GestureDetectorManager a1 = new GestureDetectorManager(view, new GestureDetectorManager.GestureListener());

            a1.FeedTouchEvent(sender, e);

            a1.Dispose();
            tlog.Debug(tag, $"GestrueFeedTouchEvent END (OK)");
            Assert.Pass("GestrueFeedTouchEvent");
        }
Exemplo n.º 3
0
        public void GestureDetectorManagerConstructorWithNullView()
        {
            tlog.Debug(tag, $"GestureDetectorManagerConstructorWithNullView START");

            try
            {
                var testingTarget = new GestureDetectorManager(null, new GestureDetectorManager.GestureListener());
            }
            catch (ArgumentNullException e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"GestureDetectorManagerConstructorWithNullView END (OK)");
                Assert.Pass("Caught ArgumentNullException : Passed!");
            }
        }
Exemplo n.º 4
0
        public void GestureDetectorManagerConstructor()
        {
            tlog.Debug(tag, $"GestureDetectorManagerConstructor START");

            using (View view = new View())
            {
                var testingTarget = new GestureDetectorManager(view, new GestureDetectorManager.GestureListener());
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <GestureDetectorManager>(testingTarget, "should be an instance of testing target class!");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"GestureDetectorManagerConstructor END (OK)");
            Assert.Pass("GestureDetectorManagerConstructor");
        }
Exemplo n.º 5
0
        public void GestureDetectorManagerConstructor()
        {
            tlog.Debug(tag, $"GestureDetectorManagerConstructor START");
            View view = new View();

            GestureDetectorManager a1 = new GestureDetectorManager(view, new GestureDetectorManager.GestureListener());

            a1.Dispose();

            GestureDetectorManager b1 = new GestureDetectorManager(null, new GestureDetectorManager.GestureListener());
            GestureDetectorManager c1 = new GestureDetectorManager(view, null);

            view.Dispose();

            tlog.Debug(tag, $"GestureDetectorManagerConstructor END (OK)");
            Assert.Pass("GestureDetectorManagerConstructor");
        }