/// <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); }
/// <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); }
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; }
public TypeScriptFluent WithFormatter <TFor>(TsTypeFormatter formatter) where TFor : TsType { return(WithTypeFormatter <TFor>(formatter)); }
/// <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); }
/// <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); }
/// <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); }
/// <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; }