StopSubscribingForMessage() публичный Метод

public StopSubscribingForMessage ( [ subscriptionId ) : void
subscriptionId [
Результат void
Пример #1
0
 private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (pivot.SelectedIndex == 0)
         {
             deviceId = device.SubscribeForMessage("NDEF", messageReceived);
         }
         else if (pivot.SelectedIndex == 1)
         {
             User user = controller.getUser();
             if (user != null)
             {
                 textBoxName.Text = user.Firstname + " " + user.Lastname;
             }
             device.StopSubscribingForMessage(deviceId);
             if (checkIfAlarmReportIsEmpty())
             {
                 updateAlarmReportDateTime();
             }
         }
         else if (pivot.SelectedIndex == 3)
         {
             device.StopSubscribingForMessage(deviceId);
             int nfcs         = controller.getLocalStorageNFCs();
             int alarmReports = controller.getLocalStorageAlarmReports();
             int customers    = controller.getLocalStorageCustomers();
             textBlockPendingNFCScans.Text     = AppResources.PendingNFC + " " + nfcs;
             textBlockPendingAlarmReports.Text = AppResources.PendingAlarmReports + " " + alarmReports;
             textBlockPendingCustomers.Text    = AppResources.PendingCustomers + " " + customers;
             tempAlarmReportScroll.Children.Clear();
             List <AlarmReport> tempAlarmReports = controller.getLocalStorageTempAlarmReports();
             for (int i = 0; i < tempAlarmReports.Count; i++)
             {
                 TextBlock textBlock = new TextBlock();
                 textBlock.Text     = tempAlarmReports[i].CustomerName + "\r\n" + tempAlarmReports[i].CustomerNumber + "\r\n" + tempAlarmReports[i].Time;
                 textBlock.Tap     += myTextBlock_Tap;
                 textBlock.FontSize = 25;
                 textBlock.Name     = "" + (i + 1);
                 tempAlarmReportScroll.Children.Add(textBlock);
             }
         }
     }
     catch (NullReferenceException)
     {
         MessageBox.Show(AppResources.ReportNFCDisabled);
     }
 }
Пример #2
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (_proximityDevice != null)
     {
         if (_publishedMessageId != -1)
         {
             _proximityDevice.StopPublishingMessage(_publishedMessageId);
             _publishedMessageId = -1;
         }
         if (_subscribedMessageId != -1)
         {
             _proximityDevice.StopSubscribingForMessage(_subscribedMessageId);
             _subscribedMessageId = 1;
         }
     }
 }
Пример #3
0
 private void StopSubscribingButton_Click(object sender, RoutedEventArgs e)
 {
     proximityDevice.StopSubscribingForMessage(subscribedMessageId);
     subscribedMessageId = -1;
 }