Esempio n. 1
0
        /// <summary>
        /// Replace fields from another item
        /// </summary>
        /// <param name="item">DatItem to pull new information from</param>
        /// <param name="fields">List of Fields representing what should be updated</param>
        public override void ReplaceFields(DatItem item, List <Field> fields)
        {
            // Replace common fields first
            base.ReplaceFields(item, fields);

            // If we don't have a BiosSet to replace from, ignore specific fields
            if (item.ItemType != ItemType.BiosSet)
            {
                return;
            }

            // Cast for easier access
            BiosSet newItem = item as BiosSet;

            // Replace the fields
            if (fields.Contains(Field.DatItem_Name))
            {
                Name = newItem.Name;
            }

            if (fields.Contains(Field.DatItem_Description))
            {
                Description = newItem.Description;
            }

            if (fields.Contains(Field.DatItem_Default))
            {
                Default = newItem.Default;
            }
        }
        public override bool Equals(DatItem other)
        {
            // If we don't have a biosset, return false
            if (this.ItemType != other.ItemType)
            {
                return(false);
            }

            // Otherwise, treat it as a biosset
            BiosSet newOther = (BiosSet)other;

            // If the archive information matches
            return(this.Name == newOther.Name && this.Description == newOther.Description && this.Default == newOther.Default);
        }
Esempio n. 3
0
        public override bool Equals(DatItem other)
        {
            // If we don't have a BiosSet, return false
            if (ItemType != other.ItemType)
            {
                return(false);
            }

            // Otherwise, treat it as a BiosSet
            BiosSet newOther = other as BiosSet;

            // If the BiosSet information matches
            return(Name == newOther.Name &&
                   Description == newOther.Description &&
                   Default == newOther.Default);
        }