private Type dotNetType; // cached dotnet type

        #endregion

        #region Object overrides

        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }

            ITypeDeclaration type = obj as ITypeDeclaration;

            if (type == null)
            {
                return(false);
            }

            if (Name != type.Name ||
                Namespace != type.Namespace ||
                !Util.AreEqual(BaseType, type.BaseType))
            {
                return(false);
            }

            bool deepEquality = false;

            if (!deepEquality)
            {
                return(true);
            }
            if (Interface != type.Interface ||
                Abstract != type.Abstract ||
                Sealed != type.Sealed ||
                Partial != type.Partial)
            {
                return(false);
            }
            if (!EnumerableExtensions.AreEqual(GenericArguments, type.GenericArguments))
            {
                return(false);
            }
            if (!EnumerableExtensions.AreEqual(Attributes, type.Attributes))
            {
                return(false);
            }
            if (!EnumerableExtensions.AreEqual(Fields, type.Fields))
            {
                return(false);
            }
            if (!EnumerableExtensions.AreEqual(Properties, type.Properties))
            {
                return(false);
            }
            if (!EnumerableExtensions.AreEqual(Methods, type.Methods))
            {
                return(false);
            }
            if (!EnumerableExtensions.AreEqual(NestedTypes, type.NestedTypes))
            {
                return(false);
            }
            return(true);
        }
示例#2
0
            public override bool Equals(object obj)
            {
                ConditionContext that = obj as ConditionContext;

                if (ReferenceEquals(that, null))
                {
                    return(false);
                }
                return(EnumerableExtensions.AreEqual(this.blocks, that.blocks));
            }