コード例 #1
0
ファイル: SoftwareList.cs プロジェクト: elijah0067/SabreTools
        /// <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 SoftwareList to replace from, ignore specific fields
            if (item.ItemType != ItemType.SoftwareList)
            {
                return;
            }

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

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

            if (fields.Contains(Field.DatItem_SoftwareListStatus))
            {
                Status = newItem.Status;
            }

            if (fields.Contains(Field.DatItem_Filter))
            {
                Filter = newItem.Filter;
            }
        }
コード例 #2
0
ファイル: SoftwareList.cs プロジェクト: elijah0067/SabreTools
        public override bool Equals(DatItem other)
        {
            // If we don't have a sample, return false
            if (ItemType != other.ItemType)
            {
                return(false);
            }

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

            // If the SoftwareList information matches
            return(Name == newOther.Name &&
                   Status == newOther.Status &&
                   Filter == newOther.Filter);
        }