C# Class Gammtek.Conduit.Text.Formatting.VerboseFormatInfoBase

Base class for all verbose format providers. Implements basic functionality and defines mandatory members that would be overridden or implemented by derived classes in order to provide specific functionality applicable to format strings representing instances of particular data types.
Inheritance: IFormatProvider, ICustomFormatter, ICloneable
Afficher le fichier Open project: ME3Explorer/ME3Explorer Class Usage Examples

Private Properties

Свойство Type Description
AppendFriendlyTypeName bool
AppendInstanceTypeName bool
DecIndentationLevel void
Format bool
Format void
FormatLinePrefix bool
GetCurrentLineLength int
GetInstanceTypeName string
IncIndentationLevel void
IsFormatApplicable bool
IsIndentationLevelOccupied bool

Méthodes publiques

Méthode Description
Clone ( ) : object

Implement in derived classes to perform deep copying of the current object.

CombineMaximumFormattedLength ( int length ) : int

Combines maximum formatted string length from this instance with given length and sets new maximum length for this instance.

Format ( object arg ) : string

Converts the value of a specified object to an equivalent string representation using default format and culture-specific formatting information.

Format ( string format, object arg, IFormatProvider formatProvider ) : string

Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information.

GetFormat ( Type formatType ) : object

Returns an object that provides formatting services for the specified type.

ToString ( ) : string

Converts current instance to user friendly string using simple formatter to format the string.

VerboseFormatInfoBase ( ) : System

Default constructor.

VerboseFormatInfoBase ( VerboseFormatInfoBase other ) : System

Copy constructor. Used to build format providers that share common property values with some existing instance.

Méthodes protégées

Méthode Description
GetInstanceType ( object instance ) : Type

Gets type of the given instance if available either from the instance itself or from this format provider.

PopCurrentObject ( ) : void

Pops object from the visited instances stack. Each call to this method must be matched by a single call to PushCurrentInstance method which returned true.

PushCurrentObject ( object obj ) : bool

Checks whether specified object is already present in the stack containing visited instances and, if it is not, pushes the object to the stack. Otherwise method fails and signals the caller that specified object has already been visited in current line of references.

Private Methods

Méthode Description
AppendFriendlyTypeName ( Type type, object instance, StringBuilder sb, int &maxLength ) : bool

Formats user friendly representation of the name of the given type. Override in derived classes to implement specific friendly names for known types handled by derived classes. Make sure that overridden implementations call base class implementation in case that they cannot resolve type name.

AppendInstanceTypeName ( object instance, StringBuilder sb, int &maxLength ) : bool

Appends user friendly name of the type of the given instance if available either from the instance itself or from this format provider.

DecIndentationLevel ( ) : void

Reduces indentation level by one.

Format ( StringBuilder sb, string format, object arg, IFormatProvider formatProvider, int &maxLength ) : bool

Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information.

Format ( StringBuilder sb, string format, object arg, IFormatProvider formatProvider ) : void

Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information.

FormatLinePrefix ( StringBuilder sb, bool firstValueFollows, bool lastValueFollows, bool skipRightMostIndentationString, int padLineToLength, int &maxLength ) : bool

Appends all fields that should be placed before next contained value is appended to the output. In single-lined formats that will only be the field delimiter. In multi-lined formats that may include indentation strings.

GetCurrentLineLength ( StringBuilder sb ) : int

Gets length of the last line in the given string builder. Use this method to pad lines depending on required length.

GetInstanceTypeName ( object instance ) : string

Gets user friendly name of the type of the instance if available either from the instance itself or from this format provider.

IncIndentationLevel ( bool moreItemsToFollow ) : void

Increases indentation level by one.

IsFormatApplicable ( Type dataType ) : bool

Gets value indicating whether current format provider is applicable to format strings that represent instances of given data type. Override in derived classes to return appropriate value.

IsIndentationLevelOccupied ( int level ) : bool

Gets value indicating whether at specified indentation level there are more items to follow or last printed item on that indentation level is overall last item on that indentation level.

Method Details

Clone() public abstract méthode

Implement in derived classes to perform deep copying of the current object.
public abstract Clone ( ) : object
Résultat object

CombineMaximumFormattedLength() public méthode

Combines maximum formatted string length from this instance with given length and sets new maximum length for this instance.
public CombineMaximumFormattedLength ( int length ) : int
length int /// Length with which maximum allowed length of the string created by this formatter is combined; /// negative value indicates infinite allowed length. ///
Résultat int

Format() public méthode

Converts the value of a specified object to an equivalent string representation using default format and culture-specific formatting information.
public Format ( object arg ) : string
arg object An object to format.
Résultat string

Format() public méthode

Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information.
public Format ( string format, object arg, IFormatProvider formatProvider ) : string
format string A format string containing formatting specifications.
arg object An object to format.
formatProvider IFormatProvider An object that supplies format information about the current instance.
Résultat string

GetFormat() public méthode

Returns an object that provides formatting services for the specified type.
public GetFormat ( Type formatType ) : object
formatType System.Type An object that specifies the type of format object to return.
Résultat object

GetInstanceType() protected méthode

Gets type of the given instance if available either from the instance itself or from this format provider.
protected GetInstanceType ( object instance ) : Type
instance object Instance for which data type is determined.
Résultat System.Type

PopCurrentObject() protected méthode

Pops object from the visited instances stack. Each call to this method must be matched by a single call to PushCurrentInstance method which returned true.
protected PopCurrentObject ( ) : void
Résultat void

PushCurrentObject() protected méthode

Checks whether specified object is already present in the stack containing visited instances and, if it is not, pushes the object to the stack. Otherwise method fails and signals the caller that specified object has already been visited in current line of references.
protected PushCurrentObject ( object obj ) : bool
obj object Object which is currently being processed.
Résultat bool

ToString() public méthode

Converts current instance to user friendly string using simple formatter to format the string.
public ToString ( ) : string
Résultat string

VerboseFormatInfoBase() public méthode

Default constructor.
public VerboseFormatInfoBase ( ) : System
Résultat System

VerboseFormatInfoBase() public méthode

Copy constructor. Used to build format providers that share common property values with some existing instance.
public VerboseFormatInfoBase ( VerboseFormatInfoBase other ) : System
other VerboseFormatInfoBase Instance from which common property values will be copied.
Résultat System