/// <summary> /// Used to output a custom pattern string with options. The percent symbol and option braces /// should not be included in these strings. /// </summary> /// <typeparam name="T">A <see cref="PatternConverter"/> to register for this pattern.</typeparam> /// <param name="name">The name of the pattern.</param> /// <param name="options">Any options to supply for the pattern.</param> /// <returns>A <see cref="PatternLayoutDefinitionModifier"/> instance allowing formatting /// to be configured for this token.</returns> public PatternLayoutDefinitionModifier Custom <T>(string name, string options) where T : PatternConverter { _customConverter = new PatternLayout.ConverterInfo { Name = name, Type = typeof(T) }; return(Format(name + "{" + options + "}")); }
/// <summary> /// Add a converter to this PatternLayout /// </summary> /// <param name="converterInfo">the converter info</param> /// <remarks> /// <para> /// This version of the method is used by the configurator. /// Programmatic users should use the alternative <see cref="M:log4net.Layout.PatternLayout.AddConverter(System.String,System.Type)" /> method. /// </para> /// </remarks> public void AddConverter(PatternLayout.ConverterInfo converterInfo) { this.AddConverter(converterInfo.Name, converterInfo.Type); }