src/Microsoft/JSInterop/0.Core/src/Component/ComponentMember.cs
/// <summary>
/// Creates component member from property info or field info.
/// </summary>
/// <param name="component">The owner.</param>
/// <param name="memberInfo"></param>
/// <returns></returns>
Creates component member from property info or field info.
Creates component member from property info or field info .
public static ComponentMember Create(object? component, MemberInfo memberInfo)
        {
            if (memberInfo is FieldInfo fieldInfo) {
                return new ComponentMember(component, fieldInfo);
            }
            if (memberInfo is PropertyInfo propertyInfo) {
                return new ComponentMember(component, propertyInfo);
            }
            throw new NotSupportedException("Unsupported member type.");
        }
public static ComponentMember Create ( object ? component , MemberInfo memberInfo ) { if ( memberInfo is FieldInfo fieldInfo ) { return new ComponentMember ( component , fieldInfo ) ; } if ( memberInfo is PropertyInfo propertyInfo ) { return new ComponentMember ( component , propertyInfo ) ; } throw new NotSupportedException ( " " ) ; }
Creates component member from property info or field info.
Creates component member from property info or field info .
None
component
object?
None
memberInfo
MemberInfo
None