xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::control_trace_listener Class Reference
Inheritance diagram for xtd::forms::control_trace_listener:
xtd::diagnostics::trace_listener xtd::abstract_object xtd::object

Definition

Directs tracing or debugging output to a icontrol_trace object.

Header
#include <xtd/forms/control_trace_listener>
Namespace
xtd::forms
Library
xtd.forms
Examples
Remarks
To disable debug mode with CMake, add the command line add_definitions(-DNDEBUG) in your CMakeLists.txt, or define NDEBUG at the top of your file.
Note
If you define #define DEBUG above your includes, debug mode will still be active even if NDEBUG is defined.
Remarks
To activate your code if DEBUG is defined, you must enclose calls to the methods of Debug in an #if DEBUG ... #endif block.
To disable trace mode with CMake, add the command line add_definitions(-DNTRACE) in your CMakeLists.txt, or define NTRACE at the top of your file.
Note
If you define #define TRACE above your includes, trace mode will still be active even if NTRACE is defined.
Remarks
To activate your code if TRACE is defined, you must enclose calls to the methods of Debug in an #if TRACE ... #endif block.

Public Constructors

 control_trace_listener (xtd::forms::icontrol_trace &control_trace)
 Initializes a new instance of the control_trace_listener class with specified control_trace.

Public Properties

virtual auto control_trace () noexcept -> xtd::forms::icontrol_trace &
 Gets icontroll_trace object.
virtual auto control_trace (xtd::forms::icontrol_trace &control_trace) -> control_trace_listener &
 Sets icontroll_trace object.

Public Methods

auto close () -> void override
 When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
auto flush () -> void override
 When overridden in a derived class, flushes the output buffer.
auto write (const xtd::string &message) -> void override
 Writes the message to the listener you create when you implement the trace_listener class.
auto write_line (const xtd::string &message) -> void override
 Writes the message to the listener you create when you implement the trace_listener class.
template<typename object_t>
auto write (const object_t &o) -> void
 Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.
template<typename object_t>
auto write (const object_t &o, const xtd::string &category) -> void
 Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
template<typename object_t>
auto write_line (const object_t &o) -> void
 Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.
template<typename object_t>
auto write_line (const object_t &o, const xtd::string &category) -> void
 Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.

Public Static Methods

static auto create (xtd::forms::icontrol_trace &control_trace) -> xtd::sptr< xtd::diagnostics::trace_listener >
 Create new control_trace_listener.

Additional Inherited Members

 trace_listener ()=default
 Initializes a new instance of the trace_listener class.
 trace_listener (const xtd::string &name)
 Initializes a new instance of the trace_listener class using the specified name as the listener.
auto indent_level () const noexcept -> xtd::uint32
 Gets the indent level.
auto indent_level (xtd::uint32 indent_level) noexcept -> void
 Sets the indent level.
auto indent_size () const noexcept -> xtd::uint32
 Gets the number of spaces in an indent.
auto indent_size (xtd::uint32 indent_size) noexcept -> void
 Sets the number of spaces in an indent.
virtual auto is_thread_safe () const noexcept -> bool
 Gets a value indicating whether the trace listener is thread safe.
auto name () const noexcept -> const xtd::string &
 Gets or sets a name for this TraceListener.
auto name (const xtd::string &name) noexcept -> void
 Sets a name for this TraceListener.
auto trace_output_options () const noexcept -> xtd::diagnostics::trace_options
 Gets the trace output options.
auto trace_output_options (xtd::diagnostics::trace_options trace_output_options) noexcept -> void
 Sets the trace output options.
virtual auto fail (const xtd::string &message) -> void
 Emits an error message to the listener you create when you implement the TraceListener class.
virtual auto fail (const xtd::string &message, const xtd::string &detail_message) -> void
 Emits the specified error message.
template<typename object_t>
auto trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, const object_t &data) -> void
 Writes trace information, a data object and event information to the listener specific output.
template<typename object_t>
auto trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, const xtd::array< object_t > &data) -> void
 Writes trace information, a data object and event information to the listener specific output.
template<typename ... objects_t>
auto trace_data (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, objects_t &&... data) -> void
 Writes trace information, an array of data objects and event information to the listener specific output.
virtual auto trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id) -> void
 Writes trace and event information to the listener specific output.
virtual void trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::string &message)
 Writes trace information, a message, and event information to the listener specific output.
template<typename ... objects_t>
auto trace_event (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, xtd::int32 id, const xtd::string &format, const objects_t &... args) -> void
 Writes trace information, a formatted array of objects and event information to the listener specific output.
template<typename guid_t>
auto trace_transfer (const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, xtd::int32 id, const xtd::string &message, const guid_t &related_activity_id) -> void
 Writes trace information, a message, a related activity identity and event information to the listener specific output.
template<typename object_t>
auto write (const object_t &o) -> void
 Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.
template<typename object_t>
auto write (const object_t &o, const xtd::string &category) -> void
 Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
template<typename object_t>
auto write_line (const object_t &o) -> void
 Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.
template<typename object_t>
auto write_line (const object_t &o, const xtd::string &category) -> void
 Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto equals (const object &obj) const noexcept -> bool
 Determines whether the specified object is equal to the current object.
virtual auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.
auto need_indent () const noexcept -> bool
 Gets a value indicating whether to indent the output.
auto need_indent (bool need_indent) noexcept -> void
 Sets a value indicating whether to indent the output.
auto thread_safe (bool thread_safe) noexcept -> void
 Sets a value indicating whether the trace listener is thread safe.
virtual auto write_indent () -> void
 Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.
 abstract_object ()=default
 Initializes a new instance of the xtd::abstract_object class.

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

◆ control_trace() [1/2]

virtual auto xtd::forms::control_trace_listener::control_trace ( ) -> xtd::forms::icontrol_trace &
inlinenodiscardvirtualnoexcept

Gets icontroll_trace object.

Returns
The icontrol_trace object used.

◆ control_trace() [2/2]

virtual auto xtd::forms::control_trace_listener::control_trace ( xtd::forms::icontrol_trace & control_trace) -> control_trace_listener &
inlinevirtual

Sets icontroll_trace object.

Parameters
control_traceThe icontrol_trace object to use.
Returns
This current instance.

◆ close()

auto xtd::forms::control_trace_listener::close ( ) -> void
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.

◆ flush()

auto xtd::forms::control_trace_listener::flush ( ) -> void
inlineoverridevirtual

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

Reimplemented from xtd::diagnostics::trace_listener.

◆ write() [1/3]

auto xtd::forms::control_trace_listener::write ( const xtd::string & message) -> void
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() [1/3]

auto xtd::forms::control_trace_listener::write_line ( const xtd::string & message) -> void
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.

◆ create()

auto xtd::forms::control_trace_listener::create ( xtd::forms::icontrol_trace & control_trace) -> xtd::sptr< xtd::diagnostics::trace_listener >
inlinestaticnodiscard

Create new control_trace_listener.

Returns
New created trace listener.

◆ write() [2/3]

template<typename object_t>
auto xtd::diagnostics::trace_listener::write ( const object_t & o) -> void
inline

Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.

Parameters
oAn Object whose fully qualified class name you want to write.

◆ write() [3/3]

template<typename object_t>
auto xtd::diagnostics::trace_listener::write ( const object_t & o,
const xtd::string & category ) -> void
inline

Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.

Parameters
oAn Object whose fully qualified class name you want to write.
categoryA category name used to organize the output.

◆ write_line() [2/3]

template<typename object_t>
auto xtd::diagnostics::trace_listener::write_line ( const object_t & o) -> void
inline

Writes the value of the object's ToString method to the listener you create when you implement the TraceListener class.

Parameters
oAn Object whose fully qualified class name you want to write.

◆ write_line() [3/3]

template<typename object_t>
auto xtd::diagnostics::trace_listener::write_line ( const object_t & o,
const xtd::string & category ) -> void
inline

Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.

Parameters
oAn Object whose fully qualified class name you want to write.
categoryA category name used to organize the output.

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