Example #1
0
        /// <summary>
        /// Processes the queried EVE mail message mail body.
        /// </summary>
        /// <param name="result">The result.</param>
        private void OnEVEMailBodyDownloaded(APIResult <SerializableAPIMailBodies> result)
        {
            m_queryPending = false;

            // Notify an error occured
            if (m_ccpCharacter.ShouldNotifyError(result, APIMethods.MailBodies))
            {
                EveClient.Notifications.NotifyEVEMailBodiesError(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.Bodies.Add(
                    new SerializableMailBodiesListItem
                {
                    MessageID   = long.Parse(result.Result.MissingMessageIDs),
                    MessageText = "The text for this message was reported missing."
                });
            }

            // Quit if for any reason there is no text
            if (result.Result.Bodies.Count == 0)
            {
                return;
            }

            // Import the data
            EVEMailBody = new EveMailBody(result.Result.Bodies[0]);

            EveClient.OnCharacterEVEMailBodyDownloaded(m_ccpCharacter);
        }
Example #2
0
        /// <summary>
        /// Processes the queried EVE mail message mail body.
        /// </summary>
        /// <param name="result">The result.</param>
        private void OnEVEMailBodyDownloaded(APIResult<SerializableAPIMailBodies> result)
        {
            m_queryPending = false;

            // Notify an error occured
            if (m_ccpCharacter.ShouldNotifyError(result, APIMethods.MailBodies))
                EveClient.Notifications.NotifyEVEMailBodiesError(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.Bodies.Add(
                                    new SerializableMailBodiesListItem
                                    {
                                        MessageID = long.Parse(result.Result.MissingMessageIDs),
                                        MessageText = "The text for this message was reported missing."
                                    });

            // Quit if for any reason there is no text
            if (result.Result.Bodies.Count == 0)
                return;            

            // Import the data
            EVEMailBody = new EveMailBody(result.Result.Bodies[0]);

            EveClient.OnCharacterEVEMailBodyDownloaded(m_ccpCharacter);
        }