Notes
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
7namespace Model
8{
9public class Note
10{
11private string _title;
12public string Text { get; set; }
13public bool IsEdit { get; set; } = false;
14private int _id;
15private static int _allNotesCount;
16
17public static int AllNotesCount
18{
19get => _allNotesCount;
20}
21
22public string Title
23{
24get { return _title; }
25set
26{
27if (value.Length > 0 && value.Length <= 50)
28{
29_title = value;
30}
31}
32}
33
34public int Id
35{
36get { return _id; }
37}
38
39public Note()
40{
41_allNotesCount ++;
42_id = _allNotesCount;
43}
44
45public Note(string title, string text)
46{
47Title = title;
48Text = text;
49_allNotesCount++;
50_id = _allNotesCount;
51}
52}
53}
54