/
hlebusheck
/
notes
Обзор
Документация
Войти
/
hlebusheck
/
notes
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
Notes.Model/MemoOptions.cs
40 строк
1 KB
Hlebusheck
NET 8
16 апр 2024, 19:11
16 апр 2024, 19:11
8638cf1
Код
Авторство
О чём код?
using Notes.Model.Base; namespace Notes.Model { public class MemoOptions : Entity, IComparable, IComparable<MemoOptions> { private bool _favorite = false; private bool _wrapping = false; private bool _readOnly = false; public bool Favorite { get => _favorite; set => SetValue(ref _favorite, value); } public bool Wrapping { get => _wrapping; set => SetValue(ref _wrapping, value); } public bool ReadOnly { get => _readOnly; set => SetValue(ref _readOnly, value); } public int CompareTo(MemoOptions? other) => Favorite.CompareTo(other?.Favorite); private const string _compareTypeError = $"Object must be of type {nameof(MemoOptions)}"; public int CompareTo(object? obj) { if (obj is MemoOptions other) return Favorite.CompareTo(other.Favorite); throw new ArgumentException(_compareTypeError); } } }