/// <summary>
        /// Creates a toast notification instance based on the data of the given beacon action.
        /// </summary>
        /// <param name="beaconAction"></param>
        /// <returns>A newly created toast notification.</returns>
        public static ToastNotification CreateToastNotification(BeaconAction beaconAction)
        {
            XmlDocument toastTemplate =
                CreateToastTemplate(beaconAction.Type, beaconAction.Subject, beaconAction.Body, beaconAction.Url);

            XmlAttribute urlAttribute = toastTemplate.CreateAttribute(KeyLaunch);

            string beaconActionAsString = beaconAction.ToString();
            urlAttribute.Value = beaconActionAsString;

            XmlNodeList toastElementList = toastTemplate.GetElementsByTagName(KeyToast);
            XmlElement toastElement = toastElementList[0] as XmlElement;

            if (toastElement != null)
            {
                toastElement.SetAttribute(KeyLaunch, beaconActionAsString);
            }

            return new ToastNotification(toastTemplate);
        }
        /// <summary>
        /// Creates a toast notification instance based on the data of the given beacon action.
        /// </summary>
        /// <returns>A newly created toast notification.</returns>
        public static ToastNotification CreateToastNotification(BeaconAction beaconAction)
        {
            XmlDocument toastTemplate =
                CreateToastTemplate(beaconAction.Type, beaconAction.Subject, beaconAction.Body, beaconAction.Url);

            XmlAttribute urlAttribute = toastTemplate.CreateAttribute(KeyLaunch);

            string beaconActionAsString = beaconAction.ToString();

            urlAttribute.Value = beaconActionAsString;

            XmlNodeList toastElementList = toastTemplate.GetElementsByTagName(KeyToast);
            XmlElement  toastElement     = toastElementList[0] as XmlElement;

            if (toastElement != null)
            {
                toastElement.SetAttribute(KeyLaunch, beaconActionAsString);
            }

            return(new ToastNotification(toastTemplate));
        }
 private bool Equals(ResolvedAction other)
 {
     return((!_beaconPids?.Except(other._beaconPids).GetEnumerator().MoveNext()).Value && Equals(BeaconAction.ToString(), other.BeaconAction.ToString()) && EventTypeDetectedByDevice == other.EventTypeDetectedByDevice &&
            Delay == other.Delay && SendOnlyOnce == other.SendOnlyOnce && SuppressionTime == other.SuppressionTime && ReportImmediately == other.ReportImmediately &&
            (!Timeframes?.Except(other.Timeframes).GetEnumerator().MoveNext()).Value);
 }