mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-09 01:52:32 +02:00
v2.9.1
* **File formats:** * PhotonS: Implement the write/encode method to allow to use this format and fix the thumbnail * VDT: Allow to auto convert the .vdt to the target printer format using the Machine - Notes, using a flag: FILEFORMAT_YourPrinterExtension, for example: FILEFORMAT_CTB * (Fix) Unable to convert files with no thumbnails to other file format that requires thumbnails * **Tools:** * (Add) Re-height: Option to Anti-Aliasing layers * (Fix) Morph and Blur: The combobox was not setting to the selected item when preform a redo operation (Ctrl+Shift+Z) * **GUI:** * (Change) Progress window to be a grid element inside MainWindow, this allow to reuse the graphics and its elements without the need of spawning a Window instance everytime a progress is shown, resulting in better performance and more fluid transaction * (Improvement) Clear issues when generating calibration tests
This commit is contained in:
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UVtools.Core.Objects
|
||||
{
|
||||
public class StringTag : BindableBase, IEquatable<StringTag>, IComparable<StringTag>
|
||||
{
|
||||
private string _content;
|
||||
private object _tag;
|
||||
|
||||
public string Content
|
||||
{
|
||||
get => _content;
|
||||
set => RaiseAndSetIfChanged(ref _content, value);
|
||||
}
|
||||
|
||||
public object Tag
|
||||
{
|
||||
get => _tag;
|
||||
set => RaiseAndSetIfChanged(ref _tag, value);
|
||||
}
|
||||
|
||||
public string TagString
|
||||
{
|
||||
get => Tag?.ToString();
|
||||
set => Tag = value;
|
||||
}
|
||||
|
||||
public StringTag(object content, object tag = null)
|
||||
{
|
||||
Content = content.ToString();
|
||||
Tag = tag;
|
||||
}
|
||||
public StringTag(string content, object tag = null)
|
||||
{
|
||||
Content = content;
|
||||
Tag = tag;
|
||||
}
|
||||
|
||||
public bool Equals(StringTag other)
|
||||
{
|
||||
return _content == other._content && Equals(_tag, other._tag);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((StringTag) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
return ((_content != null ? _content.GetHashCode() : 0) * 397) ^ (_tag != null ? _tag.GetHashCode() : 0);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class ContentEqualityComparer : IEqualityComparer<StringTag>
|
||||
{
|
||||
public bool Equals(StringTag x, StringTag y)
|
||||
{
|
||||
if (ReferenceEquals(x, y)) return true;
|
||||
if (ReferenceEquals(x, null)) return false;
|
||||
if (ReferenceEquals(y, null)) return false;
|
||||
if (x.GetType() != y.GetType()) return false;
|
||||
return x.Content == y.Content;
|
||||
}
|
||||
|
||||
public int GetHashCode(StringTag obj)
|
||||
{
|
||||
return (obj.Content != null ? obj.Content.GetHashCode() : 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEqualityComparer<StringTag> ContentComparer { get; } = new ContentEqualityComparer();
|
||||
|
||||
public int CompareTo(StringTag other)
|
||||
{
|
||||
if (ReferenceEquals(this, other)) return 0;
|
||||
if (ReferenceEquals(null, other)) return 1;
|
||||
return string.Compare(Content, other.Content, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Content;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user