text: public override bool Equals(object obj){if (obj is DictionaryEntry){object key = ((DictionaryEntry)obj).Key;object val = ((DictionaryEntry)obj).Value;if (key is string && val is Ref){Ref r = (Ref)val;if (r.GetName().Equals(this.@ref.GetName())){ObjectId a = r.GetObjectId();ObjectId b = this.@ref.GetObjectId();if (a != null && b != null && AnyObjectId.Equals(a, b)){return true;}}}}return false;}