private bool IsTheSame(InterfaceAccessor comparisonInterfaceAccessor, ComparisonDepth depth)
        {
            if (comparisonInterfaceAccessor == null)
            {
                return(false);
            }

            if (AccessorType == comparisonInterfaceAccessor.AccessorType)
            {
                // Function names are the same, so now compare the class names
                // TODO: Parent Comparison
                //                if (ParentObject.IsTheSame(comparisonInterfaceAccessor.ParentObject))
                {
                    if (depth == ComparisonDepth.Signature)
                    {
                        return(true);
                    }

                    if (!base.IsTheSame(comparisonInterfaceAccessor, depth))
                    {
                        return(false);
                    }
                    if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.StringCollectionsAreTheSame(Modifiers, comparisonInterfaceAccessor.Modifiers))
                    {
                        ComparisonDifference += GetType().Name + ".Modifiers";
                        return(false);
                    }
                    return(true);
                }
            }
            return(false);
        }
 private InterfaceAccessor(InterfaceAccessor propToCopyFrom)
     : base(null)
 {
     propToCopyFrom.CloneInto(this);
     AccessorType = propToCopyFrom.AccessorType;
     Modifiers    = new List <string>(propToCopyFrom.Modifiers);
 }
        protected override bool CustomMergeStepInternal(BaseConstruct user, BaseConstruct newgen, BaseConstruct prevgen)
        {
            InterfaceAccessor userBC = (InterfaceAccessor)user, newgenBC = (InterfaceAccessor)newgen, prevgenBC = (InterfaceAccessor)prevgen;

            // Modifiers
            if (!Utility.MergeModifiers(this, userBC, newgenBC, prevgenBC))
            {
                return(false);
            }
            return(true);
        }
 public InterfaceProperty(Controller controller, BaseConstruct parentObject, string name, DotNet.DataType dataType, InterfaceAccessor getAccessor, InterfaceAccessor setAccessor, bool hasNewKeyword, CodeLanguage language, int nodeIndex)
     : base(controller)
 {
     ParentObject  = parentObject;
     Name          = name;
     DataType      = dataType;
     GetAccessor   = getAccessor;
     SetAccessor   = setAccessor;
     HasNewKeyword = hasNewKeyword;
     Language      = language;
     Index         = nodeIndex;
 }
Exemple #5
0
 public InterfaceIndexer(Controller controller, BaseConstruct parentObject, DotNet.DataType dataType, bool hasNewKeyword, IEnumerable <Parameter> parameters, InterfaceAccessor getAccessor, InterfaceAccessor setAccessor, CodeLanguage language, int nodeIndex)
     : this(controller)
 {
     ParentObject       = parentObject;
     this.dataType      = dataType;
     this.hasNewKeyword = hasNewKeyword;
     if (parameters != null)
     {
         Parameters.AddRange(parameters);
     }
     GetAccessor = getAccessor;
     SetAccessor = setAccessor;
     Language    = language;
     Index       = nodeIndex;
 }
Exemple #6
0
        /// <summary>
        /// Adds a new child to this IBaseConstruct.
        /// </summary>
        /// <param name="childBC"></param>
        protected override void AddChildInternal(BaseConstruct childBC)
        {
            if (childBC == null)
            {
                throw new InvalidOperationException("Cannot add null child");
            }

            if (childBC is InterfaceAccessor)
            {
                InterfaceAccessor newAccessor = (InterfaceAccessor)childBC;
                if (newAccessor.AccessorType == InterfaceAccessor.AccessorTypes.Get)
                {
                    GetAccessor = newAccessor;
                }
                else
                {
                    SetAccessor = newAccessor;
                }
            }
            else
            {
                throw new InvalidOperationException("Cannot add child of type " + childBC.GetType());
            }
        }
 private bool IsTheSame(InterfaceAccessor comparisonFunction)
 {
     return(IsTheSame(comparisonFunction, ComparisonDepth.Signature));
 }