///------------------------------------------------------------------------------------------------- /// <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); }
///------------------------------------------------------------------------------------------------- /// <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); }