C# Class Castle.Sharp2Js.JsGenerator

Converts C# classes to javascript objects for use across application tiers and in REST calls, etc.
Afficher le fichier Open project: castle-it/sharp2Js

Méthodes publiques

Méthode Description
Generate ( IEnumerable typesToGenerate, Castle.Sharp2Js.JsGeneratorOptions generatorOptions = null ) : string

Generates a string containing js definitions of the provided types and all implied descendant types.

Private Methods

Méthode Description
BuildArrayProperty ( StringBuilder sb, PropertyBag propEntry, Castle.Sharp2Js.JsGeneratorOptions options ) : void

Builds an array property.

BuildClassClosure ( StringBuilder sb ) : void

Builds the Js class closure.

BuildClassConstructor ( PropertyBag>.IGrouping type, StringBuilder sb, Castle.Sharp2Js.JsGeneratorOptions options ) : void

Builds the class constructor.

BuildDictionaryProperty ( StringBuilder sb, PropertyBag propEntry, Castle.Sharp2Js.JsGeneratorOptions options ) : void

Builds a dictionary property.

BuildEqualsFunctionForClass ( StringBuilder sb, IEnumerable propList, Castle.Sharp2Js.JsGeneratorOptions options ) : void

Builds the equals function for a type.

BuildMergeFunctionForClass ( StringBuilder sb, IEnumerable propList, Castle.Sharp2Js.JsGeneratorOptions options ) : void

Builds the merge function for a type.

BuildObjectProperty ( StringBuilder sb, PropertyBag propEntry, Castle.Sharp2Js.JsGeneratorOptions options ) : void

Builds an object/reference property.

BuildPrimitiveProperty ( PropertyBag propEntry, StringBuilder sb, Castle.Sharp2Js.JsGeneratorOptions options ) : void

Builds a primitive property.

GenerateJs ( IEnumerable propertyCollection, Castle.Sharp2Js.JsGeneratorOptions generationOptions ) : string

Generates the js.

GenerateJsModelFromTypeWithDescendants ( Type modelType, bool camelCasePropertyNames, string outputNamespace ) : string
JsGeneratorOptions ( ) : System

Method Details

Generate() public static méthode

Generates a string containing js definitions of the provided types and all implied descendant types.
public static Generate ( IEnumerable typesToGenerate, Castle.Sharp2Js.JsGeneratorOptions generatorOptions = null ) : string
typesToGenerate IEnumerable The types to generate.
generatorOptions Castle.Sharp2Js.JsGeneratorOptions The generator options. Uses global settings if not provided.
Résultat string