using System.ComponentModel;
using System.Windows.Media;
using BS.Shared.Core;

namespace BeWo.Controls.Controls.Calendar
{
    public class Appointment : INotifyPropertyChanged
    {
        public static string PropertyName_Brush = "Brush";

        public static string PropertyName_Duration = "Duration";

        public static string PropertyName_Index = "Index";

        public static string PropertyName_Notice = "Notice";

        public static string PropertyName_Tag = "Tag";

        public static string PropertyName_Text = "Text";

        private SolidColorBrush _Brush;

        private DateTimeSpan _Duration;

        private int _Index;

        private string _Notice = string.Empty;

        private object _Tag;

        private string _Text = string.Empty;

        public SolidColorBrush Brush
        {
            get { return _Brush; }

            set
            {
                _Brush = value;
                FirePropertyChanged(PropertyName_Brush);
            }
        }

        public DateTimeSpan Duration
        {
            get { return _Duration; }

            set
            {
                _Duration = value;
                FirePropertyChanged(PropertyName_Duration);
            }
        }

        public int Index
        {
            get { return _Index; }

            set
            {
                _Index = value;
                FirePropertyChanged(PropertyName_Index);
            }
        }

        public string Notice
        {
            get { return _Notice; }

            set
            {
                _Notice = value;
                FirePropertyChanged(PropertyName_Notice);
            }
        }

        public object Tag
        {
            get { return _Tag; }

            set
            {
                _Tag = value;
                FirePropertyChanged(PropertyName_Tag);
            }
        }

        public string Text
        {
            get { return _Text; }

            set
            {
                _Text = value;
                FirePropertyChanged(PropertyName_Text);
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public override string ToString()
        {
            return _Text + " " + _Duration;
        }

        protected virtual void FirePropertyChanged(string pPropertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(pPropertyName));
        }
    }
}