示例#1
0
        public int CompareTo(object obj)
        {
            if (obj is rom)
            {
                rom r = (rom)obj;

                return(this.name.CompareTo(r.name));
            }

            throw new ArgumentException("object is not a Temperature");
        }
示例#2
0
        public override bool Equals(System.Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to rom return false.
            rom r = obj as rom;

            if ((System.Object)r == null)
            {
                return(false);
            }

            // Return using our Equals function
            return(this.Equals(r));
        }
示例#3
0
        public bool Equals(rom r)
        {
            bool ret = false;

            if ((object)r == null)
            {
                ret = false;
            }
            else
            {
                if ((this.name.Equals(r.name)) &&
                    (this.crc.Equals(r.crc)) &&
                    (this.size.Equals(r.size)))
                {
                    ret = true;

                    // check md5
                    if (!String.IsNullOrEmpty(this.md5) &&
                        !String.IsNullOrEmpty(r.md5))
                    {
                        ret = ret && (this.md5.Equals(r.md5));
                    }
                    else
                    {
                        ret = ret && true;
                    }

                    // check sha1
                    if (!String.IsNullOrEmpty(this.sha1) &&
                        !String.IsNullOrEmpty(r.sha1))
                    {
                        ret = ret && (this.sha1.Equals(r.sha1));
                    }
                    else
                    {
                        ret = ret && true;
                    }
                }
            }

            return(ret);
        }