mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-13 03:47:40 +02:00
012d9e4b70
* (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
60 lines
1.6 KiB
C#
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;
|
|
}
|
|
|
|
}
|
|
}
|