Exemplo n.º 1
0
        public KEnum(string strval, int val)
        {
            _intkey = val;
            _strkey = strval;

            bool exist = false;

            for (int i = 0; i < enumlist.Count; ++i)
            {
                KEnum e = enumlist[i];
                if (e._intkey == val || (e._strkey == strval) && e._strkey != null)
                {
                    e._intkey = val;
                    e._strkey = strval;
                    exist     = true;
                    break;
                }
            }

            if (!exist)
            {
                enumlist.Add(this);
            }
        }
Exemplo n.º 2
0
        public override bool Equals(object em)
        {
            if (em == null)
            {
                return(false);
            }

            if (em is KEnum)
            {
                KEnum k = em as KEnum;
                if (k._intkey != this._intkey)
                {
                    return(false);
                }
                if (k._strkey != this._strkey)
                {
                    return(false);
                }

                return(true);
            }

            return(false);
        }