public int CompareToWithoutConsideringPrimary(object obj) { WixComplexReferenceRow other = obj as WixComplexReferenceRow; if (null == other) { throw new ArgumentException(WixDataStrings.EXP_ExpectedComplexReferenceType, "obj"); } int comparison = this.ChildType - other.ChildType; if (0 == comparison) { comparison = String.Compare(this.ChildId, other.ChildId, StringComparison.Ordinal); if (0 == comparison) { comparison = this.ParentType - other.ParentType; if (0 == comparison) { string thisParentLanguage = null == this.ParentLanguage ? String.Empty : this.ParentLanguage; string otherParentLanguage = null == other.ParentLanguage ? String.Empty : other.ParentLanguage; comparison = String.Compare(thisParentLanguage, otherParentLanguage, StringComparison.Ordinal); if (0 == comparison) { comparison = String.Compare(this.ParentId, other.ParentId, StringComparison.Ordinal); } } } } return(comparison); }
/// <summary> /// Changes all of the parent references to point to the passed in parent reference. /// </summary> /// <param name="parent">New parent complex reference.</param> public void Reparent(WixComplexReferenceRow parent) { this.ParentId = parent.ParentId; this.ParentLanguage = parent.ParentLanguage; this.ParentType = parent.ParentType; if (!this.IsPrimary) { this.IsPrimary = parent.IsPrimary; } }
/// <summary> /// Creates a shallow copy of the ComplexReference. /// </summary> /// <returns>A shallow copy of the ComplexReference.</returns> public WixComplexReferenceRow Clone() { WixComplexReferenceRow wixComplexReferenceRow = new WixComplexReferenceRow(this.SourceLineNumbers, this.Table); wixComplexReferenceRow.ParentType = this.ParentType; wixComplexReferenceRow.ParentId = this.ParentId; wixComplexReferenceRow.ParentLanguage = this.ParentLanguage; wixComplexReferenceRow.ChildType = this.ChildType; wixComplexReferenceRow.ChildId = this.ChildId; wixComplexReferenceRow.IsPrimary = this.IsPrimary; return(wixComplexReferenceRow); }