namespace GMLL00ImportadorXsd.Presentacion
{
    using System;
    using System.Drawing;

    internal struct Degradado : IEquatable<Degradado>
    {
        public float Angulo { get; set; }

        public Color ColorFinal { get; set; }

        public Color ColorInicial { get; set; }

        public static bool operator ==(Degradado a, Degradado b)
        {
            return a.Equals(b);
        }

        public static bool operator !=(Degradado a, Degradado b)
        {
            return !(a == b);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (obj.GetType() != typeof(Degradado))
            {
                return false;
            }

            return this.Equals((Degradado)obj);
        }

        public bool Equals(Degradado other)
        {
            return other.Angulo == this.Angulo && other.ColorFinal.Equals(this.ColorFinal) && other.ColorInicial.Equals(this.ColorInicial);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                int result = this.Angulo.GetHashCode();
                result = (result * 397) ^ this.ColorFinal.GetHashCode();
                result = (result * 397) ^ this.ColorInicial.GetHashCode();
                return result;
            }
        }
    }
}