| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.ComponentModel; |
| | 4 | | using System.Runtime.CompilerServices; |
| | 5 | | using System.Text; |
| | 6 | |
|
| | 7 | | namespace MUNity.Models.Resolution |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// A tag for a comment that could display: importand, question etc. |
| | 11 | | /// </summary> |
| | 12 | | public class CommentTag : INotifyPropertyChanged |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// To Identify the Tag later |
| | 16 | | /// </summary> |
| 0 | 17 | | public string Id { get; set; } |
| | 18 | |
|
| 0 | 19 | | private string _type = "default"; |
| | 20 | | /// <summary> |
| | 21 | | /// A Tag has a type, for example: success, danger, error etc. |
| | 22 | | /// The types are inside a string for more felxibility. The Start Type (default type) is |
| | 23 | | /// "default". |
| | 24 | | /// </summary> |
| | 25 | | public string Type { |
| 0 | 26 | | get => _type; |
| | 27 | | set |
| 0 | 28 | | { |
| 0 | 29 | | _type = value; |
| 0 | 30 | | NotifyPropertyChanged(nameof(Type)); |
| 0 | 31 | | } |
| | 32 | | } |
| | 33 | |
|
| 0 | 34 | | private string _text = ""; |
| | 35 | | /// <summary> |
| | 36 | | /// The Text of the Tag, should be short but is not limited by default. |
| | 37 | | /// </summary> |
| | 38 | | public string Text { |
| 0 | 39 | | get => _type; |
| | 40 | | set |
| 0 | 41 | | { |
| 0 | 42 | | _text = value; |
| 0 | 43 | | NotifyPropertyChanged(nameof(Text)); |
| 0 | 44 | | } |
| | 45 | | } |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Creates a new Comment Tag and will give it an id. |
| | 49 | | /// </summary> |
| 0 | 50 | | public CommentTag() |
| 0 | 51 | | { |
| 0 | 52 | | this.Id = Guid.NewGuid().ToString(); |
| 0 | 53 | | } |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// Event that is fired when a property has changed. |
| | 57 | | /// </summary> |
| | 58 | | public event PropertyChangedEventHandler PropertyChanged; |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// Internal Event to fire the Property Changed event. |
| | 62 | | /// </summary> |
| | 63 | | /// <param name="name"></param> |
| | 64 | | protected void NotifyPropertyChanged([CallerMemberName] string name = null) |
| 0 | 65 | | { |
| 0 | 66 | | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); |
| 0 | 67 | | } |
| | 68 | | } |
| | 69 | | } |