Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
SniffItem.cs
2using System;
3using System.Windows.Media;
4
6{
7 public enum SniffItemType
8 {
9 DataReceived,
10 DataTransmitted,
11 TextReceived,
12 TextTransmitted,
13 Information,
14 Warning,
15 Error,
16 Exception
17 }
18
23 public class SniffItem : ColorableItem
24 {
25 private readonly SniffItemType type;
26 private readonly DateTime timestamp;
27 private readonly string message;
28 private readonly byte[] data;
29 private readonly ListViewSniffer sniffer;
30
42 public SniffItem(DateTime Timestamp, SniffItemType Type, string Message, byte[] Data, Color ForegroundColor, Color BackgroundColor,
45 {
46 this.type = Type;
47 this.timestamp = Timestamp;
48 this.message = Message;
49 this.data = Data;
50 this.sniffer = Sniffer;
51 }
52
56 public DateTime Timestamp => this.timestamp;
57
61 public SniffItemType Type => this.type;
62
66 public string Time => this.timestamp.ToLongTimeString();
67
71 public string Message => this.message;
72
76 public byte[] Data => this.data;
77
81 public ListViewSniffer Sniffer => this.sniffer;
82
84 protected override void OnDeselected()
85 {
86 base.OnDeselected();
87 this.sniffer?.RaiseSelectionChanged();
88 }
89
91 protected override void OnSelected()
92 {
93 base.OnSelected();
94 this.sniffer?.RaiseSelectionChanged();
95 }
96 }
97}