C# Class Castle.Sharp2Js.Helpers

Helper functions for Js Generator
ファイルを表示 Open project: castle-it/sharp2Js Class Usage Examples

Public Methods

Method Description
GetName ( string input, List nameFilters ) : string

Gets the name, filtering out the strings provided.

GetPropertyName ( PropertyInfo propertyInfo, Castle.Sharp2Js.JsGeneratorOptions generatorOptions ) : string

Gets the name of the property.

HasDefaultValue ( PropertyInfo propertyInfo, Castle.Sharp2Js.JsGeneratorOptions generatorOptions ) : bool

Determines whether the property has a default value specified by the DefaultValue attribute.

IsCollectionType ( Type propertyType ) : bool

Determines whether the specified property type is a collection.

IsDictionaryType ( Type propertyType ) : bool

Determines whether the specified property type is a dictionary.

IsPrimitive ( Type propertyType ) : bool

Determines whether the specified property type is primitive.

ReadDefaultValueFromAttribute ( PropertyInfo propertyInfo ) : object

Reads the default value from the attribute.

ShouldGenerateMember ( PropertyInfo propertyInfo, Castle.Sharp2Js.JsGeneratorOptions generatorOptions ) : bool

Determines whether the property should be generated in the Js model.

ToCamelCase ( string input, bool camelCase ) : string

Camel cases an input string.

Method Details

GetName() public static method

Gets the name, filtering out the strings provided.
public static GetName ( string input, List nameFilters ) : string
input string The input.
nameFilters List The name filters.
return string

GetPropertyName() public static method

Gets the name of the property.
public static GetPropertyName ( PropertyInfo propertyInfo, Castle.Sharp2Js.JsGeneratorOptions generatorOptions ) : string
propertyInfo System.Reflection.PropertyInfo The property information.
generatorOptions Castle.Sharp2Js.JsGeneratorOptions The generator options.
return string

HasDefaultValue() public static method

Determines whether the property has a default value specified by the DefaultValue attribute.
public static HasDefaultValue ( PropertyInfo propertyInfo, Castle.Sharp2Js.JsGeneratorOptions generatorOptions ) : bool
propertyInfo System.Reflection.PropertyInfo The property information.
generatorOptions Castle.Sharp2Js.JsGeneratorOptions The generator options.
return bool

IsCollectionType() public static method

Determines whether the specified property type is a collection.
public static IsCollectionType ( Type propertyType ) : bool
propertyType System.Type Type of the property.
return bool

IsDictionaryType() public static method

Determines whether the specified property type is a dictionary.
public static IsDictionaryType ( Type propertyType ) : bool
propertyType System.Type Type of the property.
return bool

IsPrimitive() public static method

Determines whether the specified property type is primitive.
public static IsPrimitive ( Type propertyType ) : bool
propertyType System.Type Type of the property.
return bool

ReadDefaultValueFromAttribute() public static method

Reads the default value from the attribute.
public static ReadDefaultValueFromAttribute ( PropertyInfo propertyInfo ) : object
propertyInfo System.Reflection.PropertyInfo The property information.
return object

ShouldGenerateMember() public static method

Determines whether the property should be generated in the Js model.
public static ShouldGenerateMember ( PropertyInfo propertyInfo, Castle.Sharp2Js.JsGeneratorOptions generatorOptions ) : bool
propertyInfo System.Reflection.PropertyInfo The property information.
generatorOptions Castle.Sharp2Js.JsGeneratorOptions The generator options.
return bool

ToCamelCase() public static method

Camel cases an input string.
public static ToCamelCase ( string input, bool camelCase ) : string
input string The string.
camelCase bool if set to true [camel case].
return string