當前位置: 首頁>>代碼示例>>C#>>正文


C# PictureBox.Equals方法代碼示例

本文整理匯總了C#中System.Windows.Forms.PictureBox.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# PictureBox.Equals方法的具體用法?C# PictureBox.Equals怎麽用?C# PictureBox.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.PictureBox的用法示例。


在下文中一共展示了PictureBox.Equals方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: shipSelect

 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);
     }
 }
開發者ID:brandt19,項目名稱:Battleship,代碼行數:29,代碼來源:Form1.cs

示例2: GetImageUrl

        /// <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);
        }
開發者ID:RapidFiring,項目名稱:evemon,代碼行數:31,代碼來源:KillReportAttacker.cs

示例3: GetImageUrl

        /// <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);
        }
開發者ID:RapidFiring,項目名稱:evemon,代碼行數:33,代碼來源:KillReportVictim.cs


注:本文中的System.Windows.Forms.PictureBox.Equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。