Example #1
0
        private bool IsTheSame(InterfaceIndexer comparisonIndexer, ComparisonDepth depth)
        {
            if (comparisonIndexer == null)
            {
                return(false);
            }

            if (Name == comparisonIndexer.Name)
            {
                if (ParametersAreTheSame(comparisonIndexer, depth) == false)
                {
                    return(false);
                }
                // Function names are the same, so now compare the class names

                if (ParentObject.IsTheSame(comparisonIndexer.ParentObject))
                {
                    if (depth == ComparisonDepth.Signature)
                    {
                        return(true);
                    }
                    if (dataType != comparisonIndexer.dataType)
                    {
                        return(false);
                    }

                    if (hasNewKeyword != comparisonIndexer.hasNewKeyword)
                    {
                        ComparisonDifference += GetType().Name + ".HasNewKeyword";
                        return(false);
                    }

                    if (depth == ComparisonDepth.Outer)
                    {
                        return(true);
                    }

                    if (!base.IsTheSame(comparisonIndexer, depth))
                    {
                        return(false);
                    }
                    if (!GetAccessor.IsTheSame(comparisonIndexer.GetAccessor))
                    {
                        ComparisonDifference += GetType().Name + ".GetAccessor";
                        return(false);
                    }
                    if (!SetAccessor.IsTheSame(comparisonIndexer.SetAccessor))
                    {
                        ComparisonDifference += GetType().Name + ".SetAccessor";
                        return(false);
                    }
                    return(true);
                }
            }
            return(false);
        }
        private bool IsTheSame(InterfaceProperty comparisonProperty, ComparisonDepth depth)
        {
            if (comparisonProperty == null)
            {
                return(false);
            }

            if (Name == comparisonProperty.Name)
            {
                // TODO: Parent Object Comparison
                //                if (ParentObject.IsTheSame(comparisonProperty.ParentObject))
                {
                    if (depth == ComparisonDepth.Signature)
                    {
                        return(true);
                    }

                    if (!base.IsTheSame(comparisonProperty, depth))
                    {
                        return(false);
                    }

                    if (DataType != comparisonProperty.DataType)
                    {
                        return(false);
                    }

                    if (depth == ComparisonDepth.Outer)
                    {
                        return(true);
                    }

                    if (!GetAccessor.IsTheSame(comparisonProperty.GetAccessor))
                    {
                        ComparisonDifference += GetType().Name + ".GetAccessor";
                        return(false);
                    }
                    if (!SetAccessor.IsTheSame(comparisonProperty.SetAccessor))
                    {
                        ComparisonDifference += GetType().Name + ".SetAccessor";
                        return(false);
                    }
                    return(true);
                }
            }
            return(false);
        }