Exemplo n.º 1
0
        public void WatchApplicationAmbientTickEventArgsWatchTimeSet()
        {
            tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeSet START");

            if (IsWearable())
            {
                var dummyWatchTime = new WatchTime();
                Assert.IsNotNull(dummyWatchTime, "should be not null");
                Assert.IsInstanceOf <WatchTime>(dummyWatchTime, "should be an instance of testing target class!");

                AmbientTickEventArgs testingTarget = new AmbientTickEventArgs();
                testingTarget.WatchTime = dummyWatchTime;

                var result = testingTarget.WatchTime;
                Assert.IsNotNull(result, "should be not null.");
                Assert.AreEqual(dummyWatchTime, result, "Retrieved result should be equal to dummyApplication. ");

                dummyWatchTime.Dispose();
                tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeSet END (OK)");
            }
            else
            {
                tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeSet END (OK)");
                Assert.Pass("Not Supported profile");
            }
        }
Exemplo n.º 2
0
        private void OnAmbientTick(IntPtr application, IntPtr watchTime)
        {
            AmbientTickEventArgs e = new AmbientTickEventArgs();

            e.Application = this;
            e.WatchTime   = WatchTime.GetWatchTimeFromPtr(watchTime);
            _ambientTickEventHandler?.Invoke(this, e);
        }
Exemplo n.º 3
0
        private void OnAmbientTick(IntPtr application, IntPtr watchTime)
        {
            AmbientTickEventArgs e = new AmbientTickEventArgs();

            using (e.Application = Application.GetApplicationFromPtr(application))
            {
                using (e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime))
                {
                    _ambientTickEventHandler?.Invoke(this, e);
                }
            }
        }
Exemplo n.º 4
0
        private void OnAmbientTick(IntPtr application, IntPtr watchTime)
        {
            AmbientTickEventArgs e = new AmbientTickEventArgs();

            if (application != null)
            {
                e.Application = Application.GetApplicationFromPtr(application);
            }
            if (watchTime != null)
            {
                e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime);
            }

            _ambientTickEventHandler?.Invoke(this, e);
        }
Exemplo n.º 5
0
        public void WatchApplicationAmbientTickEventArgsApplication()
        {
            tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplication START");

            var testingTarget = new AmbientTickEventArgs();

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

            Widget widget      = new Widget();
            var    application = new WidgetApplication(widget.GetIntPtr(), false);

            testingTarget.Application = application;
            Assert.IsNotNull(testingTarget.Application, "should be not null.");

            widget.Dispose();
            widget = null;
            tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplication END (OK)");
        }
Exemplo n.º 6
0
        public void WatchApplicationAmbientTickEventArgsWatchTimeGet()
        {
            tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeGet START");

            if (IsWearable())
            {
                AmbientTickEventArgs dummy = new AmbientTickEventArgs();
                var testingTarget          = dummy.WatchTime;
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <WatchTime>(testingTarget, "should be an instance of testing target class!");

                testingTarget.Dispose();
                tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeGet END (OK)");
            }
            else
            {
                tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeGet END (OK)");
                Assert.Pass("Not Supported profile");
            }
        }
Exemplo n.º 7
0
        public void WatchApplicationAmbientTickArgsWatchTime()
        {
            tlog.Debug(tag, $"WatchApplicationAmbientTickArgsWatchTime START");

            var testingTarget = new AmbientTickEventArgs();

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <AmbientTickEventArgs>(testingTarget, "should be an instance of testing target class!");

            Widget widget = new Widget();

            using (WatchTime time = new WatchTime(widget.GetIntPtr(), false))
            {
                testingTarget.WatchTime = time;
                Assert.IsNotNull(testingTarget.WatchTime);
            }

            widget.Dispose();
            widget = null;
            tlog.Debug(tag, $"WatchApplicationAmbientTickArgsWatchTime END (OK)");
        }
Exemplo n.º 8
0
 /// <summary>
 /// Overrides this method if want to handle behavior.
 /// </summary>
 /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
 protected virtual void OnAmbientTick(AmbientTickEventArgs e)
 {
     Log.Debug("NUI", "OnAmbientTick() is called!");
     AmbientTick?.Invoke(this, e);
 }
Exemplo n.º 9
0
 protected override void OnAmbientTick(AmbientTickEventArgs e)
 {
     base.OnAmbientTick(e);
     Tizen.Log.Error("NUI", "AmbientTick " + e.WatchTime.TimeZone + "(" + e.WatchTime.DaylightSavingTimeStatus + ") | " + e.WatchTime.Year + "/" + e.WatchTime.Month + "/" + e.WatchTime.Day + "(" + e.WatchTime.DayOfWeek + ")  " + e.WatchTime.Hour + "(" + e.WatchTime.Hour24 + "):" + e.WatchTime.Minute + ":" + e.WatchTime.Second + ":" + e.WatchTime.Millisecond + "\n");
 }