| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="ExpiringEventArgs.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System; |
| | | 8 | | using MyNet.Utilities.Caching.Policies; |
| | | 9 | | |
| | | 10 | | namespace MyNet.Utilities.Caching; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// The expiring event args. |
| | | 14 | | /// </summary> |
| | | 15 | | /// <typeparam name="TKey">The key type.</typeparam> |
| | | 16 | | /// <typeparam name="TValue">The value type.</typeparam> |
| | | 17 | | /// <remarks> |
| | | 18 | | /// Initializes a new instance of the <see cref="ExpiringEventArgs{TKey, TValue}" /> class. |
| | | 19 | | /// </remarks> |
| | | 20 | | /// <param name="key">The key.</param> |
| | | 21 | | /// <param name="value">The value.</param> |
| | | 22 | | /// <param name="expirationPolicy">The expiration policy.</param> |
| | 6 | 23 | | public class ExpiringEventArgs<TKey, TValue>(TKey key, TValue value, ExpirationPolicy? expirationPolicy) : EventArgs |
| | | 24 | | { |
| | | 25 | | /// <summary> |
| | | 26 | | /// Gets or sets a value indicating whether the expiration of value should be canceled and the value should stay in |
| | | 27 | | /// </summary> |
| | | 28 | | /// <value><c>true</c> if cancelled; otherwise, <c>false</c>.</value> |
| | | 29 | | public bool Cancel { get; set; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Gets or sets the expiration policy. |
| | | 33 | | /// </summary> |
| | 6 | 34 | | public ExpirationPolicy? ExpirationPolicy { get; set; } = expirationPolicy; |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets the key. |
| | | 38 | | /// </summary> |
| | | 39 | | /// <value>The key.</value> |
| | 6 | 40 | | public TKey Key { get; private set; } = key; |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Gets the value. |
| | | 44 | | /// </summary> |
| | | 45 | | /// <value>The value.</value> |
| | 6 | 46 | | public TValue Value { get; private set; } = value; |
| | | 47 | | } |
| | | 48 | | |