xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Public Member Functions | Static Public Member Functions | List of all members
xtd::forms::control_trace_listener Class Reference

#include <control_trace_listener.h>

Definition

Directs tracing or debugging output to a icontrol_trace object.

Namespace
xtd::forms
Library
xtd.forms
Examples

Public Member Functions

 control_trace_listener (xtd::forms::icontrol_trace &control_trace)
 Initializes a new instance of the control_trace_listener class with specified control_trace. More...
 
void close () override
 When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output. More...
 
virtual xtd::forms::icontrol_tracecontrol_trace ()
 Get icontroll_trace object. More...
 
virtual void control_trace (xtd::forms::icontrol_trace &control_trace)
 Set icontroll_trace object. More...
 
void flush () override
 When overridden in a derived class, flushes the output buffer. More...
 
void write (const xtd::ustring &message) override
 Writes the message to the listener you create when you implement the trace_listener class. More...
 
void write_line (const xtd::ustring &message) override
 Writes the message to the listener you create when you implement the trace_listener class. More...
 
- Public Member Functions inherited from xtd::diagnostics::trace_listener
 trace_listener ()=default
 Initializes a new instance of the trace_listener class. More...
 
 trace_listener (const xtd::ustring &name)
 Initializes a new instance of the trace_listener class using the specified name as the listener. More...
 
virtual void fail (const xtd::ustring &message)
 Emits an error message to the listener you create when you implement the TraceListener class. More...
 
virtual void fail (const xtd::ustring &message, const xtd::ustring &detail_message)
 Emits the specified error message. More...
 
unsigned int indent_level () const
 Gets the indent level. More...
 
void indent_level (unsigned int indent_level)
 Sets the indent level. More...
 
unsigned int indent_size () const
 Gets the number of spaces in an indent. More...
 
void indent_size (unsigned int indent_size)
 Sets the number of spaces in an indent. More...
 
virtual bool is_thread_safe () const
 Gets a value indicating whether the trace listener is thread safe. More...
 
const xtd::ustringname () const
 Gets or sets a name for this TraceListener. More...
 
void name (const xtd::ustring &name)
 Sets a name for this TraceListener. More...
 
template<typename object >
void trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int id, const object &data)
 Writes trace information, a data object and event information to the listener specific output. More...
 
template<typename object >
void trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int id, const std::vector< object > &data)
 Writes trace information, a data object and event information to the listener specific output. More...
 
template<typename ... objects>
void trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int id, const objects &... data)
 Writes trace information, an array of data objects and event information to the listener specific output. More...
 
virtual void trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int id)
 Writes trace and event information to the listener specific output. More...
 
virtual void trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int id, const xtd::ustring &message)
 Writes trace information, a message, and event information to the listener specific output. More...
 
template<typename ... objects>
void trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int id, const xtd::ustring &format, const objects &... args)
 Writes trace information, a formatted array of objects and event information to the listener specific output. More...
 
const trace_optionstrace_output_options () const
 Gets the trace output options. More...
 
void trace_output_options (const trace_options &trace_output_options)
 Sets the trace output options. More...
 
template<typename activity_id_type >
void trace_transfer (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, int id, const xtd::ustring &message, const activity_id_type &related_activity_id)
 Writes trace information, a message, a related activity identity and event information to the listener specific output. More...
 
template<typename object >
void write (const object &o)
 Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class. More...
 
template<typename object >
void write (const object &o, const xtd::ustring &category)
 Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class. More...
 
template<typename object >
void write_line (const object &o)
 Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class. More...
 
template<typename object >
void write_line (const object &o, const xtd::ustring &category)
 Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a std::string that represents the current object. More...
 

Static Public Member Functions

static std::shared_ptr< xtd::diagnostics::trace_listenercreate (xtd::forms::icontrol_trace &control_trace)
 Create new control_trace_listener. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from xtd::diagnostics::trace_listener
bool need_indent () const
 Gets a value indicating whether to indent the output. More...
 
void need_indent (bool need_indent)
 Sets a value indicating whether to indent the output. More...
 
void thread_safe (bool thread_safe)
 Sets a value indicating whether the trace listener is thread safe. More...
 
virtual void write_indent ()
 Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false. More...
 

Constructor & Destructor Documentation

◆ control_trace_listener()

xtd::forms::control_trace_listener::control_trace_listener ( xtd::forms::icontrol_trace control_trace)
inline

Initializes a new instance of the control_trace_listener class with specified control_trace.

Parameters
control_traceA control that inherits to the icontrol_trace interface.
See also
see xtd::forms::icontrol_trace interface.

Member Function Documentation

◆ close()

void xtd::forms::control_trace_listener::close ( )
inlineoverridevirtual

When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.

Remarks
Use this method when the output is going to a file, such as to the TextWriterTraceListener. After a call to this method, you must reinitialize the object.

Reimplemented from xtd::diagnostics::trace_listener.

◆ control_trace() [1/2]

virtual xtd::forms::icontrol_trace& xtd::forms::control_trace_listener::control_trace ( )
inlinevirtual

Get icontroll_trace object.

Returns
The icontrol_trace object used.

◆ control_trace() [2/2]

virtual void xtd::forms::control_trace_listener::control_trace ( xtd::forms::icontrol_trace control_trace)
inlinevirtual

Set icontroll_trace object.

Parameters
control_traceThe icontrol_trace object to use.

◆ create()

static std::shared_ptr<xtd::diagnostics::trace_listener> xtd::forms::control_trace_listener::create ( xtd::forms::icontrol_trace control_trace)
inlinestatic

Create new control_trace_listener.

Returns
New created trace listener.

◆ flush()

void xtd::forms::control_trace_listener::flush ( )
inlineoverridevirtual

When overridden in a derived class, flushes the output buffer.

Reimplemented from xtd::diagnostics::trace_listener.

◆ write()

void xtd::forms::control_trace_listener::write ( const xtd::ustring message)
inlineoverridevirtual

Writes the message to the listener you create when you implement the trace_listener class.

Parameters
messageA string you want to write.

Implements xtd::diagnostics::trace_listener.

◆ write_line()

void xtd::forms::control_trace_listener::write_line ( const xtd::ustring message)
inlineoverridevirtual

Writes the message to the listener you create when you implement the trace_listener class.

Parameters
messageA string you want to write.

Implements xtd::diagnostics::trace_listener.


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