mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-08-01 21:32:18 +02:00
v1.2.0
* (Add) RAM usage on title bar * (Add) Clipboard manager: Undo (Ctrl + Z) and Redo (Ctrl + Y) modifications (Memory optimized) * (Add) Current layer properties on information tab * (Fix) Long windows with system zoom bigger than 100% were being hidden and overflow (#90) * (Fix) Do not recompute issues nor properties nor reshow layer if operation is cancelled or failed
This commit is contained in:
@@ -10,10 +10,12 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media.Imaging;
|
||||
@@ -174,7 +176,7 @@ namespace UVtools.WPF
|
||||
var assemblyName = Assembly.GetEntryAssembly().GetName().Name;
|
||||
uri = new Uri($"avares://{assemblyName}{url}");
|
||||
}
|
||||
|
||||
|
||||
var res = AvaloniaLocator.Current.GetService<IAssetLoader>().Open(uri);
|
||||
return res;
|
||||
}
|
||||
@@ -205,5 +207,86 @@ namespace UVtools.WPF
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Assembly Attribute Accessors
|
||||
|
||||
public static Version Version => Assembly.GetExecutingAssembly().GetName().Version;
|
||||
public static string VersionStr => Version.ToString(3);
|
||||
|
||||
public static string AssemblyTitle
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
|
||||
if (attributes.Length > 0)
|
||||
{
|
||||
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
|
||||
if (titleAttribute.Title != "")
|
||||
{
|
||||
return titleAttribute.Title;
|
||||
}
|
||||
}
|
||||
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
|
||||
public static string AssemblyDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string description = ((AssemblyDescriptionAttribute)attributes[0]).Description + $"{Environment.NewLine}{Environment.NewLine}Available File Formats:";
|
||||
|
||||
return FileFormat.AvaliableFormats.SelectMany(fileFormat => fileFormat.FileExtensions).Aggregate(description, (current, fileExtension) => current + $"{Environment.NewLine}- {fileExtension.Description} (.{fileExtension.Extension})");
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyProduct
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return ((AssemblyProductAttribute)attributes[0]).Product;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyCopyright
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyCompany
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return ((AssemblyCompanyAttribute)attributes[0]).Company;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user