Example #1
0
 /// <summary>
 /// Registers a formatter for the the TsClass type.
 /// </summary>
 /// <param name="formatter">The formatter to register</param>
 /// <returns>Instance of the TypeScriptFluent that enables fluent configuration.</returns>
 public TypeScriptFluent WithTypeFormatter(TsTypeFormatter formatter)
 {
     _scriptGenerator.RegisterTypeFormatter(formatter);
     return(this);
 }
Example #2
0
 /// <summary>
 /// Registers a formatter for the specific type
 /// </summary>
 /// <typeparam name="TFor">The type to register the formatter for. TFor is restricted to TsType and derived classes.</typeparam>
 /// <param name="formatter">The formatter to register</param>
 /// <returns>Instance of the TypeScriptFluent that enables fluent configuration.</returns>
 public TypeScriptFluent WithTypeFormatter <TFor>(TsTypeFormatter formatter) where TFor : TsType
 {
     _scriptGenerator.RegisterTypeFormatter <TFor>(formatter);
     return(this);
 }
Example #3
0
 public TypeScriptFluent WithFormatter(TsTypeFormatter formatter)
 {
     return(WithTypeFormatter(formatter));
 }
 /// <summary>
 /// Registers the formatter for the specific TsType
 /// </summary>
 /// <typeparam name="TFor">The type to register the formatter for. TFor is restricted to TsType and derived classes.</typeparam>
 /// <param name="formatter">The formatter to register</param>
 public void RegisterTypeFormatter<TFor>(TsTypeFormatter formatter) where TFor : TsType
 {
     _formatters[typeof(TFor)] = formatter;
 }
Example #5
0
 public TypeScriptFluent WithFormatter <TFor>(TsTypeFormatter formatter) where TFor : TsType
 {
     return(WithTypeFormatter <TFor>(formatter));
 }
Example #6
0
 /// <summary>
 /// Registers the custom formatter for the TsClass type.
 /// </summary>
 /// <param name="formatter">The formatter to register.</param>
 public void RegisterTypeFormatter(TsTypeFormatter formatter)
 {
     _typeFormatters.RegisterTypeFormatter <TsClass>(formatter);
 }
Example #7
0
 /// <summary>
 /// Registers the formatter for the specific TsType
 /// </summary>
 /// <typeparam name="TFor">The type to register the formatter for. TFor is restricted to TsType and derived classes.</typeparam>
 /// <param name="formatter">The formatter to register</param>
 /// <remarks>
 /// If a formatter for the type is already registered, it is overwritten with the new value.
 /// </remarks>
 public void RegisterTypeFormatter <TFor>(TsTypeFormatter formatter) where TFor : TsType
 {
     _typeFormatters.RegisterTypeFormatter <TFor>(formatter);
 }
Example #8
0
 /// <summary>
 /// Registers a formatter for the the <see cref="TsClass"/> type.
 /// </summary>
 /// <param name="formatter">The formatter to register</param>
 /// <returns>Instance of the TypeScriptFluent that enables fluent configuration.</returns>
 public DefinitionOptionsBuilder WithTypeFormatter(TsTypeFormatter formatter)
 {
     Generator.Options.TypeFormatters.RegisterTypeFormatter <TsClass>(formatter);
     return(this);
 }
Example #9
0
 /// <summary>
 /// Registers a formatter for the specific type
 /// </summary>
 /// <typeparam name="TFor">The type to register the formatter for. TFor is restricted to TsType and derived classes.</typeparam>
 /// <param name="formatter">The formatter to register</param>
 public DefinitionOptionsBuilder WithTypeFormatter <TFor>(TsTypeFormatter formatter) where TFor : TsType
 {
     Generator.Options.TypeFormatters.RegisterTypeFormatter <TFor>(formatter);
     return(this);
 }
 /// <summary>
 /// Registers the formatter for the specific TsType
 /// </summary>
 /// <typeparam name="TFor">The type to register the formatter for. TFor is restricted to TsType and derived classes.</typeparam>
 /// <param name="formatters"></param>
 /// <param name="formatter">The formatter to register</param>
 public static void RegisterTypeFormatter <TFor>(this Dictionary <Type, TsTypeFormatter> formatters, TsTypeFormatter formatter)
 {
     formatters[typeof(TFor)] = formatter;
 }