Свойство | Type | Description | |
---|---|---|---|
DefaultMaxFormattedLength | int | ||
DefaultMaximumDepth | int | ||
DefaultNullFormatted | string | ||
InfiniteLoopReport | string |
Méthode | Description | |
---|---|---|
BestTryFormat ( StringBuilder sb, string format, object arg, IEnumerable |
Attempts to format string which represents given object using series of verbose format providers. Operation ends in success when the first available format provider successfully formats the string. Operation ends in failure if none of the format providers is able to successfully format the string. Use this method to implement two-pass formatting, where in first pass single-lined formatting is attempted with restricted destination string length and in second pass multi-lined formatting without length restrictions is performed.
|
|
CombineMaxFormattedLengths ( int length1, int length2 ) : int |
Combines two values of the maximum allowed formatted string length.
|
|
CopyFormatting ( |
Copies formatting-related property values from one verbose formatter to another one. Use this method to change active formatter so that it formats string in the way in which other formatter would do, but preserving other settings, like indentation details, maximum depth when recursively iterating through contents of the object etc.
|
|
CreateMultiLinedFormatter ( ) : |
Creates new instance of verbose formatter which can be applied to format multi-lined string without any decorations. This format is applicable to objets of medium complexity. Indentation is performed using multiple whitespace characters.
|
|
CreateSimpleFormatter ( ) : |
Creates new instance of verbose formatter which can be applied to format simplest possible strings. Only the first level of depth is presented in the formatted string and format is single-lined. This format is applicable to objects of unpredictable complexity, which should be presented by strings of limited length.
|
|
CreateSingleLinedFormatter ( ) : |
Creates new instance of verbose formatter which formats single-lined strings.
|
|
CreateTabbedMultiLinedFormatter ( ) : |
Creates new instance of verbose formatter which can be applied to format multi-lined strings without any decorations. This format is applicable to objects of medium complexity. Indentation is performed using horizontal tab characters.
|
|
CreateTreeMultiLinedFromatter ( ) : |
Creates new instance of verbose formatter which can be applied to format multi-lined string which is decorated as to resemble the look of a tree structure. This format is applicable to complex objects.
|
|
ReportInfiniteLoop ( StringBuilder sb, object arg, string argName, int &maxLength ) : bool |
Appends information that specified argument produces infinite loop to the given string builder.
|
|
TryAppendChar ( |
Tries to append character to the string builder within given amount of characters allowed. Always succeeds in multi-lined formatters.
|
|
TryAppendSpaceIfNeeded ( |
Tries to append single white space if string builder doesn't end with space or new line character. Use this method to separate successive items appended to string builder.
|
|
TryAppendString ( |
Tries to append string to the string builder within given amount of characters allowed. Always succeeds in multi-lined formatters.
|
public static BestTryFormat ( StringBuilder sb, string format, object arg, IEnumerable |
||
sb | StringBuilder | String builder to which formatted string is appended. |
format | string | Format string containing formatting specifications. |
arg | object | An object to format. |
formatProviders | IEnumerable |
/// Series of format providers which are contacted one at a time until the first performs /// formatting successfully. /// |
maxLength | int | /// Maximum number of characters allowed to the formatter. Formatting will fail (and return false) /// if this number of characters is breached. Multi-lined formatters will ignore this parameter. /// Negative value indicates that formatter has unlimited space available. /// On output contains remaining number of characters available. /// |
Résultat | bool |
public static CombineMaxFormattedLengths ( int length1, int length2 ) : int | ||
length1 | int | First maximum formatted string length; negative value indicates infinite allowed length. |
length2 | int | Second maximum formatted string length; negative value indicates infinite allowed length. |
Résultat | int |
public static CopyFormatting ( |
||
src | Formatter from which formatting property values are copied. | |
dest | Formatter into which formatting property values are copied. | |
Résultat |
public static CreateMultiLinedFormatter ( ) : |
||
Résultat |
public static CreateSimpleFormatter ( ) : |
||
Résultat |
public static CreateSingleLinedFormatter ( ) : |
||
Résultat |
public static CreateTabbedMultiLinedFormatter ( ) : |
||
Résultat |
public static CreateTreeMultiLinedFromatter ( ) : |
||
Résultat |
public static ReportInfiniteLoop ( StringBuilder sb, object arg, string argName, int &maxLength ) : bool | ||
sb | StringBuilder | String builder to which information about the argument is appended. |
arg | object |
/// Value which has already been appended to |
argName | string | Optional name of the instance which is reported, if available. |
maxLength | int | /// Maximum number of characters allowed to the formatter. Formatting will fail (and return false) /// if this number of characters is breached. Multi-lined formatters will ignore this parameter. /// Negative value indicates that formatter has unlimited space available. On output contains remaining number of characters available. /// |
Résultat | bool |
public static TryAppendChar ( |
||
formatter | Formatter which has requested character to be appended. | |
sb | StringBuilder | String builder to which string should be appended. |
c | char | Character which should be appended. |
success | bool | /// Indicates whether appending operations this far have been successful (true) /// or some of the previous append operations has already failed (false). If false, appending will not be attempted. /// |
maxLength | int | /// On input contains maximum number of characters that are allowed to be appended to the string builder. /// On output indicates remaining character positions allowed before appending will fail. /// |
Résultat | bool |
public static TryAppendSpaceIfNeeded ( |
||
formatter | Formatter which has requested character to be appended. | |
sb | StringBuilder | String builder to which whitespace is appended. |
success | bool | /// Indicates whether appending operations this far have been successful (true) /// or some of the previous append operations has already failed (false). If false, appending will not be attempted. /// |
maxLength | int | /// Maximum number of characters allowed to the formatter. Formatting will fail (and return false) /// if this number of characters is breached. Multi-lined formatters will ignore this parameter. /// Negative value indicates that formatter has unlimited space available. On output contains remaining number of characters available. /// |
Résultat | bool |
public static TryAppendString ( |
||
formatter | Formatter which has requested character to be appended. | |
sb | StringBuilder | String builder to which string should be appended. |
s | string | String which should be appended. |
success | bool | /// Indicates whether appending operations this far have been successful (true) /// or some of the previous append operations has already failed (false). If false, appending will not be attempted. /// |
maxLength | int | /// On input contains maximum number of characters that are allowed to be appended to the string builder. /// On output indicates remaining character positions allowed before appending will fail. /// |
Résultat | bool |
public static int DefaultMaxFormattedLength | ||
Résultat | int |
public static string DefaultNullFormatted | ||
Résultat | string |