using System.Windows.Media;

namespace BS.Shared.DataContracts.Compact
{
    public partial class CompactWohnheimDC : IFilterableDC
    {

        public string DetailDescription { get { return this.WohnheimName; } set { } }

        public string FilterRelevants { get { return string.Format("{0} {1} {2} {3}", this.WohnheimName, this.Strasse, this.PLZ, this.Ort); } set { } }

        public string IconPath { get { return @"..\..\Ressources\Icons\OfficeBulidingBlackDisabled.png"; } set { } }

        public string SimpleDescription { get { return this.WohnheimName; } set { } }

        public bool SupportsActivationType { get{ return true; } set { } }

        public long Version { get; set; }

        public SolidColorBrush FilterableBrush { get { return new SolidColorBrush(Colors.Transparent); } }

        public string AddressString
        {
            get
            {
                string address = this.Strasse;
                if (address != null && address.Length > 0)
                {
                    address += ", ";
                }

                return address + this.PLZ + " " + this.Ort;
            }
        }

        public bool IsArchived
        {
            get { return ActivationType == ActivationTypeId.Archived; }
        }

        public override bool Equals(object obj)
        {
            if (obj is CompactWohnheimDC) 
            {
                return this.WohnheimOid == ((CompactWohnheimDC)obj).WohnheimOid;

            }

            return false;
        }

        public override int GetHashCode()
        {
            return GetType().Name.GetHashCode() ^ WohnheimOid.GetHashCode();
        }

        public override string ToString()
        {
            return this.WohnheimName;
        }
    }
}