C# Класс 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.
Наследование: IFormatProvider, ICustomFormatter, ICloneable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AppendFriendlyTypeName bool
AppendInstanceTypeName bool
DecIndentationLevel void
Format bool
Format void
FormatLinePrefix bool
GetCurrentLineLength int
GetInstanceTypeName string
IncIndentationLevel void
IsFormatApplicable bool
IsIndentationLevelOccupied bool

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

Clone() публичный абстрактный Метод

Implement in derived classes to perform deep copying of the current object.
public abstract Clone ( ) : object
Результат object

CombineMaximumFormattedLength() публичный Метод

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. ///
Результат int

Format() публичный Метод

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.
Результат string

Format() публичный Метод

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.
Результат string

GetFormat() публичный Метод

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.
Результат object

GetInstanceType() защищенный Метод

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.
Результат System.Type

PopCurrentObject() защищенный Метод

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
Результат void

PushCurrentObject() защищенный Метод

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.
Результат bool

ToString() публичный Метод

Converts current instance to user friendly string using simple formatter to format the string.
public ToString ( ) : string
Результат string

VerboseFormatInfoBase() публичный Метод

Default constructor.
public VerboseFormatInfoBase ( ) : System
Результат System

VerboseFormatInfoBase() публичный Метод

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.
Результат System