inital
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FasdDesktopUi.Basics.Services.Models
|
||||
{
|
||||
public sealed class TicketOverviewCountsChangedEventArgs : EventArgs
|
||||
{
|
||||
public TicketOverviewCountsChangedEventArgs(IReadOnlyList<TileCountChange> changes, IReadOnlyDictionary<string, TileCounts> currentCounts)
|
||||
{
|
||||
Changes = changes;
|
||||
CurrentCounts = currentCounts;
|
||||
}
|
||||
|
||||
public IReadOnlyList<TileCountChange> Changes { get; }
|
||||
|
||||
public IReadOnlyDictionary<string, TileCounts> CurrentCounts { get; }
|
||||
}
|
||||
|
||||
public readonly struct TileCountChange
|
||||
{
|
||||
public TileCountChange(string key, TileScope scope, int oldCount, int newCount)
|
||||
{
|
||||
Key = key;
|
||||
Scope = scope;
|
||||
OldCount = oldCount;
|
||||
NewCount = newCount;
|
||||
}
|
||||
|
||||
public string Key { get; }
|
||||
|
||||
public TileScope Scope { get; }
|
||||
|
||||
public int OldCount { get; }
|
||||
|
||||
public int NewCount { get; }
|
||||
|
||||
public int Delta => NewCount - OldCount;
|
||||
}
|
||||
|
||||
public readonly struct TileCounts
|
||||
{
|
||||
public static TileCounts Empty => new TileCounts(0, 0);
|
||||
|
||||
public TileCounts(int personal, int role)
|
||||
{
|
||||
Personal = personal;
|
||||
Role = role;
|
||||
}
|
||||
|
||||
public int Personal { get; }
|
||||
|
||||
public int Role { get; }
|
||||
}
|
||||
|
||||
public enum TileScope
|
||||
{
|
||||
Personal,
|
||||
Role
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user