示例#1
0
        private void SendToProwl(Operation operation, string message, string header)
        {
            try
            {
                IEnumerable <string> recipients = GetRecipientApiKeysFor(operation, "Prowl");

                if (recipients.Any())
                {
                    Prowl.SendNotifications(recipients, ApplicationName, header, message);
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.LogFormat(LogType.Error, this, Properties.Resources.ErrorProwl, ex.Message);
                Logger.Instance.LogException(this, ex);
            }
        }
示例#2
0
        private void NotifyProwl(Operation operation)
        {
            string        content         = operation.ToString(_expression);
            List <String> prowlRecipients = (from pushEntryObject in GetRecipients(operation) where pushEntryObject.Consumer == "Prowl" select pushEntryObject.RecipientApiKey).ToList();

            if (prowlRecipients.Count != 0)
            {
                try
                {
                    Prowl.Notify(prowlRecipients, ApplicationName, HeaderText, content, ProwlNotificationPriority.Emergency);
                }
                catch (Exception ex)
                {
                    Logger.Instance.LogFormat(LogType.Error, this, Resources.ErrorProwl, ex.Message);
                    Logger.Instance.LogException(this, ex);
                }
            }
        }