当前位置: 首页>>代码示例>>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;未经允许,请勿转载。