Пример #1
0
        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()));
        }
Пример #2
0
        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);
        }