Files
UVtools/UVtools.GUI/Controls/Log.cs
T
Tiago Conceição 012d9e4b70 v0.6.4.1
* (Add) Partial update islands from current working layer and next layer when using pixel editor or island remove
* (Add) Setting: To enable or disable partial update islands
* (Change) Properties, Issues, Pixel Editor: ListView upgraded to a FastObjectListView, resulting in faster renders, sorting capabilities, column order, groups with counter, selection, hot tracking, filtering and empty list message
* (Change) Log: ObjectListView upgraded to a FastObjectListView
* (Change) Bunch of icons
2020-08-04 05:08:24 +01:00

60 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using BrightIdeasSoftware;
namespace UVtools.GUI.Controls
{
public sealed class Log : INotifyPropertyChanged
{
private int _index;
private string _time;
private string _description;
[OLVColumn(Width = 50, Title = "#")]
public int Index
{
get => _index;
set => SetField(ref _index, value);
}
[OLVColumn(Width = 90)]
public string Time
{
get => _time;
set => SetField(ref _time, value);
}
[OLVColumn(Width = 0)]
public string Description
{
get => _description;
set => SetField(ref _description, value);
}
public Log(int index, string description)
{
_index = index;
_description = description;
_time = DateTime.Now.ToString("HH:mm:ss");
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
OnPropertyChanged(propertyName);
return true;
}
}
}