C# Class Castle.Sharp2Js.JsGenerator

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

Public Methods

Method 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

Method 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 method

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.
return string