Esempio n. 1
0
        /// <summary>
        /// Gets the corporation image.
        /// </summary>
        private async Task GetImageAsync()
        {
            Uri   uri = ImageHelper.GetCorporationImageURL(m_corporationId);
            Image img = await ImageService.GetImageAsync(uri).ConfigureAwait(false);

            if (img != null)
            {
                m_image = img;
                EmploymentRecordImageUpdated?.ThreadSafeInvoke(this, EventArgs.Empty);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the corporation image.
        /// </summary>
        /// <param name="useFallbackUri">if set to <c>true</c> [use fallback URI].</param>
        private async Task GetImageAsync(bool useFallbackUri = false)
        {
            while (true)
            {
                Image img = await ImageService.GetImageAsync(GetImageUrl(useFallbackUri)).ConfigureAwait(false);

                if (img == null)
                {
                    if (useFallbackUri)
                    {
                        return;
                    }

                    useFallbackUri = true;
                    continue;
                }

                m_image = img;

                EmploymentRecordImageUpdated?.ThreadSafeInvoke(this, EventArgs.Empty);
                break;
            }
        }