using System;

namespace MWS.Library.Common
{
    [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
    public class UnitSignAttribute : Attribute
    {
    
        public static readonly UnitSignAttribute Default = new UnitSignAttribute();
        private string unitSign;


        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public UnitSignAttribute() : this(string.Empty)
        {
        }

        public UnitSignAttribute(string unitSign)
        {
            this.unitSign = unitSign;
        }

 
        public virtual string UnitSign
        {
            get
            {
                return UnitSignValue;
            }
        }
 
        protected string UnitSignValue
        {
            get
            {
                return unitSign;
            }
            set
            {
                unitSign = value;
            }
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return true;
            }

            UnitSignAttribute other = obj as UnitSignAttribute;

            return (other != null) && other.unitSign == UnitSign;
        }
        public override int GetHashCode()
        {
            return UnitSign.GetHashCode();
        }
    }
}
