using System;
using Starcounter;
using Simplified.Ring3;

namespace Simplified.Ring1
{
    /// <summary>
    /// TODO: Move this out of Ring1
    /// </summary>
    [Database]
    public class EventInfo : Something
    {
        public Event Event { get; set; }

        public string _Color { get; set; } // TODO: MAKE PRIVATE
        public string Color
        {
            get
            {

                if (!string.IsNullOrEmpty(this._Color))
                {
                    return this._Color;
                }

                if (this.EventGroup != null)
                {
                    // Use calendar group color
                    return this.EventGroup.Color;
                }

                return null;
            }
            set
            {
                this._Color = value;
            }
        }

        public string Picture { get; set; }
        public string Place { get; set; }
        public bool FullDay { get; set; }
        public SystemUser Owner { get; set; }
        public DateTime Created { get; set; }
        public DateTime Updated { get; set; }
        public EventGroup EventGroup { get; set; }
    }
}
