Exemple #1
0
 public void shipSelect(PictureBox sender)
 {
     foreach (PictureBox shipPictureBox in shipPictureBoxes)
     {
         shipPictureBox.BackColor = Color.Transparent;
     }
     sender.BackColor = Color.White;
     activeShipPictureBox = sender;
     if (sender.Equals(ship2PictureBox))
     {
         selectedShip = controller.getPlayer().getShip(ShipName.patrol);
     }
     else if (sender.Equals(ship3aPictureBox))
     {
         selectedShip = controller.getPlayer().getShip(ShipName.submarine);
     }
     else if (sender.Equals(ship3bPictureBox))
     {
         selectedShip = controller.getPlayer().getShip(ShipName.battleship);
     }
     else if (sender.Equals(ship4PictureBox))
     {
         selectedShip = controller.getPlayer().getShip(ShipName.destroyer);
     }
     else if (sender.Equals(ship5PictureBox))
     {
         selectedShip = controller.getPlayer().getShip(ShipName.carrier);
     }
 }
        /// <summary>
        /// Gets the image URL.
        /// </summary>
        /// <param name="pictureBox">The picture box.</param>
        /// <param name="useFallbackUri">if set to <c>true</c> [use fallback URI].</param>
        /// <returns></returns>
        private Uri GetImageUrl(PictureBox pictureBox, bool useFallbackUri)
        {
            string path;

            if (pictureBox == CharacterPictureBox)
            {
                path = String.Format(CultureConstants.InvariantCulture,
                    NetworkConstants.CCPPortraits, m_attacker.ID, (int)EveImageSize.x64);

                return useFallbackUri
                    ? ImageService.GetImageServerBaseUri(path)
                    : ImageService.GetImageServerCdnUri(path);
            }

            int typeId = pictureBox.Equals(ShipPictureBox)
                ? m_attacker.ShipTypeID
                : m_attacker.WeaponTypeID;

            path = String.Format(CultureConstants.InvariantCulture,
                NetworkConstants.CCPIconsFromImageServer, "type", typeId, (int)EveImageSize.x32);

            return useFallbackUri
                ? ImageService.GetImageServerBaseUri(path)
                : ImageService.GetImageServerCdnUri(path);
        }
        /// <summary>
        /// Gets the image URL.
        /// </summary>
        /// <param name="pictureBox">The picture box.</param>
        /// <param name="useFallbackUri">if set to <c>true</c> [use fallback URI].</param>
        /// <returns></returns>
        private Uri GetImageUrl(PictureBox pictureBox, bool useFallbackUri)
        {
            string path = String.Empty;

            if (pictureBox.Equals(CharacterPictureBox))
                path = String.Format(CultureConstants.InvariantCulture,
                    NetworkConstants.CCPPortraits, m_killLog.Victim.ID, (int)EveImageSize.x128);

            if (pictureBox.Equals(ShipPictureBox))
                path = String.Format(CultureConstants.InvariantCulture,
                    NetworkConstants.CCPIconsFromImageServer, "render", m_killLog.Victim.ShipTypeID,
                    (int)EveImageSize.x128);

            if (pictureBox.Equals(CorpPictureBox))
                path = String.Format(CultureConstants.InvariantCulture,
                    NetworkConstants.CCPIconsFromImageServer, "corporation", m_killLog.Victim.CorporationID,
                    (int)EveImageSize.x32);

            if (pictureBox.Equals(AlliancePictureBox))
                path = String.Format(CultureConstants.InvariantCulture,
                    NetworkConstants.CCPIconsFromImageServer, "alliance", m_killLog.Victim.AllianceID,
                    (int)EveImageSize.x32);

            return useFallbackUri
                ? ImageService.GetImageServerBaseUri(path)
                : ImageService.GetImageServerCdnUri(path);
        }