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 {
37 public:
39
43 xtd::diagnostics::trace::listeners().push_back(listener_);
44 #if defined(TRACE)
45 visible(true);
46 defined = true;
47 #endif
48 }
50
54
56
65
67
69 void write(const xtd::string& trace) override {
70 if (!defined) return;
72 }
73 void write_line(const xtd::string& trace) override {
74 if (!defined) return;
76 }
77
78 void flush() override;
80
81 protected:
83
89 xtd::uptr<xtd::object> clone() const override;
91
92 private:
94 bool defined = false;
95 };
96 }
97}
Represents text as a sequence of character units.
Definition basic_string.h:79
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition trace_listener.h:37
static listener_collection & listeners() noexcept
Gets the collection of listeners that is monitoring the trace output.
static xtd::sptr< xtd::diagnostics::trace_listener > create(xtd::forms::icontrol_trace &control_trace)
Create new control_trace_listener.
Definition control_trace_listener.h:88
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:22
Represents a base form for debug_form and trace_form forms. This class cannot be instantiated.
Definition trace_form_base.h:30
virtual void write_line(const xtd::string &trace)
Writes trace string to the multiline text followed by a line terminator.
virtual void write(const xtd::string &trace)
Writes trace string to the multiline text.
Represents a form that displays trace form. This class cannot be inherited.
Definition trace_form.h:36
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:42
void write_line(const xtd::string &trace) override
Write debug or trace message on this instance control followed by line terminator.
Definition trace_form.h:73
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
void write(const xtd::string &trace) override
Write debug or trace message on this instance control.
Definition trace_form.h:69
void flush() override
Flushes the output buffer and causes buffered data to write to the control.
Contains xtd::forms::control_trace_listener listener.
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.h:25
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
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.