xtd 0.2.0
Loading...
Searching...
No Matches
trace_form.h
Go to the documentation of this file.
1
4#pragma once
6#include "icontrol_trace.h"
7#include "trace_form_base.h"
8#include <xtd/diagnostics/trace>
9
11namespace xtd {
13 namespace forms {
35 public:
37
41 xtd::diagnostics::trace::listeners().push_back(listener_);
42 #if defined(TRACE)
43 visible(true);
44 #endif
45 }
47
51
53
62
64
66 void write(const xtd::ustring& trace) override {
67 #if defined(TRACE)
69 #endif
70 }
71 void write_line(const xtd::ustring& trace) override {
72 #if defined(TRACE)
74 #endif
75 }
76
77 void flush() override;
79
80 protected:
82
88 std::unique_ptr<xtd::object> clone() const override;
90
91 private:
92 std::shared_ptr<xtd::diagnostics::trace_listener> listener_ = xtd::forms::control_trace_listener::create(*this);
93 };
94 }
95}
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition trace_listener.h:35
static listener_collection & listeners() noexcept
Gets the collection of listeners that is monitoring the trace output.
static std::shared_ptr< xtd::diagnostics::trace_listener > create(xtd::forms::icontrol_trace &control_trace)
Create new control_trace_listener.
Definition control_trace_listener.h:86
virtual bool visible() const noexcept
Gets a value indicating whether the control and all its child controls are displayed.
Allow a control to be called by control_trace_listener for writing debug or trace message.
Definition icontrol_trace.h:20
Represents a base form for debug_form and trace_form forms. This class cannot be instantiated.
Definition trace_form_base.h:28
virtual void write_line(const xtd::ustring &trace)
Writes trace string to the multiline text followed by a line terminator.
virtual void write(const xtd::ustring &trace)
Writes trace string to the multiline text.
Represents a form that displays trace form. This class cannot be inherited.
Definition trace_form.h:34
const xtd::diagnostics::trace_listener & trace_listener() const noexcept
Gets underlying trace listener.
trace_form()
Initializes a new instance of the trace_form class.
Definition trace_form.h:40
void write(const xtd::ustring &trace) override
Write debug or trace message on this instance control.
Definition trace_form.h:66
void write_line(const xtd::ustring &trace) override
Write debug or trace message on this instance control followed by line terminator.
Definition trace_form.h:71
std::unique_ptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
void flush() override
Flushes the output buffer and causes buffered data to write to the control.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::forms::control_trace_listener listener.
Contains xtd::forms::icontrol_trace interface.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::trace_form_base dialog.