/// ------------------------------------------------------------------------------------ /// <summary> /// Some comparisons don't care about the content of the property table, so we provide a /// method similar to Equals but not quite as demanding. /// </summary> /// <param name="lnk">The link to compare.</param> /// ------------------------------------------------------------------------------------ public override bool EssentiallyEquals(FwLinkArgs lnk) { var appArgs = lnk as FwAppArgs; if (appArgs == null || !base.EssentiallyEquals(lnk)) { return(false); } return(appArgs.AppAbbrev == AppAbbrev && appArgs.Database == Database && appArgs.Server == Server); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Determines whether the specified <see cref="T:System.Object"/> is equal to this instance. /// </summary> /// <param name="obj">The <see cref="T:System.Object"/> to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified <see cref="T:System.Object"/> is equal to this instance; otherwise, <c>false</c>. /// </returns> /// <exception cref="T:System.NullReferenceException"> /// The <paramref name="obj"/> parameter is null. /// </exception> /// ------------------------------------------------------------------------------------ public override bool Equals(object obj) { FwLinkArgs link = obj as FwLinkArgs; if (link == null) { return(false); } if (link == this) { return(true); } //just compare the URLs return(ToString() == link.ToString()); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Some comparisons don't care about the content of the property table, so we provide a /// method similar to Equals but not quite as demanding. /// </summary> /// <param name="lnk">The link to compare.</param> /// ------------------------------------------------------------------------------------ public virtual bool EssentiallyEquals(FwLinkArgs lnk) { if (lnk == null) { return(false); } if (lnk == this) { return(true); } if (lnk.ToolName != ToolName) { return(false); } if (lnk.TargetGuid != TargetGuid) { return(false); } // tag is optional, but if a tool uses it with content, it should consistently provide content. // therefore if one of these links does not have content, and the other does then // we'll assume they refer to the same link // (one link simply comes from a control with more knowledge then the other one) return(lnk.Tag.Length == 0 || Tag.Length == 0 || lnk.Tag == Tag); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Some comparisons don't care about the content of the property table, so we provide a /// method similar to Equals but not quite as demanding. /// </summary> /// <param name="lnk">The link to compare.</param> /// ------------------------------------------------------------------------------------ public virtual bool EssentiallyEquals(FwLinkArgs lnk) { if (lnk == null) return false; if (lnk == this) return true; if (lnk.ToolName != ToolName) return false; if (lnk.TargetGuid != TargetGuid) return false; // tag is optional, but if a tool uses it with content, it should consistently provide content. // therefore if one of these links does not have content, and the other does then // we'll assume they refer to the same link // (one link simply comes from a control with more knowledge then the other one) return lnk.Tag.Length == 0 || Tag.Length == 0 || lnk.Tag == Tag; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Some comparisons don't care about the content of the property table, so we provide a /// method similar to Equals but not quite as demanding. /// </summary> /// <param name="lnk">The link to compare.</param> /// ------------------------------------------------------------------------------------ public override bool EssentiallyEquals(FwLinkArgs lnk) { var appArgs = lnk as FwAppArgs; if (appArgs == null || !base.EssentiallyEquals(lnk)) return false; return (appArgs.AppAbbrev == AppAbbrev && appArgs.Database == Database && appArgs.Server == Server); }