-
Notifications
You must be signed in to change notification settings - Fork 8
/
Log.cs
46 lines (37 loc) · 1.15 KB
/
Log.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
namespace Translator
{
//Log Delegate
public delegate void LogDelegate(string iLog_message);
public class LogEntry : PropertyChangedBase
{
public DateTime DateTime { get; set; }
public int Index { get; set; }
public string Message { get; set; }
public LogEntry()
{ }
public LogEntry(int Index, string Message)
{
DateTime = DateTime.Now;
}
}
public class CollapsibleLogEntry : LogEntry
{
public List<LogEntry> Contents { get; set; }
}
public class PropertyChangedBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
System.Windows.Application.Current.Dispatcher.BeginInvoke((Action)(() =>
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
}));
}
}
}