/// <summary>
        ///   Convert this instance getter to a method entity.
        /// </summary>
        /// <returns>A method entity.</returns>
        public MethodEntity GetterAsMethodEntity()
        {
            MethodEntity methodEntity = this.Getter;

            methodEntity.MinAvailability = this.MinAvailability;
            methodEntity.MaxAvailability = this.MaxAvailability;
            methodEntity.Name            = this.Name;
            methodEntity.ReturnType      = this.Type;
            methodEntity.Static          = this.Static;
            methodEntity.Summary         = this.Summary;
            return(methodEntity);
        }
Beispiel #2
0
        /// <summary>
        ///   Adds the entities.
        /// </summary>
        /// <param name = "entities">The entities.</param>
        public override void AddRange(List <BaseEntity> entities)
        {
            base.AddRange(entities);

            foreach (BaseEntity entity in entities)
            {
                MethodEntity methodEntity = entity as MethodEntity;
                if (methodEntity != null)
                {
                    this.Methods.Add(methodEntity);
                }
                PropertyEntity propertyEntity = entity as PropertyEntity;
                if (propertyEntity != null)
                {
                    this.Properties.Add(propertyEntity);
                }
            }
        }
        /// <summary>
        ///   Convert this instance setter to a method entity.
        /// </summary>
        /// <returns>A method entity.</returns>
        public MethodEntity SetterAsMethodEntity()
        {
            MethodEntity methodEntity = this.Setter;

            if (methodEntity != null)
            {
                methodEntity.MinAvailability = this.MinAvailability;
                methodEntity.MaxAvailability = this.MaxAvailability;
                methodEntity.Name            = "Set" + this.Name;
                methodEntity.ReturnType      = "void";
                MethodParameterEntity methodParameterEntity = new MethodParameterEntity();
                methodParameterEntity.Type = this.Type;
                methodParameterEntity.Name = "value";
                methodEntity.Parameters.Add(methodParameterEntity);
                methodEntity.Static  = this.Static;
                methodEntity.Summary = this.Summary;
            }
            return(methodEntity);
        }
Beispiel #4
0
        /// <summary>
        ///   Determines whether the specified instance has method.
        /// </summary>
        /// <param name = "name">The name.</param>
        /// <param name = "isStatic">if set to <c>true</c> [is static].</param>
        /// <returns>
        ///   <c>true</c> if the specified instance has method; otherwise, <c>false</c>.
        /// </returns>
        public bool HasMethod(String name, bool isStatic)
        {
            MethodEntity entity = this.Methods.SingleOrDefault(m => m.Name.Equals(name) && m.Static == isStatic);

            return(entity != null);
        }