IGLib  1.5
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
IG.Lib.IReporterTextWriter Interface Reference

Reporters that utilize writing messages to files. Messages are typically formatted as multi-line messages with distinctive markup. For one-line possibly indented messages, IReporterTextLogger should be used. More...

+ Inheritance diagram for IG.Lib.IReporterTextWriter:
+ Collaboration diagram for IG.Lib.IReporterTextWriter:

Public Member Functions

bool SetTextWriter (TextWriter writer)
 Sets the text writer to which reporting is also performed. More...
 
bool SetTextWriter (TextWriter writer, bool writeintro)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. More...
 
bool SetTextWriter (TextWriter writer, bool writeintro, bool disposewriter)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. More...
 
bool SetTextWriter (Stream stream)
 Creates a TextWriter upon the stream and sets it as the text writer to which reporting is also performed. More...
 
bool SetTextWriter (Stream stream, bool writeintro)
 Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument. More...
 
bool SetTextWriter (Stream stream, bool writeintro, bool disposewriter)
 Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument. More...
 
bool SetTextWriter (string filename)
 Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed. The file is overwritten. More...
 
bool SetTextWriter (string filename, bool append)
 Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed, where the caller specifies either to overwrite the file or to append to it. More...
 
bool SetTextWriter (string filename, bool append, bool writeintro)
 Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. More...
 
bool SetTextWriter (string filename, bool append, bool writeintro, bool disposewriter)
 Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. More...
 
bool AddTextWriter (TextWriter writer)
 Sets the text writer to which reporting is also performed. More...
 
bool AddTextWriter (TextWriter writer, bool writeintro)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. More...
 
bool AddTextWriter (TextWriter writer, bool writeintro, bool disposewriter)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. More...
 
bool AddTextWriter (Stream stream)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. More...
 
bool AddTextWriter (Stream stream, bool writeintro)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument. More...
 
bool AddTextWriter (Stream stream, bool writeintro, bool disposewriter)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument. More...
 
bool AddTextWriter (string filename)
 Creates a TextWriter from the file name and adds it to the list of TextWriters on which reporting is also performed. The file is overwritten. More...
 
bool AddTextWriter (string filename, bool append)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies either to overwrite the file or to append to it. More...
 
bool AddTextWriter (string filename, bool append, bool writeintro)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. More...
 
bool AddTextWriter (string filename, bool append, bool writeintro, bool disposewriter)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. More...
 
bool RemoveTextWriters ()
 Removes all text writers from the TextWriter subsystem. If appropriate, the corresponding text writer is closed. More...
 
bool RemoveTextWriter ()
 Removes the default text writer from the TextWriter subsystem. If appropriate, the corresponding text writer is closed. More...
 
bool RemoveTextWriter (TextWriter writer)
 Removes the first object from Writers that contains the specified TextWriter. If appropriate, the corresponding text writer is closed. More...
 
bool RemoveTextWriter (Stream stream)
 Removes the first object from Writers whose TextWriter has been created form the specified stream. If appropriate, the corresponding text writer is closed. More...
 
bool RemoveTextWriter (string filename)
 Removes the first object from Writers whose TextWriter has been created form the file with the specified name. If appropriate, the corresponding text writer is closed. More...
 
List< TextWriter > TextWriterWriters ()
 Returns a list of all text writers that are currently used by the reporter's text writer. Only text writers that are actually writable are included. More...
 
List< TextWriter > TextWriterWriters (bool writableonly)
 Returns a list of all text writers that are currently used by the reporter's text writer. Warning: Beware of thread safety issues! Blocks of code where the returned list is used should be enclosed in lock(reporter.lockobj){...} block (where reporter is the object through which this method was called). More...
 
int TextWriterNumWriters ()
 Returns the current number of text writers used by the reporter's text logging module. Only text writers that are actually writable are counted. More...
 
int TextWriterNumWriters (bool writableonly)
 Returns the current number of TextWriters used by the reporter's text logging module. More...
 
int TextWriterFlush ()
 Flushes all text writers of the Writer's TextWriter subsystem. More...
 
int TextWriterWrite (string str)
 Writes a string to all text writers of the Writer's TextWriter subsystem. More...
 
int TextWriterWriteLine (string str)
 Similar to TextWriterWrite(), except that a newline is added at the end of the string. More...
 
- Public Member Functions inherited from IG.Lib.IReporterBase
void Init ()
 Initializes all error reporting delegates to default values and sets auxliary object to null. Auxiliary object Obj is set to null. More...
 
void Init (object obj, ReportDelegate reportdelegate, ReportLocationDelegate locationdelegate, ReportMessageDelegate messagedelegate, ReserveReportErrorDelegate reservereportdelegate)
 Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates that are not specified are set to default values. More...
 
void Init (object obj, ReportDelegate reportdelegate, ReportLocationDelegate locationdelegate, ReportMessageDelegate messagedelegate)
 Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates that are not specified are set to default values. More...
 
void Init (object obj, ReportDelegate reportdelegate)
 Initializes the error reporter by the specified auxiliary object and the delegate to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates for assembling the error location string and error message string are set to their default values, which are adapted to console-like eror reporting systems. More...
 
void Init (object obj, ReportDelegate reportdelegate, ReserveReportErrorDelegate reservereportdelegate)
 Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates for assembling the error locatin and error message string are set to their default values, which are adapted to console-like eror reporting systems. More...
 
void ReadAppSettings (string groupname)
 Reads settings for a specified named group of reporters from the application configuration file. More...
 
void ReadAppSettings ()
 Reads common reporter settings (i.e. settings that are not assigned for any named group) from the application configuration file. More...
 
void ReadAppSettings (string groupname, bool onlyonce)
 Reads settings for a specified named group of reporters from the application configuration file. More...
 
bool AppSettingsRead ()
 Returns a flag that tells whether general configuration settings (not belonging to any group) have already been read for this reporter. More...
 
bool AppSettingsRead (string groupname)
 Returns a flag that tells whether configuration settings with a given group name have already been read for this reporter. More...
 
void IncreaseDepth ()
 Increases indentation level by 1. More...
 
void IncreaseDepth (int numlevels)
 Increases indentation level by the specified number of levels (can be 0 or negative). More...
 
void DecreaseDepth ()
 Decreases indentation level by 1. More...
 
void DecreaseDepth (int numlevels)
 Decreases indentation level by the specified number of levels (can be 0 or negative). More...
 
void ResetLevels ()
 Resets the various kinds of reporting levels to default values. More...
 
bool DoReporting (ReportType reptype)
 Returns true if the report of a given type should be shown by user interface (according to ReportingLevel), and false if not. More...
 
bool DoLogging (ReportType reptype)
 Returns true if the report of a given type should be logged in log files (according to ReportingLevel), and false if not. More...
 
bool DoTracing (ReportType reptype)
 Returns true if the report of a given type should traced (according to ReportingLevel), and false if not. More...
 
void Report (ReportType messagetype, string location, string message, Exception ex)
 Basic reporting method (overloaded). Launches an error report, a warning report or other kind of report/message. Supplemental data (such as objects necessary to launch visualize the report or operation flags) are obtained from the class' instance. More...
 
void Report (ReportType messagetype, string message, Exception ex)
 Launches a report. Predominantly for error and warning reports. More...
 
void Report (ReportType messagetype, Exception ex, string location)
 Launches a report. Predominantly for error and warning reports. More...
 
void Report (ReportType messagetype, Exception ex)
 Launches a report. Predominantly for error and warning reports. More...
 
void Report (ReportType messagetype, string location, string message)
 Launches a report. More...
 
void Report (ReportType messagetype, string message)
 Launches a report. More...
 
void ReportError (string location, string message, Exception ex)
 Basic error reporting method (overloaded). Supplemental data (such as objects necessary to launch visualize the report or operation flags) are obtained from the class' instance. More...
 
void ReportError (string message, Exception ex)
 Launches an error report. More...
 
void ReportError (Exception ex, string location)
 Launches an error report. More...
 
void ReportError (Exception ex)
 Launches an error report. Predominantly for error and warning reports. More...
 
void ReportError (string location, string message)
 Launches an error report. More...
 
void ReportError (string message)
 Launches an error report. More...
 
void ReportWarning (string location, string message, Exception ex)
 Basic warning reporting method (overloaded). Supplemental data (such as objects necessary to launch visualize the report or operation flags) are obtained from the class' instance. More...
 
void ReportWarning (string message, Exception ex)
 Launches a warning report. More...
 
void ReportWarning (Exception ex, string location)
 Launches a warning report. More...
 
void ReportWarning (Exception ex)
 Launches a warning report. Predominantly for error and warning reports. More...
 
void ReportWarning (string location, string message)
 Launches a warning report. More...
 
void ReportWarning (string message)
 Launches a warning report. More...
 
void ReportInfo (Exception ex)
 Launches an info. More...
 
void ReportInfo (string location, string message)
 Launches an info. More...
 
void ReportInfo (string message)
 Launches an info. More...
 

Properties

bool UseTextWriter [get, set]
 Specifies whether or not TextWriter(s) are used by the Reporter to log messages. More...
 
string TextWriterIntroText [get, set]
 Gets or sets the introduction string that is written before logging to a TextWriter begins. If this is not specified then the reporter composes its own introduction string, eventually using programname (when defined). More...
 
string TextWriterProgramName [get, set]
 String denoting the name of the program or other entity that uses the Reporter for logging. When introtext is not specified, this name is used in the introduction text composed by the reporter. More...
 
bool TextWriterWriteIntro [get, set]
 Specifies whether introduction text is written before logging of messages begins or not. More...
 
- Properties inherited from IG.Lib.IReporterBase
bool AppSettingsWarnings [get, set]
 Gets or sets the flag that specifies whether a warning message is launched when reading of application settings is attempted more than once for the same named group of settings. More...
 
bool IsGlobal [get]
 Indicates whether the current reporter is used as a global reporter or not. More...
 
int Depth [get, set]
 Gets or sets the current indentation level for on-line output. This should normally be done by calling IncreaseDepth() or DecreaseDepth(). More...
 
ReportLevel ReportingLevel [get, set]
 Gets or sets level of output for reporting (console output, message boxes, etc.). More...
 
ReportLevel LoggingLevel [get, set]
 Gets or sets level of output for logging (writing to log files). More...
 
ReportLevel TracingLevel [get, set]
 Gets or sets trace level (for external trace systems). More...
 
bool TreatError [get]
 Returns a boolean value indicating whether errors are treated by the reporter in its current state. More...
 
bool TreatWarning [get]
 Returns a boolean value indicating whether warnings are treated by the reporter in its current state. More...
 
bool TreatInfo [get]
 Returns a boolean value indicating whether info messages are treated by the reporter in its current state. More...
 
bool TreatUndefined [get]
 Returns a boolean value indicating whether undefined messages with the lowest priority are treated by the reporter in its current state. More...
 
ReportLevel Level [get, set]
 Gets the level with the lowesst priority (out of reporting, logging and tracing level), or sets all levels to the assigned level. More...
 
bool this[ReportLevel level] [get, set]
 Indexer that returns true if messages of a given level are treated by the reporter (either by the reporting, logging or tracing part, according to the corresponding level states), or false if not (i.e. if all the levels are set lover than the index). In the case of assignment, when true is assigned, all levels that are set lower than the are set to index. Assignment with false should be used only exteptionally; but in this case all levels that are set higher or equal than the index are set one level below. More...
 
TraceSwitch ReportingSwitch [get, set]
 Gets or sets the TraceSwitch that is synchronized with ReportingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the ReportingLevel, which will override its settings). More...
 
TraceSwitch LoggingSwitch [get, set]
 Gets or sets the TraceSwitch that is synchronized with LoggingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the LoggingLevel, which will override its settings). More...
 
TraceSwitch TracingSwitch [get, set]
 Gets or sets the TraceSwitch that is synchronized with TracingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the TracingLevel, which will override its settings). More...
 
object Obj [get, set]
 Auxiliary object used by the delegates that perform error reporting. More...
 
object lockobj [get]
 Object used for locking. More...
 

Detailed Description

Reporters that utilize writing messages to files. Messages are typically formatted as multi-line messages with distinctive markup. For one-line possibly indented messages, IReporterTextLogger should be used.

Member Function Documentation

bool IG.Lib.IReporterTextWriter.SetTextWriter ( TextWriter  writer)

Sets the text writer to which reporting is also performed.

Parameters
writerTextwriter to which reporting will be performed.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

Referenced by IG.Forms.ReporterConf.ApplyGuiSettings().

bool IG.Lib.IReporterTextWriter.SetTextWriter ( TextWriter  writer,
bool  writeintro 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( TextWriter  writer,
bool  writeintro,
bool  disposewriter 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a textwriter.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( Stream  stream)

Creates a TextWriter upon the stream and sets it as the text writer to which reporting is also performed.

Parameters
writerStream to which reporting will be performed.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( Stream  stream,
bool  writeintro 
)

Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( Stream  stream,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a stream.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( string  filename)

Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed. The file is overwritten.

Parameters
filenameName of the file to which reporting will be performed.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( string  filename,
bool  append 
)

Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed, where the caller specifies either to overwrite the file or to append to it.

Parameters
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( string  filename,
bool  append,
bool  writeintro 
)

Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.SetTextWriter ( string  filename,
bool  append,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is true when specifying a file name.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( TextWriter  writer)

Sets the text writer to which reporting is also performed.

Parameters
writerTextwriter to which reporting will be performed.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( TextWriter  writer,
bool  writeintro 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( TextWriter  writer,
bool  writeintro,
bool  disposewriter 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a textwriter.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( Stream  stream)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed.

Parameters
writerStream to which reporting will be performed.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( Stream  stream,
bool  writeintro 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( Stream  stream,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a stream.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( string  filename)

Creates a TextWriter from the file name and adds it to the list of TextWriters on which reporting is also performed. The file is overwritten.

Parameters
filenameName of the file to which reporting will be performed.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( string  filename,
bool  append 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies either to overwrite the file or to append to it.

Parameters
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( string  filename,
bool  append,
bool  writeintro 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.AddTextWriter ( string  filename,
bool  append,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is true when specifying a file name.
Returns
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.RemoveTextWriters ( )

Removes all text writers from the TextWriter subsystem. If appropriate, the corresponding text writer is closed.

Returns
true if al text writers were successfully removed, false if there were problems.

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.RemoveTextWriter ( )

Removes the default text writer from the TextWriter subsystem. If appropriate, the corresponding text writer is closed.

Returns
true if the text writer was successfully removed, false otherwise (also if there is no writer installed)

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.RemoveTextWriter ( TextWriter  writer)

Removes the first object from Writers that contains the specified TextWriter. If appropriate, the corresponding text writer is closed.

Returns
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.RemoveTextWriter ( Stream  stream)

Removes the first object from Writers whose TextWriter has been created form the specified stream. If appropriate, the corresponding text writer is closed.

Returns
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

Implemented in IG.Lib.ReporterBase.

bool IG.Lib.IReporterTextWriter.RemoveTextWriter ( string  filename)

Removes the first object from Writers whose TextWriter has been created form the file with the specified name. If appropriate, the corresponding text writer is closed.

Returns
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

Implemented in IG.Lib.ReporterBase.

List<TextWriter> IG.Lib.IReporterTextWriter.TextWriterWriters ( )

Returns a list of all text writers that are currently used by the reporter's text writer. Only text writers that are actually writable are included.

Returns
List of text writers that are currently used by the reporter's text writer (only those that are actually writable are included).

Implemented in IG.Lib.ReporterBase.

List<TextWriter> IG.Lib.IReporterTextWriter.TextWriterWriters ( bool  writableonly)

Returns a list of all text writers that are currently used by the reporter's text writer. Warning: Beware of thread safety issues! Blocks of code where the returned list is used should be enclosed in lock(reporter.lockobj){...} block (where reporter is the object through which this method was called).

Parameters
writableonlyIf true then only those text writers are listed that are actually writable. If false then all text writers are listed.
Returns
List of text writers that are currently used by the reporter's text writer.

Implemented in IG.Lib.ReporterBase.

int IG.Lib.IReporterTextWriter.TextWriterNumWriters ( )

Returns the current number of text writers used by the reporter's text logging module. Only text writers that are actually writable are counted.

Returns
The current number of text writers used by the reporter's text logging module (only those that are actually writable are counted).

Implemented in IG.Lib.ReporterBase.

Referenced by IG.Forms.ReporterConf.ApplyGuiSettings().

int IG.Lib.IReporterTextWriter.TextWriterNumWriters ( bool  writableonly)

Returns the current number of TextWriters used by the reporter's text logging module.

Parameters
writableonlyIf true then only those text writers are counted that are actually writable. If false then all text writers are returned.
Returns
The current number of text writers used by the reporter's text logging module.

Implemented in IG.Lib.ReporterBase.

int IG.Lib.IReporterTextWriter.TextWriterFlush ( )

Flushes all text writers of the Writer's TextWriter subsystem.

Returns
Number of writers that has actually been flushed.

Implemented in IG.Lib.ReporterBase.

int IG.Lib.IReporterTextWriter.TextWriterWrite ( string  str)

Writes a string to all text writers of the Writer's TextWriter subsystem.

Parameters
strString to be written.
Returns
Number of writers that the string has actually been written to.

Implemented in IG.Lib.ReporterBase.

int IG.Lib.IReporterTextWriter.TextWriterWriteLine ( string  str)

Similar to TextWriterWrite(), except that a newline is added at the end of the string.

Implemented in IG.Lib.ReporterBase.

Property Documentation

bool IG.Lib.IReporterTextWriter.UseTextWriter
getset

Specifies whether or not TextWriter(s) are used by the Reporter to log messages.

Referenced by IG.Forms.ReporterConf.ApplyGuiSettings().

string IG.Lib.IReporterTextWriter.TextWriterIntroText
getset

Gets or sets the introduction string that is written before logging to a TextWriter begins. If this is not specified then the reporter composes its own introduction string, eventually using programname (when defined).

string IG.Lib.IReporterTextWriter.TextWriterProgramName
getset

String denoting the name of the program or other entity that uses the Reporter for logging. When introtext is not specified, this name is used in the introduction text composed by the reporter.

bool IG.Lib.IReporterTextWriter.TextWriterWriteIntro
getset

Specifies whether introduction text is written before logging of messages begins or not.


The documentation for this interface was generated from the following file: