src/Microsoft/Windows/ComponentObjectModel/_Library/ComponentAttributeCollection.cs
/// <summary>
/// Returns a List of typed attributes contained in this collection.
/// </summary>
/// <typeparam name="T">The type of the attribute.</typeparam>
/// <returns>A list of typed attributes, as specified by T or default, when attribute is not found in the collection.</returns>
Returns a List of typed attributes contained in this collection.
Returns a List of typed attributes contained in this collection .
public List<T> ToList<T>() where T : Attribute {
            if ( false == _attributes.TryGetValue( typeof( T ).FullName, out List<Attribute> list ) ) {
                return default;
            }
            List<T> result = new List<T>(list.Count);
            for ( int i = 0 ; i < list.Count ; i++ ) {
                result.Add( (T)list[i] );
            }
            return result;
        }
public List < T > ToList < T > ( ) where T : Attribute { if ( false == _attributes . TryGetValue ( typeof ( T ) . FullName , out List < Attribute > list ) ) { return default ; } List < T > result = new List < T > ( list . Count ) ; for ( int i = 0 ; i < list . Count ; i ++ ) { result . Add ( ( T ) list [ i ] ) ; } return result ; }
Returns a List of typed attributes contained in this collection.
Returns a List of typed attributes contained in this collection .
A list of typed attributes, as specified by T or default, when attribute is not found in the collection.
A list of typed attributes as specified by T or default when attribute is not found in the collection .
typeparam
The type of the attribute.
The type of the attribute .