public override bool Equals(DatItem other) { // If we don't have a Analog, return false if (ItemType != other.ItemType) { return(false); } // Otherwise, treat it as a Analog Analog newOther = other as Analog; // If the Feature information matches return(Mask == newOther.Mask); }
/// <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 Analog to replace from, ignore specific fields if (item.ItemType != ItemType.Analog) { return; } // Cast for easier access Analog newItem = item as Analog; // Replace the fields if (fields.Contains(Field.DatItem_Analog_Mask)) { Mask = newItem.Mask; } }