HamBook – Rev 12

Subversion Repositories:
Rev:
using Configuration.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace Configuration
{
    public class NotificationState : INotifyPropertyChanged
    {
        private int _lingerTime = 5000;
        private bool _enabled = false;
        private NotificationType _type = NotificationType.None;

        public int LingerTime
        {
            get => _lingerTime;
            set
            {
                if (value == _lingerTime)
                {
                    return;
                }

                _lingerTime = value;
                OnPropertyChanged();
            }
        }

        public bool Enabled
        {
            get => _enabled;
            set
            {
                if (value == _enabled)
                {
                    return;
                }

                _enabled = value;
                OnPropertyChanged();
            }
        }

        public NotificationType Type
        {
            get => _type;
            set
            {
                if (value == _type)
                {
                    return;
                }

                _type = value;
                OnPropertyChanged();
            }
        }

        public NotificationState()
        {

        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }


}