コード例 #1
0
 private InterfaceMethod(InterfaceMethod imToCopyFrom)
     : base(null)
 {
     imToCopyFrom.CloneInto(this);
     returnType    = imToCopyFrom.returnType.Clone();
     hasNewKeyword = imToCopyFrom.hasNewKeyword;
     foreach (Parameter p in imToCopyFrom.Parameters)
     {
         Parameters.Add((Parameter)p.Clone());
     }
 }
コード例 #2
0
        protected override bool CustomMergeStepParameterInternal(BaseConstruct user, BaseConstruct newgen, BaseConstruct prevgen)
        {
            InterfaceMethod userBC = (InterfaceMethod)user, newgenBC = (InterfaceMethod)newgen, prevgenBC = (InterfaceMethod)prevgen;

            // Return Type
            if (!Utility.MergeDataType(ref returnType, userBC.returnType, newgenBC.returnType, prevgenBC.returnType))
            {
                return(false);
            }
            // HasNewKeyword
            if (!Utility.MergeSingleItem(ref hasNewKeyword, userBC.HasNewKeyword, newgenBC.HasNewKeyword, prevgenBC.HasNewKeyword))
            {
                return(false);
            }

            return(true);
        }
コード例 #3
0
        private bool IsTheSame(InterfaceMethod comparisonFunction, ComparisonDepth depth)
        {
            if (comparisonFunction == null)
            {
                return(false);
            }

            if (Name == comparisonFunction.Name)
            {
                if (ParametersAreTheSame(comparisonFunction, depth) == false)
                {
                    return(false);
                }

                // Function names are the same, so now compare the class names
                Interface thisParentClass       = (Interface)ParentObject;
                Interface comparisonParentClass = (Interface)comparisonFunction.ParentObject;

                if (thisParentClass.IsTheSame(comparisonParentClass))
                {
                    if (depth == ComparisonDepth.Signature)
                    {
                        return(true);
                    }

                    if (returnType != comparisonFunction.returnType)
                    {
                        return(false);
                    }

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

                    if (!base.IsTheSame(comparisonFunction, depth))
                    {
                        return(false);
                    }
                    return(true);
                }
            }
            return(false);
        }
コード例 #4
0
 private bool IsTheSame(InterfaceMethod comparisonFunction)
 {
     return(IsTheSame(comparisonFunction, ComparisonDepth.Signature));
 }