Exemplo n.º 1
0
        private bool Timer_Tick(object source, Timer.TickEventArgs e)
        {
            Tizen.Log.Fatal(TAG, $"#3 imageView.LoadingStatus={imageView?.LoadingStatus}");
            Tizen.Log.Fatal(TAG, $"###3 imageView2.LoadingStatus={imageView2?.LoadingStatus}");
            Tizen.Log.Fatal(TAG, $"Timer_Tick() comes!");

            if (cnt++ % 2 == 0)
            {
                map.Clear();
                customShader.Clear();
                map.Add("shader", new PropertyValue(customShader));
                imageView.Image = map;
            }
            else
            {
                map.Clear();
                customShader.Clear();
                customShader.Add("vertexShader", new PropertyValue(vertexShaderSource));
                customShader.Add("fragmentShader", new PropertyValue(fragmentShaderSource));
                map.Add("shader", new PropertyValue(customShader));
                imageView.Image = map;
            }

            Tizen.Log.Fatal(TAG, $"#4 imageView.LoadingStatus={imageView.LoadingStatus}");

            if (cnt % 3 == 0)
            {
                window.SetTransparency(false);
                Random rand  = new Random();
                float  value = rand.Next(0, 255) / 255.0f;
                window.BackgroundColor = new Color(value, value, 1 - value, 1.0f);
            }
            else
            {
                window.SetTransparency(true);
                window.BackgroundColor = new Color(0, 0, 0, 0);
            }

            string url1 = resourcePath + "/images/image-" + (cnt % 3 + 1) + ".jpg";

            Tizen.Log.Fatal(TAG, $"url1={url1}");
            imageView2?.Dispose();
            imageView2 = null;
            imageView2 = new ImageView(url1);
            imageView2.PositionUsesPivotPoint = true;
            imageView2.PivotPoint             = PivotPoint.BottomCenter;
            imageView2.ParentOrigin           = ParentOrigin.BottomCenter;
            imageView2.Size2D = new Size2D(300, 300);
            Tizen.Log.Fatal(TAG, $"###4 imageView2.LoadingStatus={imageView2.LoadingStatus}");
            window.Add(imageView2);

            Tizen.Log.Fatal(TAG, $"#5 imageView.LoadingStatus={imageView.LoadingStatus}");
            Tizen.Log.Fatal(TAG, $"###5 imageView2.LoadingStatus={imageView2.LoadingStatus}");
            return(true);
        }
Exemplo n.º 2
0
        public void PropertyMapClear()
        {
            tlog.Debug(tag, $"PropertyMapClear START");

            var testingTarget = new PropertyMap();
            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");

            var dummy = new PropertyValue(5);
            Assert.IsNotNull(dummy, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy, "should be an instance of PropertyValue class!");

            testingTarget.Add(100, dummy);
            testingTarget.Clear();
            Assert.AreEqual(0, testingTarget.Count(), "Retrive testingTarget.Count() should equal to 0.");

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