Exemplo n.º 1
0
 protected void OnWarning(WarningArgs arg)
 {
     if (WarningOccured != null)
     {
         WarningOccured(this, arg);
     }
 }
        /// <summary>
        /// Warn the user if he/she is too slow/fast or reached the required distance/time
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">Warning type</param>
        private void Model_Warning(object sender, WarningArgs e)
        {
            var vibrator = (Vibrator)GetSystemService(VibratorService);

            vibrator.Vibrate(500);

            switch (e.Warning)
            {
            case WarningType.Distance:
                Toast.MakeText(this, "You reached the required distance.", ToastLength.Long).Show();
                break;

            case WarningType.SpeedFast:
                Toast.MakeText(this, "You are too fast.", ToastLength.Long).Show();
                break;

            case WarningType.SpeedSlow:
                Toast.MakeText(this, "You are too slow.", ToastLength.Long).Show();
                break;

            case WarningType.Time:
                Toast.MakeText(this, "You reached the required time.", ToastLength.Long).Show();
                break;
            }
        }
Exemplo n.º 3
0
 private void Ps_OnWarning(object sender, WarningArgs e)
 {
     if (e.action == WindowAction.Open)
         warningConfirmPanel.SetActive(true);
     else if (e.action == WindowAction.Confirm)
         warningConfirmPanel.SetActive(false);
     else if (e.action == WindowAction.Close) warningConfirmPanel.SetActive(false);
 }
Exemplo n.º 4
0
        private void OnWarning(IntPtr converter, string message)
        {
            var eventArgs = new WarningArgs
            {
                Document = _processingDocument,
                Message  = message
            };

            Warning?.Invoke(this, eventArgs);
        }
 void _sys_WarningOccured(object sender, WarningArgs e)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => {
         if (e.Type == WarningType.ConnectonFailed)
         {
             DisableListView("Connection Failed: " + e.Message);
         }
         else
         {
             MessageDialog.Show(MessageType.Warn, e.Message, e.Content);
         }
     }));
 }
Exemplo n.º 6
0
        public static void SendWarningMessage(string warning)
        {
            try
            {
                var warningArgs = new WarningArgs
                {
                    Message = warning
                };

                MessagingCenter.Send(Application.Current, Warning.ToString(), warningArgs);
            }
            catch (Exception exception)
            {
                DebugWriteException(exception);
            }
        }
Exemplo n.º 7
0
        private void Model_Warning(object sender, WarningArgs e)
        {
            switch (e.Warning)
            {
            case WarningType.Distance:
                distancewarning = true;
                break;

            case WarningType.SpeedFast:
                fastwarning = true;
                break;

            case WarningType.SpeedSlow:
                slowwarning = true;
                break;

            case WarningType.Time:
                timewarning = true;
                break;
            }
        }
Exemplo n.º 8
0
 private static void Converter_Warning(object sender, WarningArgs e)
 {
     Console.WriteLine("[WARN] {0}", e.Message);
 }
Exemplo n.º 9
0
 void _sys_WarningOccured(object sender, WarningArgs e)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => {
         MessageDialog.Show(MessageType.Warn, e.Message, e.Content);
     }));
 }
Exemplo n.º 10
0
 void System_WarningOccured(object sender, WarningArgs e)
 {
     OnWarning(e);
 }
Exemplo n.º 11
0
        private static void ProcessWarningMessage(WarningArgs args)
        {
            DebugWriteWarning(args.Message);

            // TODO
        }