xtd 1.0.0
Loading...
Searching...
No Matches
trace_form.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "icontrol_trace.hpp"
7#include "trace_form_base.hpp"
8#include <xtd/diagnostics/trace>
9
11namespace xtd {
13 namespace forms {
37 public:
39
44 #if TRACE
45 visible(true);
46 defined = true;
47 #endif
48 }
49
50
54
56
60 [[nodiscard]] auto trace_listener() const noexcept -> const xtd::diagnostics::trace_listener&;
63 [[nodiscard]] auto trace_listener() noexcept -> xtd::diagnostics::trace_listener&;
65
67
69 auto flush() -> void override;
70
71 auto write(const xtd::string& trace) -> void override {
72 if (!defined) return;
74 }
75
76 auto write_line(const xtd::string& trace) -> void override {
77 if (!defined) return;
79 }
80
81
82 private:
84 bool defined = false;
85 };
86 }
87}
static auto listeners() -> listener_collection &
Gets the collection of listeners that is monitoring the trace output.
static auto create(xtd::forms::icontrol_trace &control_trace) -> xtd::sptr< xtd::diagnostics::trace_listener >
Create new control_trace_listener.
Definition control_trace_listener.hpp:98
virtual auto visible() const noexcept -> bool
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.hpp:22
Represents a base form for debug_form and trace_form forms. This class cannot be instantiated.
Definition trace_form_base.hpp:30
virtual auto write_line(const xtd::string &trace) -> void
Writes trace string to the multiline text followed by a line terminator.
virtual auto write(const xtd::string &trace) -> void
Writes trace string to the multiline text.
trace_form_base(const xtd::string &text)
Initializes a new instance of the trace_form_base class with specified caption text.
Represents a form that displays trace form. This class cannot be inherited.
Definition trace_form.hpp:36
auto trace_listener() const noexcept -> const xtd::diagnostics::trace_listener &
Gets underlying trace listener.
trace_form()
Initializes a new instance of the trace_form class.
Definition trace_form.hpp:42
auto write_line(const xtd::string &trace) -> void override
Write debug or trace message on this instance control followed by line terminator.
Definition trace_form.hpp:76
auto flush() -> void override
Flushes the output buffer and causes buffered data to write to the control.
auto write(const xtd::string &trace) -> void override
Write debug or trace message on this instance control.
Definition trace_form.hpp:71
Contains xtd::forms::control_trace_listener listener.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
Contains xtd::forms::icontrol_trace interface.
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::forms::trace_form_base dialog.