优化更新代码,添加界面功能并整合

This commit is contained in:
GG Z
2025-02-10 20:53:40 +08:00
parent 83b846f15f
commit 978e03a67f
1389 changed files with 95739 additions and 22200 deletions

View File

@@ -0,0 +1,38 @@
using WPFluent.Extensions;
namespace WPFluent.Controls;
/// <summary>
/// Class used to create identifiers of threads or tasks that can be performed multiple times within one instance. <see
/// cref="Current"/> represents roughly the time in microseconds at which it was taken.
/// </summary>
internal class EventIdentifier
{
/// <summary>
/// Creates and assigns a random value with an extra time code if possible.
/// </summary>
private void UpdateIdentifier() => Current = DateTime.Now.GetMicroTimestamp();
/// <summary>
/// Creates and gets the next identifier.
/// </summary>
public long GetNext()
{
UpdateIdentifier();
return Current;
}
/// <summary>
/// Checks if the identifiers are the same.
/// </summary>
public bool IsEqual(long storedId) => Current == storedId;
/// <summary>
/// Gets or sets the current identifier.
/// </summary>
public long Current { get; internal set; } = 0;
}