GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bytecode-api/BytecodeApi.Wpf/BindingErrorTraceListener.cs at master · bytecode77/bytecode-api

Expand file tree

/

BindingErrorTraceListener.cs

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
49 lines (44 loc) · 1.51 KB
/

BindingErrorTraceListener.cs

Copy path

File metadata and controls

49 lines (44 loc) · 1.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Diagnostics;
namespace BytecodeApi.Wpf;
/// <summary>
/// Directs WPF binding error output to event handlers.
/// </summary>
public class BindingErrorTraceListener : TraceListener
{
/// <summary>
/// Occurs when a WPF binding error is traced.
/// </summary>
public event EventHandler<string>? EventReceived;
/// <summary>
/// Initializes a new instance of the <see cref="BindingErrorTraceListener" /> class.
/// </summary>
public BindingErrorTraceListener()
{
TraceSource traceSource = PresentationTraceSources.DataBindingSource;
traceSource.Listeners.Add(this);
traceSource.Switch.Level = SourceLevels.Error;
}
/// <summary>
/// When overridden in a derived class, writes the specified message to the listener you create in the derived class.
/// </summary>
/// <param name="message">A message to write.</param>
public override void Write(string? message)
{
}
/// <summary>
/// When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator.
/// </summary>
/// <param name="message">A message to write.</param>
public override void WriteLine(string? message)
{
OnEventReceived(message ?? "");
}
/// <summary>
/// Raises the <see cref="EventReceived" /> event.
/// </summary>
/// <param name="message">The message for the <see cref="EventReceived" /> event.</param>
protected virtual void OnEventReceived(string message)
{
EventReceived?.Invoke(this, message);
}
}
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.