コード例 #1
0
 private async void SaveImage(object sender, MotionResult e)
 {
     if (await ShouldSendNotification(e.Difference))
     {
         MotionDetectorFactory.SaveImage();
         Debug.WriteLine("Image Captured");
     }
     ;
 }
コード例 #2
0
 private void SendNotification(object sender, MotionResult e) => new Task(async() =>
 {
     if (await ShouldSendNotification(e.Difference))
     {
         //big movement occured
         SubscribeNotificationData.sendNotificationToAll();
         MotionDetectorFactory.ImageCaptured -= SendNotification;
         Task.Delay(5000).Wait();
         MotionDetectorFactory.ImageCaptured += SendNotification;
     }
 }).Start();
コード例 #3
0
        private async void UpdateUI(object sender, MotionResult e)
        {
            UpdatePrevToResult(e.Image);
            ShowMessage(e.Difference.ToString());
            CaptureImage();

            await runOnUIThread(() =>
            {
                if (e.Difference > NotificationAt.Value)
                {
                    NotificationControl.Background = new SolidColorBrush(Color.FromArgb(255, 244, 217, 66));
                }
                else
                {
                    NotificationControl.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
                }
            });
        }