| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.Collections.ObjectModel; |
| | 4 | | using System.ComponentModel; |
| | 5 | | using System.Runtime.CompilerServices; |
| | 6 | | using System.Text; |
| | 7 | |
|
| | 8 | | namespace MUNity.Models.Resolution |
| | 9 | | { |
| | 10 | | /// <summary> |
| | 11 | | /// A Comment for an operative paragraph or a preamble paragraph to allow a discussion about the paragraphs. |
| | 12 | | /// </summary> |
| | 13 | | public class Comment : INotifyPropertyChanged |
| | 14 | | { |
| | 15 | | /// <summary> |
| | 16 | | /// The Id of the comment |
| | 17 | | /// </summary> |
| 0 | 18 | | public string CommentId { get; set; } |
| | 19 | |
|
| 0 | 20 | | private string _authorName = ""; |
| | 21 | | /// <summary> |
| | 22 | | /// The author name of the Comment |
| | 23 | | /// </summary> |
| | 24 | | public string AuthorName { |
| 0 | 25 | | get => _authorName; |
| | 26 | | set |
| 0 | 27 | | { |
| 0 | 28 | | _authorName = value; |
| 0 | 29 | | NotifyPropertyChanged(nameof(AuthorName)); |
| 0 | 30 | | } |
| | 31 | | } |
| | 32 | |
|
| 0 | 33 | | private string _authorId = ""; |
| | 34 | | /// <summary> |
| | 35 | | /// The Id of the author if you can use if the author is logged in. |
| | 36 | | /// </summary> |
| | 37 | | public string AuthorId { |
| 0 | 38 | | get => _authorId; |
| | 39 | | set |
| 0 | 40 | | { |
| 0 | 41 | | _authorId = value; |
| 0 | 42 | | NotifyPropertyChanged(nameof(AuthorId)); |
| 0 | 43 | | } |
| | 44 | | } |
| | 45 | |
|
| | 46 | | private DateTime _creationDate; |
| | 47 | | /// <summary> |
| | 48 | | /// The date the comment has been created, you can also use this a last Changed date. |
| | 49 | | /// </summary> |
| | 50 | | public DateTime CreationDate { |
| 0 | 51 | | get => _creationDate; |
| | 52 | | set |
| 0 | 53 | | { |
| 0 | 54 | | _creationDate = value; |
| 0 | 55 | | NotifyPropertyChanged(nameof(CreationDate)); |
| 0 | 56 | | } |
| | 57 | | } |
| | 58 | |
|
| 0 | 59 | | private string _title = ""; |
| | 60 | | /// <summary> |
| | 61 | | /// The title of the comment. This can be set and will not be generated automaticaly. |
| | 62 | | /// </summary> |
| | 63 | | public string Title { |
| 0 | 64 | | get => _title; |
| | 65 | | set |
| 0 | 66 | | { |
| 0 | 67 | | _title = value; |
| 0 | 68 | | NotifyPropertyChanged(nameof(Title)); |
| 0 | 69 | | } |
| | 70 | | } |
| | 71 | |
|
| 0 | 72 | | private string _text = ""; |
| | 73 | | /// <summary> |
| | 74 | | /// The text of the comment. |
| | 75 | | /// </summary> |
| | 76 | | public string Text { |
| 0 | 77 | | get => _text; |
| | 78 | | set |
| 0 | 79 | | { |
| 0 | 80 | | _text = value; |
| 0 | 81 | | NotifyPropertyChanged(nameof(Text)); |
| 0 | 82 | | } |
| | 83 | | } |
| | 84 | |
|
| | 85 | | /// <summary> |
| | 86 | | /// Tags that are added to the comment. |
| | 87 | | /// </summary> |
| 0 | 88 | | public ObservableCollection<CommentTag> Tags { get; set; } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// List of names that have marked to comment as read. |
| | 92 | | /// </summary> |
| 0 | 93 | | public ObservableCollection<ResaCommentSign> ReadBy { get; set; } |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Creates a new Instance of a comment for operative paragraphs or preamble paragraphs and give them a new guid |
| | 97 | | /// </summary> |
| 0 | 98 | | public Comment() |
| 0 | 99 | | { |
| 0 | 100 | | CommentId = Guid.NewGuid().ToString(); |
| 0 | 101 | | Tags = new ObservableCollection<CommentTag>(); |
| 0 | 102 | | ReadBy = new ObservableCollection<ResaCommentSign>(); |
| 0 | 103 | | } |
| | 104 | |
|
| | 105 | | /// <summary> |
| | 106 | | /// Event that is fired when a property has changed. |
| | 107 | | /// </summary> |
| | 108 | | public event PropertyChangedEventHandler PropertyChanged; |
| | 109 | |
|
| | 110 | | /// <summary> |
| | 111 | | /// Internal Event to fire the Property Changed event. |
| | 112 | | /// </summary> |
| | 113 | | /// <param name="name"></param> |
| | 114 | | protected void NotifyPropertyChanged([CallerMemberName] string name = null) |
| 0 | 115 | | { |
| 0 | 116 | | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); |
| 0 | 117 | | } |
| | 118 | |
|
| | 119 | | public void SetTextNoNotifyPropertyChanged(string text) |
| 0 | 120 | | { |
| 0 | 121 | | this._text = text; |
| 0 | 122 | | } |
| | 123 | | } |
| | 124 | | } |