Clear Up
SharpKit Reference

JsMethodAttribute Class

Specifies custom instructions for SharpKit for a single method, this information is used when exporting the member, and when using it.

Namespace: SharpKit.JavaScript

Base Types

System.Attribute

Base Interfaces

System.Runtime.InteropServices._Attribute

Constructors

Name Description
JsMethodAttribute()

Properties

Name Description
ArgumentsPrefix Sets a custom string to be inserted before arguments are written when invoking a function This is useful for method optimizations x.Call(a,b,c) -> x.Call("MyCustomCode",a,b,c);
ArgumentsSuffix Sets a custom string to be appended after arguments are written when invoking a function This is useful for method optimizations x.Call(a,b,c) -> x.Call(a,b,c,"MyCustomCode");
Code Custom javascript code implementation for this method
Export Indicates that SharpKit compiler will generate javascript code for this type / member This property is inherited and applied to all derived types. Default value is true
ExtensionImplementedInInstance Marks this extension method as an instance method in javascript
ForceDelegatesAsNativeFunctions Forces any delegate used in the current method to be created a native js function without an instance context
Global Indicates that this method is global, if exported, it will be exported as a global function, and when invoked, it will be invoked without a class name prefix
GlobalCode Generates the method code as global JavaScript code, without any function
IgnoreGenericArguments Ignores the generic arguments passed to a method when invoking it in JavaScript
InlineCode Tells the compiler to drop the method call and write the inline code instead. Only available for extention methods. object.SomeExtentionMethod(param) with InlineCode="object==param" ==> object==param
InsertArg0 Inserts a custom argument when invoking the function
InsertArg1 Inserts a custom argument when invoking the function
InsertArg2 Inserts a custom argument when invoking the function
InstanceImplementedAsExtension Allows an instance method to be invoke like an extension method x.Call() -> Call(x)
JsonInitializers Sends initializers to constructor as a parameter: Collection initializers as Json arrays Object initializers as a Json object Important note: a new json / array object will ALWAYS be passed to the constructor, even if no object initializers are passed.
Name Instructs SharpKit to use a custom name for a method, SharpKit will use this name when exporting the method, and when invoking it.
NativeDelegates Treats delegates inside this method as native javascript functions.
NativeOverloads When set to true - disables the overloading mechanism and assumes that the overloads are implemented in a single javascript method with this name
NativeParams When set to true, SharpKit will ignore the params[] keyword on the method parameter
OmitCalls Tells the compiler to omit calls to this method and assume that it was invoked Extension methods: s.DoSomething() ==> s
OmitCommas Causes the function to be invoked without any commas between arguments: x.Call(a,b,c) -> x.Call(abc);
OmitDotOperator Omits the dot (.) operator before the instance name, when invoking this method, used for javascript keywords (e.g.: instanceof)
OmitNewOperator Omits the new operator when creating new instances on a consutrctor
OmitOptionalParameters Omits optional parameters, when not sent by caller
OmitParanthesis Omits the paranthesis () when invoking this method, used for javascript keywords (e.g.: delete)
SharpKitVersion Targets the attribute for a specific SharpKit version, this attribute will be ignored if the current SharpKit version isn't in the range of the value specified
TargetMethod Applies the attribute externally on a method, if the method has overloads, attribute will be applied on all of them
TargetType Applies the attribute externally on a type
TargetTypeName Applies the attribute externally on a type
© Copyright 2005-2011 SharpKit. All rights reserved.