Ejemplo n.º 1
0
        /// <summary>
        /// Gets the contract items.
        /// </summary>
        private void GetContractItems()
        {
            // Exit if we are already trying to download
            if (m_queryPending)
            {
                return;
            }

            m_queryPending = true;

            // Special condition to identify corporation contracts in character query
            APIKey apiKey = IssuedFor == IssuedFor.Corporation && CCPAPICorporationMethods.CorporationContracts.Equals(m_method)
                ? Character.Identity.FindAPIKeyWithAccess(CCPAPICorporationMethods.CorporationContracts)
                : Character.Identity.FindAPIKeyWithAccess(CCPAPICharacterMethods.Contracts);

            // Quits if access denied
            if (apiKey == null)
            {
                return;
            }

            // Special condition to identify corporation contracts in character query and determine the correct api method to call
            m_apiMethod = IssuedFor == IssuedFor.Corporation && CCPAPICorporationMethods.CorporationContracts.Equals(m_method)
                ? CCPAPIGenericMethods.CorporationContractItems
                : CCPAPIGenericMethods.ContractItems;

            EveMonClient.APIProviders.CurrentProvider.QueryMethodAsync <SerializableAPIContractItems>(
                m_apiMethod, apiKey.ID, apiKey.VerificationCode, Character.CharacterID, ID, OnContractItemsDownloaded);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the icon.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <param name="height">The height.</param>
        private void AddIcon(Enum method, int height)
        {
            Bitmap icon        = Resources.KeyGrey16;
            string iconToolTip = "This is a basic feature query.";

            if (method is CCPAPICharacterMethods)
            {
                CCPAPICharacterMethods apiMethod = (CCPAPICharacterMethods)method;
                if ((long)apiMethod == ((long)apiMethod & (long)CCPAPIMethodsEnum.AdvancedCharacterFeatures))
                {
                    icon        = Resources.KeyGold16;
                    iconToolTip = "This is an advanced feature query.";
                }
            }

            if (method is CCPAPIGenericMethods)
            {
                CCPAPIGenericMethods apiGenericMethod = (CCPAPIGenericMethods)method;
                if (CCPAPIGenericMethods.PlanetaryColonies.Equals(apiGenericMethod))
                {
                    icon        = Resources.KeyGold16;
                    iconToolTip = "This is an advanced feature query.";
                }
            }

            // Uncomment upon implementing an exclicit corporation monitor feature
            //if (method is APICorporationMethods)
            //{
            //    APICorporationMethods apiMethod = (APICorporationMethods)method;
            //    if ((int)apiMethod == ((int)apiMethod & (int)APIMethodsEnum.AdvancedCorporationFeatures))
            //    {
            //        icon = CommonProperties.Resources.KeyGold16;
            //        iconToolTip = "This is an advanced feature query.";
            //    }
            //}

            PictureBox tempPicture = null;

            try
            {
                tempPicture = new PictureBox();
                toolTip.SetToolTip(tempPicture, iconToolTip);
                tempPicture.Location = new Point(0, height + (RowHeight - icon.Size.Height) / 2);
                tempPicture.Image    = icon;
                tempPicture.Size     = icon.Size;

                PictureBox picture = tempPicture;
                tempPicture = null;

                Controls.Add(picture);
            }
            finally
            {
                tempPicture?.Dispose();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the contract items.
        /// </summary>
        private void GetContractItems()
        {
            // Exit if we are already trying to download
            if (m_queryPending)
                return;

            m_queryPending = true;

            // Special condition to identify corporation contracts in character query
            APIKey apiKey = IssuedFor == IssuedFor.Corporation && CCPAPICorporationMethods.CorporationContracts.Equals(m_method)
                ? Character.Identity.FindAPIKeyWithAccess(CCPAPICorporationMethods.CorporationContracts)
                : Character.Identity.FindAPIKeyWithAccess(CCPAPICharacterMethods.Contracts);

            // Quits if access denied
            if (apiKey == null)
                return;

            // Special condition to identify corporation contracts in character query and determine the correct api method to call
            m_apiMethod = IssuedFor == IssuedFor.Corporation && CCPAPICorporationMethods.CorporationContracts.Equals(m_method)
                ? CCPAPIGenericMethods.CorporationContractItems
                : CCPAPIGenericMethods.ContractItems;

            EveMonClient.APIProviders.CurrentProvider.QueryMethodAsync<SerializableAPIContractItems>(
                m_apiMethod, apiKey.ID, apiKey.VerificationCode, Character.CharacterID, ID, OnContractItemsDownloaded);
        }