| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using Muchinfo.MTPClient.Data.Enums;
- using System;
- using System.Collections.Generic;
- namespace Muchinfo.MTPClient.Data.Model.Account
- {
- /// <summary>
- /// 日志实体
- /// </summary>
- public class Log
- {
- /// <summary>
- /// 日志记录时间
- /// </summary>
- public DateTime Time { get; set; }
- /// <summary>
- /// 日志记录时间
- /// </summary>
- public string TimeText
- {
- get
- {
- return Time.ToString("HH:mm:ss");
- }
- }
- /// <summary>
- /// 日志内容
- /// </summary>
- public string Content { get; set; }
- /// <summary>
- /// 日志类型
- /// </summary>
- public LogType LogType { get; set; }
- public Log()
- {
- Time = DateTime.Now;
- }
- }
- public class LogComparer : IEqualityComparer<Log>
- {
- /// <summary>
- /// Equalses the specified x.
- /// </summary>
- /// <param name="x">The x.</param>
- /// <param name="y">The y.</param>
- /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
- public bool Equals(Log x, Log y)
- {
- if (x == null || y == null)
- {
- return false;
- }
- return (x.LogType == y.LogType && x.Time == y.Time);
- }
- /// <summary>
- /// Returns a hash code for this instance.
- /// </summary>
- /// <param name="obj">The object.</param>
- /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
- public int GetHashCode(Log obj)
- {
- return obj.Time.GetHashCode();
- }
- }
- }
|