示例#1
0
        private void GetNotificationsCompleted(object sender, GetNotificationsCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (m_pollRequestHadError)
                {
                    m_pollRequestHadError = false;

                    if (StatusChanged != null)
                    {
                        StatusChanged(ServiceConnectionStatesEnum.Ok, null);
                    }
                }

                if (e.Result != null && e.Result.Count > 0)
                {
                    foreach (KeyValuePair <string, List <string> > notificationSet in e.Result)
                    {
                        if (notificationSet.Key == m_machineEventSessionID && MachineEventReceived != null)
                        {
                            foreach (string machineEventStr in notificationSet.Value)
                            {
                                MachineEventReceived(SIPMonitorMachineEvent.ParseMachineEventCSV(machineEventStr));
                            }
                        }
                        else if (notificationSet.Key == m_controlEventSessionID && ControlEventReceived != null)
                        {
                            foreach (string controlEventStr in notificationSet.Value)
                            {
                                ControlEventReceived(controlEventStr);
                            }
                        }
                    }
                }
            }
            else
            {
                if (!m_pollRequestHadError)
                {
                    m_pollRequestHadError = true;
                    //LogActivityMessage_External(MessageLevelsEnum.Warn, "Error retrieving notifications. " + e.Error.Message);

                    if (StatusChanged != null)
                    {
                        StatusChanged(ServiceConnectionStatesEnum.Error, "Error retrieving notifications. " + e.Error.Message);
                    }
                }
            }
        }
示例#2
0
 void rrs_GetNotificationsCompleted(object sender, GetNotificationsCompletedEventArgs e)
 {
     if (e.Result != "")
     {
         string[] fulldata = e.Result.ToString().Split('?');
         if (fulldata.Length > 0)
         {
             textBlockTitle.Text = fulldata[0];
             textBlockBody.Text  = fulldata[1];
         }
     }
     else
     {
         MessageBox.Show("No Notification to view ");
     }
 }
        private void GetNotificationsCompleted(object sender, GetNotificationsCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (m_pollRequestHadError)
                {
                    m_pollRequestHadError = false;

                    if (StatusChanged != null)
                    {
                        StatusChanged(ServiceConnectionStatesEnum.Ok, null);
                    }
                }

                if (e.Result != null && e.Result.Count > 0)
                {
                    foreach (KeyValuePair<string, List<string>> notificationSet in e.Result)
                    {
                        if (notificationSet.Key == m_machineEventSessionID && MachineEventReceived != null)
                        {
                            foreach (string machineEventStr in notificationSet.Value)
                            {
                                MachineEventReceived(SIPMonitorMachineEvent.ParseMachineEventCSV(machineEventStr));
                            }
                        }
                        else if (notificationSet.Key == m_controlEventSessionID && ControlEventReceived != null)
                        {
                            foreach (string controlEventStr in notificationSet.Value)
                            {
                                ControlEventReceived(controlEventStr);
                            }
                        }
                    }
                }
            }
            else
            {
                if (!m_pollRequestHadError)
                {
                    m_pollRequestHadError = true;
                    //LogActivityMessage_External(MessageLevelsEnum.Warn, "Error retrieving notifications. " + e.Error.Message);
                    
                    if (StatusChanged != null)
                    {
                        StatusChanged(ServiceConnectionStatesEnum.Error, "Error retrieving notifications. " + e.Error.Message);
                    }
                }
            }
        }