src/Mimp.SeeSharper.Reflection/TypeExtensions.Default.cs
/// <summary>
/// Return a compiled delegate to get the default of <paramref name="type"/>.
/// </summary>
/// <typeparam name="TDelegate"></typeparam>
/// <param name="type"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="InvalidOperationException">If type isn't castable to return type of delegate.</exception>
Return a compiled delegate to get the default of .
Return a compiled delegate to get the default of .
public static TDelegate GetDefaultDelegate<TDelegate>(this Type type) where TDelegate : Delegate
        {
            if (type is null)
                throw new ArgumentNullException(nameof(type));
            return (TDelegate)type.GetDefaultDelegate(typeof(TDelegate));
        }
public static TDelegate GetDefaultDelegate < TDelegate > ( this Type type ) where TDelegate : Delegate { if ( type is null ) throw new ArgumentNullException ( nameof ( type ) ) ; return ( TDelegate ) type . GetDefaultDelegate ( typeof ( TDelegate ) ) ; }
Return a compiled delegate to get the default of .
Return a compiled delegate to get the default of .
None
None
If type isn't castable to return type of delegate.
If type isn ' t castable to return type of delegate .
Type
this
type
None
typeparam
None