mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-11 19:12:31 +02:00
702b73d5e2
- **Pixel Arithmetic:** - (Add) Corode: Noise pixel area, defaulting to 3px2 - (Change) Corode: Cryptonumeric random to normal random to speed up calculation - (Change) Fuzzy skin preset: Set a ignore threshold area of 5000px2 - (Improvement) Masking performance and auto crop the layer to speed up the processing when using an "Apply to" other than "All" - (Fix) Some "Apply to" methods was creating a wrong mask with some operators - **CXDLP V3:** - (Fix) Checksum (CRC32) (#389) - (Fix) Software name and material name serialization
73 lines
2.0 KiB
C#
73 lines
2.0 KiB
C#
/*
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE
|
|
* Version 3, 19 November 2007
|
|
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
* of this license document, but changing it is not allowed.
|
|
*/
|
|
|
|
using System;
|
|
|
|
namespace UVtools.Core.Objects
|
|
{
|
|
public class ValueDescription : BindableBase, IEquatable<ValueDescription>
|
|
{
|
|
private object _value;
|
|
private string _description;
|
|
|
|
public object Value
|
|
{
|
|
get => _value;
|
|
set => RaiseAndSetIfChanged(ref _value, value);
|
|
}
|
|
|
|
public string Description
|
|
{
|
|
get => _description;
|
|
set => RaiseAndSetIfChanged(ref _description, value);
|
|
}
|
|
|
|
public string ValueAsString
|
|
{
|
|
get => Value?.ToString();
|
|
set => Value = value;
|
|
}
|
|
|
|
public ValueDescription(object value, string description = null)
|
|
{
|
|
Value = value;
|
|
Description = description;
|
|
}
|
|
public ValueDescription(object value, object description = null)
|
|
{
|
|
Value = value;
|
|
Description = description?.ToString();
|
|
}
|
|
|
|
public bool Equals(ValueDescription other)
|
|
{
|
|
if (ReferenceEquals(null, other)) return false;
|
|
if (ReferenceEquals(this, other)) return true;
|
|
return Equals(_value, other._value) && _description == other._description;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (ReferenceEquals(null, obj)) return false;
|
|
if (ReferenceEquals(this, obj)) return true;
|
|
if (obj.GetType() != this.GetType()) return false;
|
|
return Equals((ValueDescription) obj);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return HashCode.Combine(_value, _description);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Description;
|
|
}
|
|
}
|
|
}
|