Ejemplo n.º 1
0
        /// <summary>
        /// Constructor from the API.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        /// <param name="src">The source.</param>
        internal EveNotification(CCPCharacter ccpCharacter, SerializableNotificationsListItem src)
        {
            m_ccpCharacter = ccpCharacter;

            NotificationID = src.NotificationID;
            TypeID = src.TypeID;
            m_typeName = EveNotificationType.GetName(src.TypeID);
            SenderName = src.SenderName;
            SentDate = src.SentDate;
            Recipient = new List<string> { ccpCharacter.Name };
            EVENotificationText = new EveNotificationText(this, new SerializableNotificationTextsListItem
            {
                NotificationID = 0,
                NotificationText = String.Empty,
            });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor from the API.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        /// <param name="src">The source.</param>
        internal EveNotification(CCPCharacter ccpCharacter, EsiNotificationsListItem src)
        {
            string typeCode = src.Type;

            m_ccpCharacter = ccpCharacter;
            NotificationID = src.NotificationID;
            TypeID         = EveNotificationType.GetID(typeCode);
            TypeName       = EveNotificationType.GetName(TypeID);
            m_senderID     = src.SenderID;
            m_title        = string.Empty;
            m_senderName   = (m_senderID == 0L) ? "EVE System" : EveIDToName.GetIDToName(m_senderID);
            SentDate       = src.SentDate;
            Recipient      = new List <string> {
                ccpCharacter.Name
            };
            EVENotificationText = new EveNotificationText(this, TypeID, src.NotificationText);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor from the API.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        /// <param name="src">The source.</param>
        internal EveNotification(CCPCharacter ccpCharacter, SerializableNotificationsListItem src)
        {
            m_ccpCharacter = ccpCharacter;

            NotificationID = src.NotificationID;
            TypeID         = src.TypeID;
            m_typeName     = EveNotificationType.GetName(src.TypeID);
            SenderName     = src.SenderName;
            SentDate       = src.SentDate;
            Recipient      = new List <string> {
                ccpCharacter.Name
            };
            EVENotificationText = new EveNotificationText(this, new SerializableNotificationTextsListItem
            {
                NotificationID   = 0,
                NotificationText = String.Empty,
            });
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor from the API.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        /// <param name="src">The source.</param>
        internal EveNotification(CCPCharacter ccpCharacter, EsiNotificationsListItem src)
        {
            m_ccpCharacter = ccpCharacter;

            NotificationID = src.NotificationID;
            TypeID         = EveNotificationType.GetID(src.Type);
            m_senderID     = src.SenderID;
            m_senderName   = (m_senderID == 0L) ? "EVE System" : EveIDToName.GetIDToName(m_senderID);
            SentDate       = src.SentDate;
            Recipient      = new List <string> {
                ccpCharacter.Name
            };
            EVENotificationText = new EveNotificationText(this, new SerializableNotificationTextsListItem
            {
                NotificationID   = 0,
                NotificationText = String.Empty,
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Processes the queried EVE notification text.
        /// </summary>
        /// <param name="result">The result.</param>
        private void OnEVENotificationTextDownloaded(CCPAPIResult <SerializableAPINotificationTexts> result)
        {
            m_queryPending = false;

            // Notify an error occured
            if (m_ccpCharacter.ShouldNotifyError(result, CCPAPICharacterMethods.NotificationTexts))
            {
                EveMonClient.Notifications.NotifyEVENotificationTextsError(m_ccpCharacter, result);
            }

            // Quits if there is an error
            if (result.HasError)
            {
                return;
            }

            // If there is an error response on missing IDs inform the user
            if (!String.IsNullOrEmpty(result.Result.MissingMessageIDs))
            {
                result.Result.Texts.Add(
                    new SerializableNotificationTextsListItem
                {
                    NotificationID   = long.Parse(result.Result.MissingMessageIDs, CultureConstants.InvariantCulture),
                    NotificationText = "The text for this notification was reported missing."
                });
            }

            // Quit if for any reason there is no text
            if (!result.Result.Texts.Any())
            {
                return;
            }

            // Import the data
            EVENotificationText = new EveNotificationText(this, result.Result.Texts.First());

            EveMonClient.OnCharacterEVENotificationTextDownloaded(m_ccpCharacter);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Processes the queried EVE notification text.
        /// </summary>
        /// <param name="result">The result.</param>
        private void OnEVENotificationTextDownloaded(CCPAPIResult<SerializableAPINotificationTexts> result)
        {
            m_queryPending = false;

            // Notify an error occured
            if (m_ccpCharacter.ShouldNotifyError(result, CCPAPICharacterMethods.NotificationTexts))
                EveMonClient.Notifications.NotifyEVENotificationTextsError(m_ccpCharacter, result);

            // Quits if there is an error
            if (result.HasError)
                return;

            // If there is an error response on missing IDs inform the user
            if (!String.IsNullOrEmpty(result.Result.MissingMessageIDs))
            {
                result.Result.Texts.Add(
                    new SerializableNotificationTextsListItem
                    {
                        NotificationID = long.Parse(result.Result.MissingMessageIDs, CultureConstants.InvariantCulture),
                        NotificationText = "The text for this notification was reported missing."
                    });
            }

            // Quit if for any reason there is no text
            if (!result.Result.Texts.Any())
                return;

            // Import the data
            EVENotificationText = new EveNotificationText(this, result.Result.Texts.First());

            EveMonClient.OnCharacterEVENotificationTextDownloaded(m_ccpCharacter);
        }