changed ExtendedChar

master
Jonas Arnold 3 years ago
parent 5ef28a13ea
commit 867cc15529
  1. 28
      MultiTerm.Protocols/Model/ExtendedChar.cs

@ -4,7 +4,7 @@ namespace MultiTerm.Protocols.Model;
/// <summary> /// <summary>
/// A class that represents a Character and contains some additional information and methods. /// A class that represents a Character and contains some additional information and methods.
/// The time of instanciation is represented with the <see cref="TimeOfCreation"/> property. /// A time can be stored in combination with this Character using the <see cref="Time"/> property. E.g. to represent arrived or sent time.
/// Several methods to display the Character in other formats than Unicode are provided. /// Several methods to display the Character in other formats than Unicode are provided.
/// </summary> /// </summary>
public class ExtendedChar public class ExtendedChar
@ -15,14 +15,32 @@ public class ExtendedChar
public char Character { get; set; } public char Character { get; set; }
/// <summary> /// <summary>
/// Time of instanciation of this class. /// Time that is associated with the <see cref="Character"/>.
/// E.g. to represent arrived or sent time.
/// </summary> /// </summary>
public TimeOnly TimeOfCreation { get; private set; } public TimeOnly Time { get; private set; }
public ExtendedChar() /// <summary>
/// Creates an instance of ExtendedChar with a given <paramref name="character"/>.
/// Sets <see cref="Time"/> to now.
/// </summary>
/// <param name="character">data</param>
public ExtendedChar(char character)
{ {
// initialize time with now // initialize time with now
this.TimeOfCreation = TimeOnly.FromDateTime(DateTime.Now); this.Time = TimeOnly.FromDateTime(DateTime.Now);
this.Character = character;
}
/// <summary>
/// Creates an instance of ExtendedChar with a given <paramref name="character"/> and <paramref name="time"/>.
/// </summary>
/// <param name="character">data</param>
/// <param name="time">time</param>
public ExtendedChar(char character, TimeOnly time)
{
this.Character = character;
this.Time = time;
} }
public override string ToString() public override string ToString()

Loading…
Cancel
Save