/// <summary> /// Make a copy of the attribute. /// </summary> /// <returns>A copy of the attribute.</returns> public override ViewerAttribute Clone() { // Return a copy of this attribute. ViewerStringFormat viewerStringFormat = new ViewerStringFormat(); viewerStringFormat.StringFormat = this.StringFormat; return(viewerStringFormat); }
/// <summary> /// Determines if two ViewerStringFormat objects are equivalent. /// </summary> /// <param name="obj">An object to be compared.</param> /// <returns>true if the two objects value is the same, false otherwise.</returns> public override bool Equals(object obj) { // This will compare the values when two ViewerStringFormat objects are compared. if (obj is ViewerStringFormat) { ViewerStringFormat viewerStringFormat = obj as ViewerStringFormat; return(this.StringFormat.Alignment == viewerStringFormat.StringFormat.Alignment && this.StringFormat.LineAlignment == viewerStringFormat.StringFormat.LineAlignment && this.StringFormat.FormatFlags == viewerStringFormat.StringFormat.FormatFlags); } // This object isn't equivalent to any other types of object. return(false); }