ScriptableMemberAttribute Class
Silverlight
Indicates that a specific property, method, or event is accessible to JavaScript callers.
Namespace: System.Windows.Browser
Assembly: System.Windows.Browser (in System.Windows.Browser.dll)
The ScriptableMemberAttribute type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ScriptableMemberAttribute | Initializes a new instance of the ScriptableMemberAttribute class. |
| Name | Description | |
|---|---|---|
![]() | EnableCreateableTypes | Controls the generation of Silverlight plug-in helper methods that can be used to create wrappers around managed objects. |
![]() | ScriptAlias | Gets or sets the name of a property, method, or event that is exposed to JavaScript code. By default, the script alias is the same as the name of the managed property, method, or event. |
| Name | Description | |
|---|---|---|
![]() | Equals | Infrastructure. Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Returns the hash code for this instance. (Inherited from Attribute.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Match | 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.) |
If you want to expose all properties, methods, and events that are associated with a type as scriptable, use the ScriptableTypeAttribute class instead.
The following example shows how you make a property, method, or event (PME) scriptable by applying the ScriptableMemberAttribute immediately before the name of the PME.
public class SMT_ScriptableManagedType
{
[ScriptableMember] // This is the preferred syntax
public string GetString()
{ return "abcdefg"; }
[ScriptableMemberAttribute] // This is also acceptable
public string GetString()
{ return "abcdefg"; }
}
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
