C# Class Gu.Wpf.PropertyGrid.FormatString

Optimized this a lot to avoid caching of results.
Afficher le fichier Open project: JohanLarsson/Gu.Wpf.PropertyGrid Class Usage Examples

Méthodes publiques

Méthode Description
IsFormatString ( string format ) : bool

Checks if format has argument placeholders like 'Value: {0}'

IsValidFormatString ( string format, int numberOfArguments ) : bool

Check if format is a valid format string for numberOfArguments

Private Methods

Méthode Description
IsValidFormat ( string format, int &indexCount, bool &anyItemHasFormat ) : bool

Check a format string for errors and other properties. Does not throw nor allocate no need to cache the result as it is about as fast as a dictionary lookup for common strings.

Slice ( this text, int start, int end ) : string
TryParseFormatSuffix ( string text, int &pos, bool &itemHasFormat ) : bool
TryParseFormatSuffix ( string text, int &pos, string &result ) : bool
TryParseItemFormat ( string text, int &pos, int &index, bool &itemHasFormat ) : bool
TryParseItemFormat ( string text, int &pos, int &index, string &format ) : bool
TryParseUnsignedInt ( string text, int &pos, int &result ) : bool
TrySkipEscaped ( string text, char c, int &pos ) : bool
TrySkipTo ( string text, char c1, char c2, int &pos ) : bool
TrySkipTo ( string text, char c, int &pos ) : bool

Method Details

IsFormatString() public static méthode

Checks if format has argument placeholders like 'Value: {0}'
public static IsFormatString ( string format ) : bool
format string A format string.
Résultat bool

IsValidFormatString() public static méthode

Check if format is a valid format string for numberOfArguments
public static IsValidFormatString ( string format, int numberOfArguments ) : bool
format string The format string.
numberOfArguments int The number of format arguments.
Résultat bool