Επεξεργασία

Κοινή χρήση μέσω


JSImportAttribute Class

Definition

Indicates that the JSImport source generator should create a managed wrapper to invoke a specific imported JavaScript function and marshal its arguments, return values, and exceptions.

public ref class JSImportAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
[System.Runtime.Versioning.SupportedOSPlatform("browser")]
public sealed class JSImportAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
[<System.Runtime.Versioning.SupportedOSPlatform("browser")>]
type JSImportAttribute = class
    inherit Attribute
Public NotInheritable Class JSImportAttribute
Inherits Attribute
Inheritance
JSImportAttribute
Attributes

Remarks

To configure the marshalling behavior for specific values, JSMarshalAsAttribute<T>.

This attribute is meaningless if the source generator associated with it is not enabled.

The current built-in source generator only supports C# and only supplies an implementation when applied to static, partial, non-generic methods.

Constructors

JSImportAttribute(String, String)

Initializes a new instance of the JSImportAttribute class.

JSImportAttribute(String)

Initializes a new instance of the JSImportAttribute class.

Properties

FunctionName

Gets the name of the target JavaScript function. This name will be used as a key to locate the function in the module.

ModuleName

Gets the globally unique identifier of the ES6 module, if any, that contains the function. The module must be loaded via ImportAsync(String, String, CancellationToken) before any attempt to invoke the function.

TypeId

When implemented in a derived class, gets a unique identifier for this Attribute.

(Inherited from Attribute)

Methods

Equals(Object)

Returns a value that indicates whether this instance is equal to a specified object.

(Inherited from Attribute)
GetHashCode()

Returns the hash code for this instance.

(Inherited from Attribute)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsDefaultAttribute()

When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
Match(Object)

When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to