C# Class HFMCmd.OutputHelper

Helper class providing convenience methods that can be used with any IOutput implementations to ease output of common cases, such as: - a blank line - a single line with no field information - a single record with a single field - a line per object in an IEnumerable
Afficher le fichier Open project: agardiner/hfmcmd

Méthodes publiques

Свойство Type Description
LINEBREAKS char[]
WHITESPACE char[]
WORDBREAKS char[]
_log log4net.ILog

Méthodes publiques

Méthode Description
End ( this output ) : void

Convenience for the common case of not suppressing footer record

GetFieldNamesAndWidths ( object fields, int &widths ) : string[]

Converts the object[] passed to SetHeader into field names and widths. The field names are returned as a string[], while the field widths are returned in an out int[].

InitProgress ( this output, string operation ) : void

Helper method for initiating an operation whose progress will be monitored. Provides defaults for iteration (1) and total (100).

InitProgress ( this output, string operation, int iterations ) : void

Helper method for initiating an operation whose progress will be monitored. Provides default for total (100).

ShouldCancel ( ) : bool

Method that can be used by IOutput implementations to determine the appropriate value to send for the cancel return value in a call to SetProgress.

WrapText ( object value, int width ) : List

Method for wrapping text to a certain width.

WriteEnumerable ( this output, IEnumerable enumerable ) : void

Eases use of the IOutput interface for cases where we want to output a collection of records with a single column.

WriteLine ( this output ) : void

Eases use of the IOutput interface for cases where we just want to output a blank line.

WriteSingleRecord ( this output ) : void

Eases use of the IOutput interface for cases where we just want to output a single record with multiple fields.

WriteSingleValue ( this output, object value ) : void

Eases use of the IOutput interface for cases where we just want to output a single record with a single field.

Method Details

End() public static méthode

Convenience for the common case of not suppressing footer record
public static End ( this output ) : void
output this
Résultat void

GetFieldNamesAndWidths() public static méthode

Converts the object[] passed to SetHeader into field names and widths. The field names are returned as a string[], while the field widths are returned in an out int[].
public static GetFieldNamesAndWidths ( object fields, int &widths ) : string[]
fields object
widths int
Résultat string[]

InitProgress() public static méthode

Helper method for initiating an operation whose progress will be monitored. Provides defaults for iteration (1) and total (100).
public static InitProgress ( this output, string operation ) : void
output this
operation string
Résultat void

InitProgress() public static méthode

Helper method for initiating an operation whose progress will be monitored. Provides default for total (100).
public static InitProgress ( this output, string operation, int iterations ) : void
output this
operation string
iterations int
Résultat void

ShouldCancel() public static méthode

Method that can be used by IOutput implementations to determine the appropriate value to send for the cancel return value in a call to SetProgress.
public static ShouldCancel ( ) : bool
Résultat bool

WrapText() public static méthode

Method for wrapping text to a certain width.
public static WrapText ( object value, int width ) : List
value object
width int
Résultat List

WriteEnumerable() public static méthode

Eases use of the IOutput interface for cases where we want to output a collection of records with a single column.
public static WriteEnumerable ( this output, IEnumerable enumerable ) : void
output this
enumerable IEnumerable
Résultat void

WriteLine() public static méthode

Eases use of the IOutput interface for cases where we just want to output a blank line.
public static WriteLine ( this output ) : void
output this
Résultat void

WriteSingleRecord() public static méthode

Eases use of the IOutput interface for cases where we just want to output a single record with multiple fields.
public static WriteSingleRecord ( this output ) : void
output this
Résultat void

WriteSingleValue() public static méthode

Eases use of the IOutput interface for cases where we just want to output a single record with a single field.
public static WriteSingleValue ( this output, object value ) : void
output this
value object
Résultat void

Property Details

LINEBREAKS public_oe static_oe property

public static char[] LINEBREAKS
Résultat char[]

WHITESPACE public_oe static_oe property

public static char[] WHITESPACE
Résultat char[]

WORDBREAKS public_oe static_oe property

public static char[] WORDBREAKS
Résultat char[]

_log public_oe static_oe property

public static ILog,log4net _log
Résultat log4net.ILog