Ejemplo n.º 1
0
        public void AddGroup(IMethod method)
        {
            if (groups.Any() &&
                !method.ReturnType.Equals(groups.Last().Parametric.ReturnType))
            {
                throw new ReturnTypesDoNotMatchException(method, groups.Last().Parametric.ReturnType, method.ReturnType);
            }

            if (groups.Any(g => g.ContainsSameParameters(method)))
            {
                throw new IdenticalSignatureAlreadyAddedException(method);
            }

            DomainParameter.AddGroupToTarget(method, this);

            Marks.Join(ctx.CodingStyle.GetMarks(method));
        }
        public void AddGroup(IConstructor constructor)
        {
            if (groups.Any() &&
                !constructor.InitializedType.Equals(groups.Last().Parametric.InitializedType))
            {
                throw new InitializedTypeDoNotMatchException(constructor, groups.Last().Parametric.InitializedType, constructor.InitializedType);
            }

            if (groups.Any(g => g.ContainsSameParameters(constructor)))
            {
                throw new IdenticalSignatureAlreadyAddedException(constructor);
            }

            DomainParameter.AddGroupToTarget(constructor, this);

            Marks.Join(ctx.CodingStyle.GetMarks(constructor));
        }
Ejemplo n.º 3
0
 protected bool Equals(DomainParameter other)
 {
     return(string.Equals(Name, other.Name));
 }