Beispiel #1
0
        ///-------------------------------------------------------------------------------------------------
        /// <summary> Searches for the first Resource model of type.</summary>
        /// <param name="TheType"> Type of the.</param>
        ///
        /// <returns> The found type.</returns>
        ///-------------------------------------------------------------------------------------------------

        public ResourceModel FindType(Type TheType)
        {
            ResourceModel result = null;

            foreach (ResourceModel RM in this)
            {
                if (RM.GetType() == TheType)
                {
                    result = RM;
                    break;
                }
            }
            return(result);
        }
Beispiel #2
0
        ///-------------------------------------------------------------------------------------------------
        /// <summary> Query if 'TheType' is contained in List.</summary>
        ///
        /// <param name="TheType"> Type of the.</param>
        ///
        /// <returns> True if it succeeds, false if it fails.</returns>
        ///-------------------------------------------------------------------------------------------------

        public bool ContainsType(Type TheType)
        {
            bool result = false;

            foreach (ResourceModel RM in this)
            {
                if (RM.GetType() == TheType)
                {
                    result = true;
                    break;
                }
            }
            return(result);
        }