src/Microsoft/JSInterop/0.Abstractions/src/Annotations/JSModuleAttributeUtils.cs
/// <summary>
/// Tries to get the module name or path. If property
/// attribute does exist the module name or path has
/// to be provided either from property attribute or
/// module attribute.
/// </summary>
/// <param name="componentMember"></param>
/// <param name="moduleNameOrPath"></param>
/// <param name="propertyAttribute"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException">
/// Thrown when JavaScrit module facade attribute is 
/// given but module name or path could not been found.
/// </exception>
Tries to get the module name or path. If property
attribute does exist the module name or path has
to be provided either from property attribute or
module attribute.
Tries to get the module name or path . If property attribute does exist the module name or path has to be provided either from property attribute or module attribute .
public static bool TryGetModuleNameOrPath<TPropertyAttribute, TClassAttribute>(
            IMemberDefinition componentMember,
            [MaybeNullWhen(false)] out TPropertyAttribute propertyAttribute,
            [MaybeNullWhen(false)] out string moduleNameOrPath)
            where TPropertyAttribute : ActivateModuleAttribute
            where TClassAttribute : JSModuleAttribute
        {
            if (!componentMember.TryGetAttribute(out propertyAttribute)) {
                moduleNameOrPath = null;
                return false;
            }
            moduleNameOrPath = GetModuleNameOrPath<TClassAttribute>(propertyAttribute, componentMember.MemberTypeInfo);
            return true;
        }
public static bool TryGetModuleNameOrPath < TPropertyAttribute , TClassAttribute > ( IMemberDefinition componentMember , [ MaybeNullWhen ( false ) ] out TPropertyAttribute propertyAttribute , [ MaybeNullWhen ( false ) ] out string moduleNameOrPath ) where TPropertyAttribute : ActivateModuleAttribute where TClassAttribute : JSModuleAttribute { if ( ! componentMember . TryGetAttribute ( out propertyAttribute ) ) { moduleNameOrPath = null ; return false ; } moduleNameOrPath = GetModuleNameOrPath < TClassAttribute > ( propertyAttribute , componentMember . MemberTypeInfo ) ; return true ; }
Tries to get the module name or path.
Tries to get the module name or path .
None
Thrown when JavaScrit module facade attribute is
given but module name or path could not been found.
Thrown when JavaScrit module facade attribute is given but module name or path could not been found .
componentMember
IMemberDefinition
None
out
[MaybeNullWhen(false)]
moduleNameOrPath
None
propertyAttribute
None