public override bool Equals(object obj) { if (obj == null || !(obj is AtomicNativeObjectInfo)) { return(false); } var noi = (AtomicNativeObjectInfo)obj; return(TheObject == noi.GetObject() || TheObject.Equals(noi.GetObject())); }
private bool CheckIfCollectionContainsNativeValue(IEnumerable collection, Type typeDefinition) { if (typeDefinition == typeof(AbstractObjectInfo)) { foreach (AbstractObjectInfo abstractObjectInfo in collection) { if (abstractObjectInfo == null && TheObject == null) { return(true); } if (abstractObjectInfo != null && TheObject == null) { return(false); } if (abstractObjectInfo != null && TheObject.Equals(abstractObjectInfo.GetObject())) { return(true); } } } else { foreach (var item in collection) { if (item == null && TheObject == null) { return(true); } if (item != null && TheObject == null) { return(false); } if (TheObject.Equals(item)) { return(true); } } } return(false); }