protected override async void OnNavigatedTo(NavigationEventArgs e)
 {
     rootPage = MainPage.Current;
     // Clear the messages
     rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);
     counterListener.StartListening(OnReceivedCount);
 }
 public void StartListening()
 {
     try
     {
         counterListener.StartListening(OnReceivedCount, null);
     }
     catch (Exception ex)
     {
         Debug.WriteLine($"Counter: {ex.Message}");
     }
 }
 public void StartListening()
 {
     try
     {
         counterListener.StartListening(null, OnIndividualCounter);
     }
     catch (Exception ex)
     {
         Debug.WriteLine($"CounterVis: {ex.Message}");
     }
 }
Beispiel #4
0
        /// <summary>
        /// Customer counter reset helper
        /// </summary>
        /// <param name="val">number of customers in store currently</param>
        /// <returns></returns>
        public static async Task <bool> ResetCustomerCounter(int val)
        {
            bool succeeded = false;

            try
            {
                CounterListener counterListener = new CounterListener(SettingsHelper.Instance.CustomerCounterEndpoint,
                                                                      Util.ToIntSafely(SettingsHelper.Instance.CustomerCounterTiming, 5));
                counterListener.StartListening();
                succeeded = await counterListener.ResetAsync(val);

                counterListener.StopListening();
            }
            catch (Exception)
            {
                // Ignore
            }

            return(succeeded);
        }