Beispiel #1
0
        /// <summary>
        /// Adds the attribute to the request.
        /// </summary>
        /// <param name="attributeIds">The attribute ids.</param>
        public void AddAttribute(params uint[] attributeIds)
        {
            if (m_attributeIds == null)
            {
                m_attributeIds = new List <uint>();
            }

            if (attributeIds != null)
            {
                for (int ii = 0; ii < attributeIds.Length; ii++)
                {
                    bool found = false;

                    for (int jj = 0; jj < AttributeIds.Count; jj++)
                    {
                        if (AttributeIds[jj] == attributeIds[ii])
                        {
                            found = true;
                            break;
                        }
                    }

                    if (!found)
                    {
                        AttributeIds.Add(attributeIds[ii]);
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        ///   Check if a list of attribute can use the index
        /// </summary>
        /// <returns> true if the list of attribute can use this index </returns>
        public bool MatchAttributeIds(int[] attributeIdsToMatch)
        {
            //TODO an index with lesser attribute than the one to match can be used
            if (AttributeIds.Length != attributeIdsToMatch.Length)
            {
                return(false);
            }

            foreach (var attributeIdToMatch in attributeIdsToMatch)
            {
                var found = AttributeIds.Any(t => t == attributeIdToMatch);
                if (!found)
                {
                    return(false);
                }
            }

            return(true);
        }